The Profile Marker Manager specifies a default duplication mode that is used for the markers it creates when the scenario (or servlet bean) used to add the marker doesn’t provide an alternate mode. The Profile Marker Manager accepts three values for the defaultDuplicationMode
property:
ALLOW_DUPLICATES
REPLACE_DUPLICATES
NO_DUPLICATES
When a Profile Marker Manager is prompted to create a marker that is identical to one that already exists in a given profile, the Profile Marker Manager can discard the new marker (NO_DUPLICATES
), replace the original with the duplicate (REPLACE_DUPLICATES
),or accept the new marker in addition to the original (ALLOW_DUPLICATES
). Fewer markers cause quicker response in queries for a particular marker in a profile, but may slow the marker creation and removal processes.
You can change your duplication mode at any time. If the Profile Marker Manager previously permitted duplicate markers (ALLOW_DUPLICATES
), you can adjust it to replace all old markers with a new duplicate (REPLACE_DUPLICATES
).
When you specify a preference for unique markers (NO_DUPLICATES
or REPLACE_DUPLICATES
), the Profile Marker Manager relies on a compare component to determine whether a new marker is a duplicate of any existing ones. By default, the defaultMarkerDuplicateComparator
property is set to /atg/markers/CompareByDefaultProperties
, which identifies two markers as identical when they have the same values in their key
, value
, and data
properties respectively. The /atg/markers/userprofiling/CompareByKeyAndValue
component judges duplication based on the values in the key
and value
properties.
Defining Uniqueness
You can create your own components that judge uniqueness based on the marker properties you identify or the business logic you define. One approach is to provide multiple compare components, each of which is tailored to the uniqueness criteria required for a particular type of profile marker (as identified by marker key)
.
To create a compare component that determines equality based on marker property values:
Create a component of class
atg.markers.CompareByProperties
.Set the
propertiesTocompare
property to the marker property or properties that will be compared to determine equality.If you have multiple compare components, update the
markerDuplicateComparators
map property to use each one: set the key to the profile markerkey
value and the value to a compare component.
To create a compare component that determines equality based on the business logic you define:
Create a subclass of
atg.markers.MarkerDuplicateComparator
and create a component of that class.If you have multiple compare components, update the
markerDuplicateComparators
map property to use each one: set the key to the profile markerkey
value and the value to a compare component.