public class AttributesManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AttributesManager.Builder
Attributes Manager Builder class.
|
Modifier and Type | Field and Description |
---|---|
protected PersistenceAdapter |
persistenceAdapter
Adapter layer used to persist Skill data.
|
protected boolean |
persistenceAttributesSet
Check to see if persistence attributes have been set.
|
protected Map<String,Object> |
persistentAttributes
Data stored in persistence layer (Eg: AWS DynamoDB).
|
protected Map<String,Object> |
requestAttributes
Request attributes.
|
protected RequestEnvelope |
requestEnvelope
Request envelope object which encapsulates Request, Session, context and the current version.
|
protected Map<String,Object> |
sessionAttributes
Data stored in session as key-value pairs.
|
Modifier | Constructor and Description |
---|---|
protected |
AttributesManager(PersistenceAdapter persistenceAdapter,
RequestEnvelope requestEnvelope)
Constructor for AttributesManager.
|
Modifier and Type | Method and Description |
---|---|
static AttributesManager.Builder |
builder()
Static builder method which returns an instance of Builder.
|
void |
deletePersistentAttributes()
Deletes the persistent attributes from the persistence layer.
|
Map<String,Object> |
getPersistentAttributes()
Retrieves current persistence attributes.
|
Map<String,Object> |
getRequestAttributes()
Retrieves current request attributes.
|
Map<String,Object> |
getSessionAttributes()
Retrieves current session attributes.
|
void |
savePersistentAttributes()
Saves the current persistent attribute state back to the persistence layer.
|
void |
setPersistentAttributes(Map<String,Object> persistentAttributes)
Sets persistent attributes.
|
void |
setRequestAttributes(Map<String,Object> requestAttributes)
Sets request attributes.
|
void |
setSessionAttributes(Map<String,Object> sessionAttributes)
Sets session attributes, replacing any existing attributes already present in the session.
|
protected final RequestEnvelope requestEnvelope
protected final PersistenceAdapter persistenceAdapter
protected Map<String,Object> sessionAttributes
protected Map<String,Object> persistentAttributes
protected boolean persistenceAttributesSet
protected AttributesManager(PersistenceAdapter persistenceAdapter, RequestEnvelope requestEnvelope)
persistenceAdapter
- Adapter layer used to persist Skill data.requestEnvelope
- Request envelope object which encapsulates Request, Session, context and the current version.public static AttributesManager.Builder builder()
AttributesManager.Builder
.public Map<String,Object> getSessionAttributes()
IllegalStateException
- if attempting to retrieve session attributes from an out of session requestpublic void setSessionAttributes(Map<String,Object> sessionAttributes)
sessionAttributes
- session attributes to setIllegalStateException
- if attempting to retrieve session attributes from an out of session requestpublic Map<String,Object> getPersistentAttributes()
savePersistentAttributes()
is called. An exception is thrown if this method is called
when a PersistenceAdapter
is not configured on the SDK.IllegalStateException
- if no PersistenceAdapter
is configuredpublic void setPersistentAttributes(Map<String,Object> persistentAttributes)
savePersistentAttributes()
is called. Use this method
when bulk replacing attributes is desired. An exception is thrown if this method is called when a
PersistenceAdapter
is not configured on the SDK.persistentAttributes
- persistent attributes to setIllegalStateException
- if no PersistenceAdapter
is configuredpublic Map<String,Object> getRequestAttributes()
public void setRequestAttributes(Map<String,Object> requestAttributes)
requestAttributes
- request attributes to setpublic void savePersistentAttributes()
PersistenceAdapter
is not configured on the SDK.IllegalStateException
- if no PersistenceAdapter
is configuredpublic void deletePersistentAttributes()
PersistenceAdapter
is not configured on the SDK.IllegalStateException
- if no PersistenceAdapter
is configuredCopyright © 2023. All rights reserved.