public interface Session
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTHENTICITY_KEY |
static java.lang.String |
ID_KEY |
static java.lang.String |
TIMESTAMP_KEY |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all values from the session.
|
java.lang.String |
get(java.lang.String key)
Returns the value of the key or null.
|
java.lang.String |
getAuthenticityToken() |
java.util.Map<java.lang.String,java.lang.String> |
getData() |
java.lang.String |
getId() |
void |
init(Context context)
Has to be called initially.
|
boolean |
isEmpty()
Returns true if the session is empty, e.g.
|
void |
put(java.lang.String key,
java.lang.String value)
Puts key / value into the session.
|
java.lang.String |
remove(java.lang.String key)
Removes the value of the key and returns the value or null.
|
void |
save(Context context,
Result result)
To finally send this session to the user this method has to be called.
|
static final java.lang.String AUTHENTICITY_KEY
static final java.lang.String ID_KEY
static final java.lang.String TIMESTAMP_KEY
void init(Context context)
context
- The context of this session.java.lang.String getId()
java.util.Map<java.lang.String,java.lang.String> getData()
java.lang.String getAuthenticityToken()
void save(Context context, Result result)
context
- The context from where to deduct a potentially existing session.result
- The result where to add the session.void put(java.lang.String key, java.lang.String value)
key
- Name of the key to store in the session.value
- The value to store in the sessionjava.lang.String get(java.lang.String key)
key
- Name of the key to retrieve.java.lang.String remove(java.lang.String key)
key
- name of the key to removevoid clear()
boolean isEmpty()
Copyright © 2015 ninjaframework. All Rights Reserved.