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
-
Constructor Summary
ConstructorDescriptionDefaultAuthorizationServerService
(AuthorizationServerRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator entityValidator) -
Method Summary
Modifier and TypeMethodDescriptionCreate a new authorization servervoid
Delete an authorization servervoid
deleteById
(String id) Delete an authorization serverboolean
existsById
(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.EntityValidator
protected SimplePayloadMapper
protected 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:AuthorizationServerService
Find all authorization servers.- Specified by:
findAll
in 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:AuthorizationServerService
Find all authorization servers for a tenant.- Specified by:
findAllByTenantId
in 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:AuthorizationServerService
Find an authorization server by its ID- Specified by:
findById
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
id
- The authorization server ID- Returns:
- An optional of authorization server
-
existsById
Description copied from interface:AuthorizationServerService
Check if an authorization server exists by its ID- Specified by:
existsById
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
id
- The authorization server ID- Returns:
- whether or not the authorization server exists
-
findByName
Description copied from interface:AuthorizationServerService
Find an authorization server by its name- Specified by:
findByName
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
name
- The name of the authorization service- Returns:
- An optional of authorization server
-
findByNameAndTenantId
Description copied from interface:AuthorizationServerService
Find an authorization server by its name and tenant id- Specified by:
findByNameAndTenantId
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
name
- The name of the authorization servicetenantId
- the tenant id that thisAuthorizationServer
belongs to- Returns:
- An optional of authorization server
-
replace
@CacheEvict(cacheNames="authCacheByServerId", key="#a0") public P replace(String id, P authorizationServer) Description copied from interface:AuthorizationServerService
Replace an authorization server- Specified by:
replace
in 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:AuthorizationServerService
Create a new authorization server- Specified by:
create
in 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:AuthorizationServerService
Delete an authorization server- Specified by:
delete
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
authorizationServer
- The authorization server to delete.
-
deleteById
Description copied from interface:AuthorizationServerService
Delete an authorization server- Specified by:
deleteById
in interfaceAuthorizationServerService<P extends AuthorizationServer>
- Parameters:
id
- The id of the authorization server to delete.
-
save
Description copied from interface:AuthorizationServerService
Save an authorization server- Specified by:
save
in 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()
-