Class ContextState
java.lang.Object
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
- All Implemented Interfaces:
Serializable
A subset of information from
Tracking
placed on the business domain. Useful for API
callers when making determinations regarding entity mutability, field-level overrides across
catalogs and sandboxable field state.- Author:
- Jeff Fischer
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Intended to be used within aJsonView
to demarcate requests which should include Catalog level inContextState.ContextCatalogInfo
responses.static class
A subset of the information inApplicationInfo
for usage inContextState
.static class
A subset of the information fromCatalogInfo
for usage inContextState
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Information about the associatedapplication
if the business domain is application discriminated.Whether or not the entity is marked as archived.The id of the base catalog that the business domain is a member of.Information about the associatedcatalog
if the business domain is catalog discriminated.The timestamp for the creation of the entityThe identity of the creator of this entity.Returns the customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.Field information describing field-level changes that have been made to the entity.getLevel()
Used to determine whether or not a record is a user sandbox record, a higher level sandbox record, or a production record.Whether or not the entity is mutable given the requesting context.The id of the catalog to which this entity belongs.Thesandbox id
if the business domain is a sandbox record.The sandbox change type associated with the entity.The ID of the associated tenant, if the business domain is tenant discriminated.The identity of the last updater of this entity.The timestamp for the last update of the entityint
hashCode()
void
setApplication
(ContextState.ContextApplicationInfo application) Information about the associatedapplication
if the business domain is application discriminated.void
setArchived
(Boolean archived) Whether or not the entity is marked as archived.void
setBaseCatalogId
(String baseCatalogId) The id of the base catalog that the business domain is a member of.void
Information about the associatedcatalog
if the business domain is catalog discriminated.void
setCreationTime
(Instant creationTime) The timestamp for the creation of the entityvoid
setCreator
(String creator) The identity of the creator of this entity.void
setCustomerContextId
(String customerContextId) Returns the customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.void
setFieldChanges
(List<FieldChange> fieldChanges) Field information describing field-level changes that have been made to the entity.void
Used to determine whether or not a record is a user sandbox record, a higher level sandbox record, or a production record.void
setMutable
(Boolean mutable) Whether or not the entity is mutable given the requesting context.void
setOverrideCatalogId
(String overrideCatalogId) The id of the catalog to which this entity belongs.void
setSandbox
(String sandbox) Thesandbox id
if the business domain is a sandbox record.void
setSandboxChangeType
(String sandboxChangeType) The sandbox change type associated with the entity.void
The ID of the associated tenant, if the business domain is tenant discriminated.void
setUpdater
(String updater) The identity of the last updater of this entity.void
setUpdateTime
(Instant updateTime) The timestamp for the last update of the entitytoString()
-
Constructor Details
-
ContextState
-
ContextState
public ContextState()
-
-
Method Details
-
getMutable
Whether or not the entity is mutable given the requesting context. Generally, factors such as permissions and catalog mutability are considered.- Returns:
- Whether or not the entity is mutable given the requesting context
-
getArchived
Whether or not the entity is marked as archived. This would generally only be true when fetching entities with narrowing disabled.- Returns:
- Whether or not the entity is marked as archived
-
getFieldChanges
Field information describing field-level changes that have been made to the entity. This can include overrides in catalog scenarios. It can also include sandbox changes for sandboxable domain.- Returns:
- Field information describing field-level changes that have been made to the entity
-
getLevel
Used to determine whether or not a record is a user sandbox record, a higher level sandbox record, or a production record. SeeTrackingLevel
.- Returns:
- The current state of an item as it relates to sandbox or production status
-
getCatalog
Information about the associatedcatalog
if the business domain is catalog discriminated.- Returns:
- information about the associated
Catalog
if the business domain is catalog discriminated
-
getSandbox
Thesandbox id
if the business domain is a sandbox record.- Returns:
- The
sandbox id
if the business domain is a sandbox record
-
getApplication
Information about the associatedapplication
if the business domain is application discriminated.- Returns:
- information about the associated
Application
if the business domain is application discriminated
-
getTenant
The ID of the associated tenant, if the business domain is tenant discriminated.- Returns:
- ID of the associated tenant
-
getCustomerContextId
Returns the customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.- Returns:
- the customer context id
-
getBaseCatalogId
The id of the base catalog that the business domain is a member of.- Returns:
- The base catalog id.
-
getOverrideCatalogId
The id of the catalog to which this entity belongs. This value will only be populated if this is an override entity. For example, an application level override of a product defined in a tenant level catalog.- Returns:
- The override catalog id.
-
getSandboxChangeType
The sandbox change type associated with the entity.- Returns:
- The sandbox change type.
- See Also:
-
getCreationTime
The timestamp for the creation of the entity- Returns:
- The timestamp for the creation of the entity
-
getUpdateTime
The timestamp for the last update of the entity- Returns:
- The timestamp for the last update of the entity
-
getCreator
The identity of the creator of this entity.- Returns:
- The identity of the creator of this entity.
-
getUpdater
The identity of the last updater of this entity.- Returns:
- The identity of the last updater of this entity. See
ContextInfo.getAuthor()
.
-
setMutable
Whether or not the entity is mutable given the requesting context. Generally, factors such as permissions and catalog mutability are considered.- Parameters:
mutable
- Whether or not the entity is mutable given the requesting context
-
setArchived
Whether or not the entity is marked as archived. This would generally only be true when fetching entities with narrowing disabled.- Parameters:
archived
- Whether or not the entity is marked as archived
-
setFieldChanges
Field information describing field-level changes that have been made to the entity. This can include overrides in catalog scenarios. It can also include sandbox changes for sandboxable domain.- Parameters:
fieldChanges
- Field information describing field-level changes that have been made to the entity
-
setLevel
Used to determine whether or not a record is a user sandbox record, a higher level sandbox record, or a production record. SeeTrackingLevel
.- Parameters:
level
- The current state of an item as it relates to sandbox or production status
-
setCatalog
Information about the associatedcatalog
if the business domain is catalog discriminated.- Parameters:
catalog
- information about the associatedCatalog
if the business domain is catalog discriminated
-
setSandbox
Thesandbox id
if the business domain is a sandbox record.- Parameters:
sandbox
- Thesandbox id
if the business domain is a sandbox record
-
setApplication
Information about the associatedapplication
if the business domain is application discriminated.- Parameters:
application
- information about the associatedApplication
if the business domain is application discriminated
-
setTenant
The ID of the associated tenant, if the business domain is tenant discriminated.- Parameters:
tenant
- ID of the associated tenant
-
setCustomerContextId
Returns the customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.- Parameters:
customerContextId
- the customer context id
-
setBaseCatalogId
The id of the base catalog that the business domain is a member of.- Parameters:
baseCatalogId
- The base catalog id.
-
setOverrideCatalogId
The id of the catalog to which this entity belongs. This value will only be populated if this is an override entity. For example, an application level override of a product defined in a tenant level catalog.- Parameters:
overrideCatalogId
- The override catalog id.
-
setSandboxChangeType
The sandbox change type associated with the entity.- Parameters:
sandboxChangeType
- The sandbox change type.- See Also:
-
setCreationTime
The timestamp for the creation of the entity- Parameters:
creationTime
- The timestamp for the creation of the entity
-
setUpdateTime
The timestamp for the last update of the entity- Parameters:
timestamp
- The timestamp for the last update of the entity
-
setCreator
The identity of the creator of this entity.- Parameters:
creator
- The user principal for the request. SeeContextInfo.getAuthor()
.
-
setUpdater
The identity of the last updater of this entity.- Parameters:
updater
- The user principal for the request. SeeContextInfo.getAuthor()
.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-