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 and Description |
---|
DefaultApplicationService(ApplicationRepository<D> repository,
SimplePayloadMapper mapper) |
Modifier and Type | Method and Description |
---|---|
P |
create(P payload) |
void |
delete(String id) |
List<P> |
findApplicationsForCustomerContext(String customerContextId)
Returns the application, or applications for a particular customer context.
|
List<P> |
findApplicationsForTenant(String tenantId)
Returns the application or applications for a particular tenant.
|
Optional<P> |
findById(String id) |
List<P> |
findByIdIn(Collection<String> ids) |
protected SimplePayloadMapper |
getMapper() |
protected ApplicationRepository<D> |
getRepository() |
Optional<P> |
readByIdentifier(String identifierType,
String identifierValue) |
P |
replace(String id,
P payload) |
P |
save(P payload) |
public DefaultApplicationService(ApplicationRepository<D> repository, SimplePayloadMapper mapper)
public P create(P payload)
create
in interface ApplicationService<P extends Application>
@CacheEvict(cacheNames="authCacheApplicationUrlByApplicationId") public void delete(String id)
delete
in interface ApplicationService<P extends Application>
@NonNull @CacheEvict(cacheNames="authCacheApplicationUrlByApplicationId", key="#p0") public P replace(String id, P payload)
replace
in interface ApplicationService<P extends Application>
public Optional<P> readByIdentifier(String identifierType, String identifierValue)
readByIdentifier
in interface ApplicationService<P extends Application>
public List<P> findApplicationsForCustomerContext(String customerContextId)
ApplicationService
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.
findApplicationsForCustomerContext
in interface ApplicationService<P extends Application>
customerContextId
- The customer context ID.Applications
or an empty list if no applications are
found for this customer context.AuthorizedClientService.findApplicationClient(String, String)
,
AuthorizedClient.getServerId()
public List<P> findApplicationsForTenant(String tenantId)
ApplicationService
findApplicationsForTenant
in interface ApplicationService<P extends Application>
tenantId
- The tenant IDpublic Optional<P> findById(String id)
findById
in interface ApplicationService<P extends Application>
public List<P> findByIdIn(Collection<String> ids)
findByIdIn
in interface ApplicationService<P extends Application>
public P save(P payload)
save
in interface ApplicationService<P extends Application>
protected ApplicationRepository<D> getRepository()
protected SimplePayloadMapper getMapper()
Copyright © 2021. All rights reserved.