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>
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_BY_SERVER_ID |
Constructor and Description |
---|
DefaultAuthorizationServerService(AuthorizationServerRepository<D> repository,
SimplePayloadMapper mapper,
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator entityValidator) |
Modifier and Type | Method and Description |
---|---|
P |
create(P authorizationServer)
Create a new authorization server
|
void |
delete(P authorizationServer)
Delete an authorization server
|
void |
deleteById(String id)
Delete an authorization server
|
boolean |
existsById(String id)
Check if an authorization server exists by its ID
|
org.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.
|
Optional<P> |
findById(String id)
Find an authorization server by its ID
|
Optional<P> |
findByName(String name)
Find an authorization server by its name
|
protected Optional<D> |
findRepositoryDomainById(String id)
Find the repository domain by ID without converting to business domain.
|
protected Optional<P> |
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 |
getEntityValidator() |
protected SimplePayloadMapper |
getMapper() |
protected AuthorizationServerRepository<D> |
getRepository() |
P |
replace(String id,
P authorizationServer)
Replace an authorization server
|
P |
save(P authorizationServer)
Save an authorization server
|
protected void |
validate(P authorizationServer) |
public static final String CACHE_BY_SERVER_ID
public DefaultAuthorizationServerService(AuthorizationServerRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator entityValidator)
public org.springframework.data.domain.Page<P> findAll(org.springframework.data.domain.Pageable pageable)
AuthorizationServerService
findAll
in interface AuthorizationServerService<P extends AuthorizationServer>
pageable
- the pageablepublic org.springframework.data.domain.Page<P> findAllByTenantId(String tenantId, org.springframework.data.domain.Pageable pageable)
AuthorizationServerService
findAllByTenantId
in interface AuthorizationServerService<P extends AuthorizationServer>
tenantId
- the tenant IDpageable
- the pageable@Cacheable(cacheNames="authCacheByServerId", key="#a0", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public Optional<P> findById(String id)
AuthorizationServerService
findById
in interface AuthorizationServerService<P extends AuthorizationServer>
id
- The authorization server IDpublic boolean existsById(String id)
AuthorizationServerService
existsById
in interface AuthorizationServerService<P extends AuthorizationServer>
id
- The authorization server IDpublic Optional<P> findByName(String name)
AuthorizationServerService
findByName
in interface AuthorizationServerService<P extends AuthorizationServer>
name
- The name of the authorization service@CacheEvict(cacheNames="authCacheByServerId", key="#a0") public P replace(String id, P authorizationServer)
AuthorizationServerService
replace
in interface AuthorizationServerService<P extends AuthorizationServer>
id
- The id of the server to replaceauthorizationServer
- The replacement@CachePut(cacheNames="authCacheByServerId", key="#result.id") public P create(P authorizationServer)
AuthorizationServerService
create
in interface AuthorizationServerService<P extends AuthorizationServer>
authorizationServer
- The authorization server to create@CacheEvict(cacheNames="authCacheByServerId", key="#a0.id") public void delete(P authorizationServer)
AuthorizationServerService
delete
in interface AuthorizationServerService<P extends AuthorizationServer>
authorizationServer
- The authorization server to delete.@CacheEvict(cacheNames="authCacheByServerId", key="#a0") public void deleteById(String id)
AuthorizationServerService
deleteById
in interface AuthorizationServerService<P extends AuthorizationServer>
id
- The id of the authorization server to delete.@CachePut(cacheNames="authCacheByServerId", key="#result.id") public P save(P authorizationServer)
AuthorizationServerService
save
in interface AuthorizationServerService<P extends AuthorizationServer>
authorizationServer
- The authorization server to saveprotected Optional<D> findRepositoryDomainById(String id)
id
- The entity IDprotected org.springframework.data.domain.Page<P> fromRepositoryDomain(org.springframework.data.domain.Page<D> page)
protected void validate(P authorizationServer)
protected AuthorizationServerRepository<D> getRepository()
protected SimplePayloadMapper getMapper()
protected com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator getEntityValidator()
Copyright © 2021. All rights reserved.