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_MATCHFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P> PfromRepositoryDomain(Object repositoryDomain, P businessDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) intgetOrder()protected SandboxmarkContextStateMutableIfContextAppMatchesSandbox(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, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapper
deleteMap, getBusinessDomainType, modifyMapMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
fromBusinessDomain
-
Constructor Details
-
SandboxApplicationContextMutabilityDomainMapperMember
public SandboxApplicationContextMutabilityDomainMapperMember()
-
-
Method Details
-
getDataRoutePartition
- Specified by:
getDataRoutePartitionin interfacecom.broadleafcommerce.common.extension.data.DataRoutePartitionAware
-
getOrder
public int getOrder()- Specified by:
getOrderin interfacecom.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
fromRepositoryDomain
public <P> P fromRepositoryDomain(Object repositoryDomain, P businessDomain, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
fromRepositoryDomainin 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,
nullif nothing was changed
-