Class DefaultTenantService<P extends Tenant>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
com.broadleafcommerce.tenant.service.DefaultTenantService<P>
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>, TenantService<P>

public class DefaultTenantService<P extends Tenant> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P> implements TenantService<P>
  • Constructor Details

    • DefaultTenantService

      public DefaultTenantService(TenantRepository<R> repository, com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityHelper helper)
  • Method Details

    • readByIdentifierAndIdentifierType

      public Optional<P> readByIdentifierAndIdentifierType(String identifier, @Nullable String identifierType)
      Description copied from interface: TenantService
      Read the tenant by its Tenant.getIdentifierValue() and, optionally, by Tenant.getIdentifierType(). If not provided, identifier will default to ResolutionIdentifierType.DOMAIN.
      Specified by:
      readByIdentifierAndIdentifierType in interface TenantService<P extends Tenant>
      Parameters:
      identifier - the Tenant.getIdentifierValue()
      identifierType - the Tenant.getIdentifierType()
      Returns:
      the Tenant with the matching Tenant.getIdentifierValue()
    • create

      public <D, R extends org.springframework.data.repository.CrudRepository<D, String> & com.broadleafcommerce.common.extension.DomainTypeAware> P create(P businessInstance)
      Specified by:
      create in interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P extends Tenant>
      Overrides:
      create in class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends Tenant>
    • update

      public P update(String id, @NonNull P businessInstance)
      Specified by:
      update in interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P extends Tenant>
      Overrides:
      update in class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends Tenant>
    • replace

      public P replace(String id, @NonNull P businessInstance)
      Specified by:
      replace in interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P extends Tenant>
      Overrides:
      replace in class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends Tenant>
    • delete

      public void delete(String id)
      Specified by:
      delete in interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P extends Tenant>
      Overrides:
      delete in class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends Tenant>
    • ensureDefaultLocaleAddedToAllowedLocales

      protected void ensureDefaultLocaleAddedToAllowedLocales(@NonNull P tenant)
    • ensureDefaultCurrencyAddedToAllowedCurrencies

      protected void ensureDefaultCurrencyAddedToAllowedCurrencies(@NonNull P tenant)
    • createWithRelatedEntities

      protected P createWithRelatedEntities(@NonNull P tenant)
      Creates related entities along with the tenant. By default, this creates a DefaultCatalogType.SEARCH_GROUP type Catalog.
      Since:
      2.1.0-GA
    • getRepository

      protected TenantRepository<?> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P extends Tenant>
    • getTenantDomainProperties

      protected TenantDomainProperties getTenantDomainProperties()
      Since:
      2.1.0-GA
    • setTenantDomainProperties

      @Autowired public void setTenantDomainProperties(TenantDomainProperties tenantDomainProperties)
      Since:
      2.1.0-GA
    • getCatalogService

      protected CatalogService<Catalog> getCatalogService()
      Since:
      2.1.0-GA
    • setCatalogService

      @Autowired @Lazy public void setCatalogService(CatalogService<Catalog> catalogService)
      Since:
      2.1.0-GA
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
      Since:
      2.1.0-GA
    • setTypeFactory

      @Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
      Since:
      2.1.0-GA