Class SearchCatalogAccessPolicy
java.lang.Object
com.broadleafcommerce.search.api.domain.accesspolicy.SearchCatalogAccessPolicy
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
public class SearchCatalogAccessPolicy
extends Object
implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
Represents a set of rules concerning what
Catalog
entities can be accessed by the
specified users. This will cause entities within the related catalog to be filtered for requests
besides the normal data tracking filtration.- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The date until which the policy should be active.The date from which the policy should be active.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.Filters that should be applied to catalog requests.getId()
Id for the policy.Match rule to evaluate against a context object containing user and request data.getName()
Name of the policy.List of the targetCatalog.getId()
that this catalog access policy applies to.The target type denoting how to restrict this catalog access policy.int
hashCode()
void
setActiveEndDate
(Instant activeEndDate) The date until which the policy should be active.void
setActiveStartDate
(Instant activeStartDate) The date from which the policy should be 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
setFilterRules
(Map<String, String> filterRules) Filters that should be applied to catalog requests.void
Id for the policy.void
setMatchRule
(String matchRule) Match rule to evaluate against a context object containing user and request data.void
Name of the policy.void
setTargetCatalogIds
(List<String> targetCatalogIds) List of the targetCatalog.getId()
that this catalog access policy applies to.void
setTargetType
(String targetType) The target type denoting how to restrict this catalog access policy.toString()
-
Constructor Details
-
SearchCatalogAccessPolicy
public SearchCatalogAccessPolicy()
-
-
Method Details
-
getId
Id for the policy.- Returns:
- Id for the policy.
-
getName
Name of the policy.- Returns:
- Name of the policy.
-
getActiveStartDate
The date from which the policy should be active.- Returns:
- The date from which the policy should be active.
-
getActiveEndDate
The date until which the policy should be active. Must be afteractiveStartDate
.null
indicates the policy will not stop being active afteractiveStartDate
.- Returns:
- The date until which the policy should be active.
-
getTargetType
The target type denoting how to restrict this catalog access policy.- Returns:
- the target type of the catalog access policy.
- See Also:
-
getTargetCatalogIds
List of the targetCatalog.getId()
that this catalog access policy applies to. This is only used whengetTargetType()
isDefaultCatalogAccessPolicyTargetType.CATALOG
.- Returns:
- the list of catalog ids to target.
-
getMatchRule
Match rule to evaluate against a context object containing user and request data. This rule is a SpEL expression.- Returns:
- the match rule to evaluate.
-
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
-
getFilterRules
Filters that should be applied to catalog requests. They key specifies the type, e.g, PRODUCT or CATEGORY. The rule value for each entry should be a valid RSQL string.- Returns:
- Rules that should be applied to cause the inclusion of items.
-
setId
Id for the policy.- Parameters:
id
- Id for the policy.
-
setName
Name of the policy.- Parameters:
name
- Name of the policy.
-
setActiveStartDate
The date from which the policy should be active.- Parameters:
activeStartDate
- The date from which the policy should be active.
-
setActiveEndDate
The date until which the policy should be active. Must be afteractiveStartDate
.null
indicates the policy will not stop being active afteractiveStartDate
.- Parameters:
activeEndDate
- The date until which the policy should be active.
-
setTargetType
The target type denoting how to restrict this catalog access policy.- Parameters:
targetType
- the target type of the catalog access policy.- See Also:
-
setTargetCatalogIds
List of the targetCatalog.getId()
that this catalog access policy applies to. This is only used whengetTargetType()
isDefaultCatalogAccessPolicyTargetType.CATALOG
.- Parameters:
targetCatalogIds
- the list of catalog ids to target.
-
setMatchRule
Match rule to evaluate against a context object containing user and request data. This rule is a SpEL expression.- Parameters:
matchRule
- the match rule to evaluate.
-
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
-
setFilterRules
Filters that should be applied to catalog requests. They key specifies the type, e.g, PRODUCT or CATEGORY. The rule value for each entry should be a valid RSQL string.- Parameters:
inclusionFilters
- Rules that should be applied to cause the inclusion of items.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-