Class MarketplaceApplicationCatalogValidator

java.lang.Object
com.broadleafcommerce.tenant.service.validation.MarketplaceApplicationCatalogValidator

public class MarketplaceApplicationCatalogValidator extends Object
A validator specifically intended for use in the MarketplaceApplicationCatalogService. It intentionally does not implement EntityValidator, as it does not apply in the normal CRUD flow.
Author:
Jeff Fischer
  • Constructor Details

  • Method Details

    • validateForCreate

      public void validateForCreate(@Nullable String applicationId, @NonNull @NonNull Catalog catalog, @NonNull @NonNull MarketplaceApplicationCatalog applicationCatalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors)
      Validate the MarketplaceApplicationCatalog create request is valid when compared to the contextual applicationId and the catalog type. The catalog must be of a vendor type, which specifically means the Catalog.getVendorRef() must not be null.
      Parameters:
      applicationId - The contextual application
      catalog - The requested catalog
      applicationCatalog - The requested entity to create
      contextInfo - The current request context information
      errors - The container for any errors that should be bubbled back to the caller's API request
    • validateForReplace

      public void validateForReplace(@Nullable String applicationId, @NonNull @NonNull MarketplaceApplicationCatalog original, @NonNull @NonNull MarketplaceApplicationCatalog replacement, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors)
      Validate the MarketplaceApplicationCatalog update or replace request is valid when compared to the existing instance. The catalog, application, and implicit catalog values may not be changed.
      Parameters:
      applicationId - The contextual application
      original - The original entity instance
      replacement - The requested replacement
      contextInfo - The current request context information
      errors - The container for any erros that should be bubbled back to the caller's API request
    • validateForDelete

      public void validateForDelete(@Nullable String applicationId, @NonNull @NonNull MarketplaceApplicationCatalog applicationCatalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors)
      Validate the MarketplaceApplicationCatalog delete request is valid when compared to the contextual applicationId.
      Parameters:
      applicationId - The contextual application
      applicationCatalog - The requested entity to create
      contextInfo - The current request context information
      errors - The container for any errors that should be bubbled back to the caller's API request
    • prefixWithValidationMessageKey

      protected String prefixWithValidationMessageKey(String errorCode)
    • getApplicationService

      @NonNull protected ApplicationService<Application> getApplicationService()
    • getMarketplaceApplicationCatalogService

      protected MarketplaceApplicationCatalogService<MarketplaceApplicationCatalog> getMarketplaceApplicationCatalogService()
      Lazy injection to avoid circular dependency exceptions.
    • setMarketplaceApplicationCatalogService

      @Autowired @Lazy public void setMarketplaceApplicationCatalogService(MarketplaceApplicationCatalogService<MarketplaceApplicationCatalog> marketplaceApplicationCatalogService)
      Lazy injection to avoid circular dependency exceptions.