Class ContextRequest
Events that are generated on the client as part of its functioning can be specified in the client as part of its request for contextual data. The context server will deliver
these events to EventListenerService
s to be processed. In particular, the RulesService
will trigger any applicable Rule
which in turn might trigger Action
s. An appropriate Event is also triggered when a Rule matches so that other rules can react to it. Finally, an event will also
be emitted if the user Profile
has been updated as part of the event processing.
A client wishing to perform content personalization might also specify filtering condition to be evaluated by the context server so that it can tell the client whether the content associated with the filter should be activated for this profile/session.
It is also possible to clients wishing to perform user impersonation to specify properties or segment to override the proper ones so as to emulate a specific profile, in which case the overridden value will temporarily replace the proper values so that all rules will be evaluated with these values instead of the proper ones.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the events that the client has generated as part of its processes and wishes the context server to process.Retrieves the filters aimed at content personalization that should be evaluated for the given session and/or profile so that the context server can tell the client whether the content associated with the filter should be activated for this profile/session.Retrieve the profileId passed along with the request.Retrieves the profile overrides.Retrieves the list of profile properties the context server should return with its context response.Retrieves the list of session properties the context server should return with its context response.Retrieve the sessionId passed along with the request.Retrieves the session properties overrides.Retrieves the source of the context request.boolean
Specifies whether the profiles scores should be part of the ContextResponse.boolean
Determines whether or not the context server should return the segments associated with the profile from which the request was issued.void
setClientId
(String clientId) void
Specifies the events to be processed by the context server.void
Specifies the content filters to be evaluated.void
setPersonalizations
(List<PersonalizationService.PersonalizationRequest> personalizations) void
setProfileId
(String profileId) Sets the profileId in the request.void
setProfileOverrides
(Profile overrides) Sets the profile overrides.void
setRequiredProfileProperties
(List<String> requiredProfileProperties) Specifies which profile properties should be returned with the response.void
setRequiredSessionProperties
(List<String> requiredSessionProperties) Specifies which session properties should be returned with the response.void
setRequireScores
(boolean requireScores) Setting this value to true indicates that the profile scores should be included in the response.void
setRequireSegments
(boolean requireSegments) Specifies whether to return the profile segments with the response.void
setSessionId
(String sessionId) Sets the sessionId in the request.void
setSessionPropertiesOverrides
(Map<String, Object> sessionPropertiesOverrides) Sets the session properties overrides.void
Sets the source.
-
Constructor Details
-
ContextRequest
public ContextRequest()
-
-
Method Details
-
getSource
Retrieves the source of the context request.- Returns:
- the source
-
setSource
Sets the source.- Parameters:
source
- the source
-
isRequireSegments
public boolean isRequireSegments()Determines whether or not the context server should return the segments associated with the profile from which the request was issued.- Returns:
true
if the context server should return the profile segments,false otherwise
- See Also:
-
setRequireSegments
public void setRequireSegments(boolean requireSegments) Specifies whether to return the profile segments with the response.- Parameters:
requireSegments
-true
if the context server should return the profile segments,false otherwise
-
getRequiredProfileProperties
Retrieves the list of profile properties the context server should return with its context response.- Returns:
- the required profile properties the client requested to be returned with the response
- See Also:
-
setRequiredProfileProperties
Specifies which profile properties should be returned with the response.- Parameters:
requiredProfileProperties
- the profile properties that should be returned with the response
-
getRequiredSessionProperties
Retrieves the list of session properties the context server should return with its context response.- Returns:
- the required session properties the client requested to be returned with the response
- See Also:
-
setRequiredSessionProperties
Specifies which session properties should be returned with the response.- Parameters:
requiredSessionProperties
- the session properties that should be returned with the response
-
isRequireScores
public boolean isRequireScores()Specifies whether the profiles scores should be part of the ContextResponse.- Returns:
- a boolean indicating if the scores should be part of the response.
-
setRequireScores
public void setRequireScores(boolean requireScores) Setting this value to true indicates that the profile scores should be included in the response. By default this value is false.- Parameters:
requireScores
- set to true if you want the scores to be part of the context response
-
getFilters
Retrieves the filters aimed at content personalization that should be evaluated for the given session and/or profile so that the context server can tell the client whether the content associated with the filter should be activated for this profile/session. The filter identifier is used in theContextResponse
with the associated evaluation result.- Returns:
- the filters aimed at content personalization that should be evaluated for the given session and/or profile
- See Also:
-
setFilters
Specifies the content filters to be evaluated.- Parameters:
filters
- the content filters to be evaluated
-
getPersonalizations
-
setPersonalizations
public void setPersonalizations(List<PersonalizationService.PersonalizationRequest> personalizations) -
getEvents
Retrieves the events that the client has generated as part of its processes and wishes the context server to process.- Returns:
- the client events to be processed by the context server
- See Also:
-
setEvents
Specifies the events to be processed by the context server.- Parameters:
events
- the events to be processed by the context server
-
getProfileOverrides
Retrieves the profile overrides.- Returns:
- the profile overrides
-
setProfileOverrides
Sets the profile overrides.- Parameters:
overrides
- the profile overrides
-
getSessionPropertiesOverrides
Retrieves the session properties overrides.- Returns:
- the session properties overrides
-
setSessionPropertiesOverrides
Sets the session properties overrides.- Parameters:
sessionPropertiesOverrides
- the session properties overrides
-
getSessionId
Retrieve the sessionId passed along with the request. All events will be processed with this sessionId as a default- Returns:
- the identifier for the session
-
setSessionId
Sets the sessionId in the request. This is the preferred method of passing along a session identifier with the request, as passing it along in the URL can lead to potential security vulnerabilities.- Parameters:
sessionId
- an unique identifier for the session
-
getProfileId
Retrieve the profileId passed along with the request. All events will be processed with this profileId as a default- Returns:
- the identifier for the profile
-
setProfileId
Sets the profileId in the request.- Parameters:
profileId
- an unique identifier for the profile
-
getClientId
-
setClientId
-