Class DefaultAuthorizationServerService<P extends AuthorizationServer,D extends com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable & com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware>
java.lang.Object
com.broadleafcommerce.auth.server.service.DefaultAuthorizationServerService<P,D>
- All Implemented Interfaces:
AuthorizationServerService<P>
public class DefaultAuthorizationServerService<P extends AuthorizationServer,D extends com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable & com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware>
extends Object
implements AuthorizationServerService<P>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultAuthorizationServerService(AuthorizationServerRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator entityValidator) -
Method Summary
Modifier and TypeMethodDescriptionCreate a new authorization servervoidDelete an authorization servervoiddeleteById(String id) Delete an authorization serverbooleanexistsById(String id) Check if an authorization server exists by its IDorg.springframework.data.domain.Page<P>findAll(org.springframework.data.domain.Pageable pageable) Find all authorization servers.org.springframework.data.domain.Page<P>findAllByTenantId(String tenantId, org.springframework.data.domain.Pageable pageable) Find all authorization servers for a tenant.Find an authorization server by its IDfindByName(String name) Find an authorization server by its namefindByNameAndTenantId(String name, String tenantId) Find an authorization server by its name and tenant idFind the repository domain by ID without converting to business domain.fromRepositoryDomain(Optional<D> optionalDomain) protected org.springframework.data.domain.Page<P>fromRepositoryDomain(org.springframework.data.domain.Page<D> page) protected com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidatorprotected SimplePayloadMapperprotected AuthorizationServerRepository<D>Replace an authorization serverSave an authorization serverprotected void
-
Field Details
-
CACHE_BY_SERVER_ID
- See Also:
-
-
Constructor Details
-
DefaultAuthorizationServerService
public DefaultAuthorizationServerService(AuthorizationServerRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator entityValidator)
-
-
Method Details
-
findAll
public org.springframework.data.domain.Page<P> findAll(org.springframework.data.domain.Pageable pageable) Description copied from interface:AuthorizationServerServiceFind all authorization servers.- Specified by:
findAllin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
pageable- the pageable- Returns:
- A page of authorization servers
-
findAllByTenantId
public org.springframework.data.domain.Page<P> findAllByTenantId(String tenantId, org.springframework.data.domain.Pageable pageable) Description copied from interface:AuthorizationServerServiceFind all authorization servers for a tenant.- Specified by:
findAllByTenantIdin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
tenantId- the tenant IDpageable- the pageable- Returns:
- a page of authorization servers for the tenant
-
findById
@Cacheable(cacheNames="authCacheByServerId", key="#a0", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public Optional<P> findById(String id) Description copied from interface:AuthorizationServerServiceFind an authorization server by its ID- Specified by:
findByIdin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
id- The authorization server ID- Returns:
- An optional of authorization server
-
existsById
Description copied from interface:AuthorizationServerServiceCheck if an authorization server exists by its ID- Specified by:
existsByIdin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
id- The authorization server ID- Returns:
- whether or not the authorization server exists
-
findByName
Description copied from interface:AuthorizationServerServiceFind an authorization server by its name- Specified by:
findByNamein interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
name- The name of the authorization service- Returns:
- An optional of authorization server
-
findByNameAndTenantId
Description copied from interface:AuthorizationServerServiceFind an authorization server by its name and tenant id- Specified by:
findByNameAndTenantIdin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
name- The name of the authorization servicetenantId- the tenant id that thisAuthorizationServerbelongs to- Returns:
- An optional of authorization server
-
replace
@CacheEvict(cacheNames="authCacheByServerId", key="#a0") public P replace(String id, P authorizationServer) Description copied from interface:AuthorizationServerServiceReplace an authorization server- Specified by:
replacein interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
id- The id of the server to replaceauthorizationServer- The replacement- Returns:
- The replaced authorization server
-
create
@CachePut(cacheNames="authCacheByServerId", key="#result.id") public P create(P authorizationServer) Description copied from interface:AuthorizationServerServiceCreate a new authorization server- Specified by:
createin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
authorizationServer- The authorization server to create- Returns:
- The created authorization server.
-
delete
@CacheEvict(cacheNames="authCacheByServerId", key="#a0.id") public void delete(P authorizationServer) Description copied from interface:AuthorizationServerServiceDelete an authorization server- Specified by:
deletein interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
authorizationServer- The authorization server to delete.
-
deleteById
Description copied from interface:AuthorizationServerServiceDelete an authorization server- Specified by:
deleteByIdin interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
id- The id of the authorization server to delete.
-
save
Description copied from interface:AuthorizationServerServiceSave an authorization server- Specified by:
savein interfaceAuthorizationServerService<P extends AuthorizationServer>- Parameters:
authorizationServer- The authorization server to save- Returns:
- The saved authorization server
-
findRepositoryDomainById
Find the repository domain by ID without converting to business domain.- Parameters:
id- The entity ID- Returns:
- Optional of the entity.
-
fromRepositoryDomain
-
fromRepositoryDomain
-
validate
-
getRepository
-
getMapper
-
getEntityValidator
protected com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator getEntityValidator()
-