Class CustomerSegment
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
- See Also:
-
Constructor Summary
ConstructorDescriptionCustomerSegment
(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 boolean
boolean
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.The type of this customer segment.The description of this customer segment.If thecustomerSegmentType
isCustomerSegmentType.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 thesegmentMatchRule
is evaluated orrealtimeMatchRule
.The rule(s) for this customer segment if rule based and using offline evaluation.int
hashCode()
boolean
isActive()
boolean
WhenruleEvaluationType
isDefaultCustomerSegmentRuleEvaluationType.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.void
setActive
(boolean active) void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setCustomerSegmentType
(CustomerSegmentType customerSegmentType) The type of this customer segment.void
setDescription
(String description) The description of this customer segment.void
setExternalRef
(String externalRef) If thecustomerSegmentType
isCustomerSegmentType.EXTERNAL
, then this stores the identifier for the external segment.void
void
setIdentifierType
(String identifierType) Deprecated.This field is unused.void
setInternalEvaluationRequired
(boolean internalEvaluationRequired) WhenruleEvaluationType
isDefaultCustomerSegmentRuleEvaluationType.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.void
The name of this customer segment.void
setPriority
(Integer priority) The priority of this customer segment.void
setProcessingState
(String processingState) The current processing state of this segment.void
setRealtimeMatchRule
(String realtimeMatchRule) The rule(s) for this customer segment if rule based and using real-time evaluation.void
setRuleEvaluationType
(String ruleEvaluationType) Indicates whether thesegmentMatchRule
is evaluated orrealtimeMatchRule
.void
setSegmentMatchRule
(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:
-
segmentMatchRule
realtimeMatchRule
ruleEvaluationType
-
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_SET
segment 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 thecustomerSegmentType
isCustomerSegmentType.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 fromsegmentMatchRule
so 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 thesegmentMatchRule
is 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()WhenruleEvaluationType
isDefaultCustomerSegmentRuleEvaluationType.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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information 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:
-
segmentMatchRule
realtimeMatchRule
ruleEvaluationType
-
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_SET
segment types, this represents the method used to associate a customer with this segment.Examples include email, customer ID, login username, etc.
-
setExternalRef
If thecustomerSegmentType
isCustomerSegmentType.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 fromsegmentMatchRule
so that it can be validating usingRuleValidate
.- See Also:
-
ruleEvaluationType
-
setRuleEvaluationType
Indicates whether thesegmentMatchRule
is 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) WhenruleEvaluationType
isDefaultCustomerSegmentRuleEvaluationType.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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-