Class SandboxApplicationContextMutabilityDomainMapperMember
java.lang.Object
com.broadleafcommerce.sandbox.service.mapping.SandboxApplicationContextMutabilityDomainMapperMember
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
,com.broadleafcommerce.data.tracking.core.mapping.DomainMapper
,com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
,org.springframework.core.Ordered
public class SandboxApplicationContextMutabilityDomainMapperMember
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
Since the persisted-domain counterpart of
Sandbox
is tenant-trackable, the default
context state mutability of a sandbox from an application context will be false. However, in
SandboxEndpoint
, we do support mutating sandboxes from an application context if it
matches the application of the sandbox. Thus, this mapper member will override the value.- Author:
- Samarth Dhruva (samarthd)
-
Field Summary
Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
ALL_MATCH
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P> P
fromRepositoryDomain
(Object repositoryDomain, P businessDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) int
getOrder()
protected Sandbox
markContextStateMutableIfContextAppMatchesSandbox
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Sandbox sandbox) Sets theSandbox.getContextState()
asContextState.getMutable()
if theContextRequest.getApplication()
matches theSandbox.getApplication()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapper
deleteMap, getBusinessDomainType, modifyMap
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
fromBusinessDomain
-
Constructor Details
-
SandboxApplicationContextMutabilityDomainMapperMember
public SandboxApplicationContextMutabilityDomainMapperMember()
-
-
Method Details
-
getDataRoutePartition
- Specified by:
getDataRoutePartition
in interfacecom.broadleafcommerce.common.extension.data.DataRoutePartitionAware
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
fromRepositoryDomain
public <P> P fromRepositoryDomain(Object repositoryDomain, P businessDomain, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
fromRepositoryDomain
in interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
-
markContextStateMutableIfContextAppMatchesSandbox
@Nullable protected Sandbox markContextStateMutableIfContextAppMatchesSandbox(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Sandbox sandbox) Sets theSandbox.getContextState()
asContextState.getMutable()
if theContextRequest.getApplication()
matches theSandbox.getApplication()
.- Parameters:
contextInfo
- context information surrounding multitenant statesandbox
- the sandbox whose context state should be set as mutable- Returns:
- the given sandbox if its context state mutability was successfully set,
null
if nothing was changed
-