Class CustomerSegment
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCustomerSegment(String id, String name, String description, CustomerSegmentType customerSegmentType, Integer priority, String identifierType, String externalRef, String segmentMatchRule, String realtimeMatchRule, String ruleEvaluationType, boolean internalEvaluationRequired, boolean active, String processingState, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.The type of this customer segment.The description of this customer segment.If thecustomerSegmentTypeisCustomerSegmentType.EXTERNAL, then this stores the identifier for the external segment.getId()Deprecated.This field is unused.getName()The name of this customer segment.The priority of this customer segment.The current processing state of this segment.The rule(s) for this customer segment if rule based and using real-time evaluation.Indicates whether thesegmentMatchRuleis evaluated orrealtimeMatchRule.The rule(s) for this customer segment if rule based and using offline evaluation.inthashCode()booleanisActive()booleanWhenruleEvaluationTypeisDefaultCustomerSegmentRuleEvaluationType.REAL_TIME, indicates whether evaluation of the rule should be done in Customer Services specifically because it requires information that is only available in that service and not in the authorization token claims or a request attribute.voidsetActive(boolean active) voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCustomerSegmentType(CustomerSegmentType customerSegmentType) The type of this customer segment.voidsetDescription(String description) The description of this customer segment.voidsetExternalRef(String externalRef) If thecustomerSegmentTypeisCustomerSegmentType.EXTERNAL, then this stores the identifier for the external segment.voidvoidsetIdentifierType(String identifierType) Deprecated.This field is unused.voidsetInternalEvaluationRequired(boolean internalEvaluationRequired) WhenruleEvaluationTypeisDefaultCustomerSegmentRuleEvaluationType.REAL_TIME, indicates whether evaluation of the rule should be done in Customer Services specifically because it requires information that is only available in that service and not in the authorization token claims or a request attribute.voidThe name of this customer segment.voidsetPriority(Integer priority) The priority of this customer segment.voidsetProcessingState(String processingState) The current processing state of this segment.voidsetRealtimeMatchRule(String realtimeMatchRule) The rule(s) for this customer segment if rule based and using real-time evaluation.voidsetRuleEvaluationType(String ruleEvaluationType) Indicates whether thesegmentMatchRuleis evaluated orrealtimeMatchRule.voidsetSegmentMatchRule(String segmentMatchRule) The rule(s) for this customer segment if rule based and using offline evaluation.toString()
-
Constructor Details
-
CustomerSegment
public CustomerSegment() -
CustomerSegment
public CustomerSegment(String id, String name, String description, CustomerSegmentType customerSegmentType, Integer priority, String identifierType, String externalRef, String segmentMatchRule, String realtimeMatchRule, String ruleEvaluationType, boolean internalEvaluationRequired, boolean active, String processingState, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
-
-
Method Details
-
getId
-
getName
The name of this customer segment.- Returns:
- The customer segment name.
-
getDescription
The description of this customer segment.- Returns:
- The customer segment's description.
-
getCustomerSegmentType
The type of this customer segment. This could be a customer set, rule-based, or external.- Returns:
- The customer segment type
- See Also:
-
segmentMatchRulerealtimeMatchRuleruleEvaluationType
-
getPriority
The priority of this customer segment. This is to enforce ordering when a customer may belong to multiple segments. A lower value indicates higher priority.- Returns:
- The customer segment priority.
-
getIdentifierType
Deprecated.This field is unused.ForCustomerSegmentType.CUSTOMER_SETsegment types, this represents the method used to associate a customer with this segment.Examples include email, customer ID, login username, etc.
- Returns:
- The segment identifier type
-
getExternalRef
If thecustomerSegmentTypeisCustomerSegmentType.EXTERNAL, then this stores the identifier for the external segment. -
getSegmentMatchRule
The rule(s) for this customer segment if rule based and using offline evaluation. The default behavior is an RSQL filter.- Returns:
- The rule(s) that must be fulfilled for a customer to match this segment.
- See Also:
-
ruleEvaluationType
-
getRealtimeMatchRule
The rule(s) for this customer segment if rule based and using real-time evaluation. The default behavior is an SpEL filter. This is separate fromsegmentMatchRuleso that it can be validating usingRuleValidate.- Returns:
- The rule(s) that must be fulfilled for a customer to match this segment.
- See Also:
-
ruleEvaluationType
-
getRuleEvaluationType
Indicates whether thesegmentMatchRuleis evaluated orrealtimeMatchRule. This also determines the format of the rule such as RSQL for offline or SpEL for real-time.- See Also:
-
isInternalEvaluationRequired
public boolean isInternalEvaluationRequired()WhenruleEvaluationTypeisDefaultCustomerSegmentRuleEvaluationType.REAL_TIME, indicates whether evaluation of the rule should be done in Customer Services specifically because it requires information that is only available in that service and not in the authorization token claims or a request attribute. This is typically something to avoid. -
isActive
public boolean isActive()- Returns:
- Is this customer segment active?
-
getProcessingState
The current processing state of this segment.While this value is set on every segment for simplicity, the default behavior is that this value is only used of on rule based customer segments. This field not applicable for static segments, such as customer sets.
The following describes the default processing states, and how these states are determined:
- New Segment Created:
SegmentStatus.INITIALIZATION_REQUIRED - Segment currently processing:
SegmentStatus.PROCESSING - Segment finished processing:
SegmentStatus.READY - Dirty Segment (Such as an update action on a segment, or a new customer is created but
not immediately processed upon creation):
SegmentStatus.UPDATE_REQUIRED
- Returns:
- The current processing state of this segment.
- See Also:
- New Segment Created:
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
-
setName
The name of this customer segment. -
setDescription
The description of this customer segment. -
setCustomerSegmentType
The type of this customer segment. This could be a customer set, rule-based, or external.- See Also:
-
segmentMatchRulerealtimeMatchRuleruleEvaluationType
-
setPriority
The priority of this customer segment. This is to enforce ordering when a customer may belong to multiple segments. A lower value indicates higher priority. -
setIdentifierType
Deprecated.This field is unused.ForCustomerSegmentType.CUSTOMER_SETsegment types, this represents the method used to associate a customer with this segment.Examples include email, customer ID, login username, etc.
-
setExternalRef
If thecustomerSegmentTypeisCustomerSegmentType.EXTERNAL, then this stores the identifier for the external segment. -
setSegmentMatchRule
The rule(s) for this customer segment if rule based and using offline evaluation. The default behavior is an RSQL filter.- See Also:
-
ruleEvaluationType
-
setRealtimeMatchRule
The rule(s) for this customer segment if rule based and using real-time evaluation. The default behavior is an SpEL filter. This is separate fromsegmentMatchRuleso that it can be validating usingRuleValidate.- See Also:
-
ruleEvaluationType
-
setRuleEvaluationType
Indicates whether thesegmentMatchRuleis evaluated orrealtimeMatchRule. This also determines the format of the rule such as RSQL for offline or SpEL for real-time.- See Also:
-
setInternalEvaluationRequired
public void setInternalEvaluationRequired(boolean internalEvaluationRequired) WhenruleEvaluationTypeisDefaultCustomerSegmentRuleEvaluationType.REAL_TIME, indicates whether evaluation of the rule should be done in Customer Services specifically because it requires information that is only available in that service and not in the authorization token claims or a request attribute. This is typically something to avoid. -
setActive
public void setActive(boolean active) -
setProcessingState
The current processing state of this segment.While this value is set on every segment for simplicity, the default behavior is that this value is only used of on rule based customer segments. This field not applicable for static segments, such as customer sets.
The following describes the default processing states, and how these states are determined:
- New Segment Created:
SegmentStatus.INITIALIZATION_REQUIRED - Segment currently processing:
SegmentStatus.PROCESSING - Segment finished processing:
SegmentStatus.READY - Dirty Segment (Such as an update action on a segment, or a new customer is created but
not immediately processed upon creation):
SegmentStatus.UPDATE_REQUIRED
- See Also:
- New Segment Created:
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-