Class ApplicationValidator

java.lang.Object
com.broadleafcommerce.tenant.service.validation.ApplicationValidator
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

public class ApplicationValidator extends Object implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for Application.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Constructor Details

    • ApplicationValidator

      public ApplicationValidator()
  • Method Details

    • supports

      public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      supports in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validate

      public void validate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      validate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validateName

      protected void validateName(org.springframework.validation.Errors errors)
    • validateIdentifierType

      protected void validateIdentifierType(org.springframework.validation.Errors errors)
    • validateIdentifierValue

      protected void validateIdentifierValue(org.springframework.validation.Errors errors)
    • validateIsolatedCatalogs

      protected void validateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors)
      This just performs basic field validations on the requested isolated catalogs. For deeper validations, see fetchAndValidateIsolatedCatalogs(Application, Errors, ContextInfo).
      Parameters:
      application - the application whose isolated catalogs should be validated
      errors - errors instance on which to register errors
    • fetchAndValidateIsolatedCatalogs

      protected void fetchAndValidateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Performs deeper validation on existence and vendor-associations of assigned isolated catalogs. Should only be run after all other basic field validations pass, such as validateIsolatedCatalogs(Application, Errors).
      Parameters:
      application - the application whose isolated catalogs should be validated
      errors - errors instance on which to register errors
      contextInfo - context information around multitenant state
    • getCatalogService

      protected CatalogService<Catalog> getCatalogService()
      Lazy injection to avoid circular dependency exceptions.
    • setCatalogService

      @Autowired @Lazy public void setCatalogService(CatalogService<Catalog> catalogService)
      Lazy injection to avoid circular dependency exceptions.
    • getTenantApplicationProperties

      @Deprecated protected TenantApplicationProperties getTenantApplicationProperties()
      Deprecated.
      in favor of ApplicationConfigurationProperties
    • setTenantApplicationProperties

      @Deprecated @Autowired public void setTenantApplicationProperties(TenantApplicationProperties tenantApplicationProperties)
      Deprecated.
      in favor of ApplicationConfigurationProperties
    • getApplicationConfigurationProperties

      protected com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationConfigurationProperties getApplicationConfigurationProperties()
      Since:
      1.7.15, 2.0.1
    • setApplicationConfigurationProperties

      @Autowired public void setApplicationConfigurationProperties(com.broadleafcommerce.data.tracking.core.tenant.service.ApplicationConfigurationProperties applicationConfigurationProperties)
      Since:
      1.7.15, 2.0.1