public interface WebCmsMultiDomainService extends WebCmsDomainService
WebCmsMultiDomainConfiguration| Modifier and Type | Method and Description |
|---|---|
CloseableWebCmsDomainContext |
attachDomainContext(WebCmsDomain domain)
Create a new
WebCmsDomainContext for the given domain, and attach it to the WebCmsDomainContextHolder. |
WebCmsDomain |
getCurrentDomain()
Always returns the current domain, bound to the
WebCmsDomainContextHolder. |
WebCmsDomain |
getCurrentDomainForEntity(Object entity)
Returns the current domain for a particular entity.
|
WebCmsDomain |
getCurrentDomainForType(Class<?> entityType)
Returns the current domain for a particular entity type.
|
<U> U |
getCurrentDomainMetadata(Class<U> metadataType)
Return the metadata for the current domain.
|
<U> U |
getMetadataForDomain(WebCmsDomain domain,
Class<U> metadataType)
Retrieve the metadata for a specific domain.
|
boolean |
isCurrentDomain(WebCmsDomain domain)
Test if a specific domain is the current domain bound tot the thread.
|
boolean |
isDomainBound(Class<?> entityType)
Check if a particular entity type is domain-bound according to the current
WebCmsMultiDomainConfiguration. |
boolean |
isDomainBound(Object entity)
Check if a particular entity is domain-bound according to the current
WebCmsMultiDomainConfiguration. |
boolean |
isNoDomainAllowed(Class<?> entityType)
Check if a particular entity type does not require a specific domain.
|
boolean |
isNoDomainAllowed(Object entity)
Check if a particular entity does not require a specific domain.
|
getDomain, getDomainByKeyWebCmsDomain getCurrentDomain()
WebCmsDomainContextHolder.
This method will return a single domain only or none.<U> U getCurrentDomainMetadata(Class<U> metadataType)
null if not metadata is available.
A ClassCastException will be thrown if the metadata is not of the right type.U - metadata type referencemetadataType - the metadata should haveWebCmsDomain getCurrentDomainForEntity(Object entity)
getCurrentDomain() if the call of isDomainBound(Object) returns true.
If the entity type is not domain-bound, this will always return null.entity - for which to retrieve the current domainWebCmsDomain getCurrentDomainForType(Class<?> entityType)
getCurrentDomain() if the call of isDomainBound(Class) returns true.
If the entity type is not domain-bound, this will always return null.entityType - for which to retrieve the current domain<U> U getMetadataForDomain(WebCmsDomain domain, Class<U> metadataType)
ClassCastException will be thrown if the metadata is not of the right type.getMetadataForDomain in interface WebCmsDomainServicedomain - or null for the no-domainmetadataType - type the metadata should haveboolean isDomainBound(Object entity)
WebCmsMultiDomainConfiguration.entity - to checkboolean isDomainBound(Class<?> entityType)
WebCmsMultiDomainConfiguration.entityType - to checkboolean isNoDomainAllowed(Object entity)
entity - to checkboolean isNoDomainAllowed(Class<?> entityType)
entityType - to checkCloseableWebCmsDomainContext attachDomainContext(WebCmsDomain domain)
WebCmsDomainContext for the given domain, and attach it to the WebCmsDomainContextHolder.
This will load the metadata, create the context and effectively change the value of getCurrentDomain().
This method returns an AutoCloseable referring the previous domain context.
When calling the CloseableWebCmsDomainContext.close(), the previous domain context will be reset.domain - to setboolean isCurrentDomain(WebCmsDomain domain)
domain - to testCopyright © 2020. All rights reserved.