Class DefaultApplicationService<P extends Application,D extends com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable & com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware>
java.lang.Object
com.broadleafcommerce.auth.tenant.service.DefaultApplicationService<P,D>
- All Implemented Interfaces:
ApplicationService<P>
public class DefaultApplicationService<P extends Application,D extends com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable & com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware>
extends Object
implements ApplicationService<P>
-
Constructor Summary
ConstructorDescriptionDefaultApplicationService
(ApplicationRepository<D> repository, SimplePayloadMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
findApplicationsForCustomerContext
(String customerContextId) Returns the application, or applications for a particular customer context.findApplicationsForTenant
(String tenantId) Returns the application or applications for a particular tenant.findByIdIn
(Collection<String> ids) protected SimplePayloadMapper
protected ApplicationRepository<D>
readByIdentifier
(String identifierType, String identifierValue)
-
Constructor Details
-
DefaultApplicationService
-
-
Method Details
-
create
- Specified by:
create
in interfaceApplicationService<P extends Application>
-
delete
- Specified by:
delete
in interfaceApplicationService<P extends Application>
-
replace
@NonNull @CacheEvict(cacheNames="authCacheApplicationUrlByApplicationId", key="#p0") public P replace(String id, P payload) - Specified by:
replace
in interfaceApplicationService<P extends Application>
-
readByIdentifier
- Specified by:
readByIdentifier
in interfaceApplicationService<P extends Application>
-
findApplicationsForCustomerContext
Description copied from interface:ApplicationService
Returns the application, or applications for a particular customer context. If no applications exist for the customer context, the list returned will be empty.Note that the primary usage for this call is assigning newly created customers to the correct
authorization server
viaAuthorizedClient
. In the case that this returns a list with multiple Applications, these applications should all share the same authorization server, so it is safe to simply use the value at index 0.- Specified by:
findApplicationsForCustomerContext
in interfaceApplicationService<P extends Application>
- Parameters:
customerContextId
- The customer context ID.- Returns:
- A list of
Applications
or an empty list if no applications are found for this customer context. - See Also:
-
findApplicationsForTenant
Description copied from interface:ApplicationService
Returns the application or applications for a particular tenant. If no applications exist for the supplied tenant id, the list returned will be empty.- Specified by:
findApplicationsForTenant
in interfaceApplicationService<P extends Application>
- Parameters:
tenantId
- The tenant ID- Returns:
- A list of applications for the supplied tenant ID.
-
findById
@Cacheable(cacheNames="authCacheApplicationByApplicationId", key="#a0", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public Optional<P> findById(String id) - Specified by:
findById
in interfaceApplicationService<P extends Application>
-
findByIdIn
- Specified by:
findByIdIn
in interfaceApplicationService<P extends Application>
-
save
- Specified by:
save
in interfaceApplicationService<P extends Application>
-
getRepository
-
getMapper
-