public class SessionData extends Object
HttpSession in JEE:
| Constructor and Description |
|---|
SessionData(String sessionId,
long creationTime,
int maxInactiveInterval)
Constructor used when session is created.
|
SessionData(String id,
long lastAccessedTime,
int maxInactiveInterval,
long creationTime,
String previousOwner)
Constructor with session id, last epoch time of access, maximum inactivity
interval, creation time (from epoch) and node id of previous owner.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
long |
expiresAt()
Returns instant when the session expires.
|
long |
getCreationTime()
Creation time expressed in seconds since epoch.
|
String |
getId() |
long |
getLastAccessedTime()
Last accessed time expressed in seconds since epoch.
|
Set<String> |
getMandatoryRemoteKeys()
Set of keys whose attributes must be directly stored and retrieved from
repository.
|
int |
getMaxInactiveInterval()
Returns maximum inactivity interval before session expires in seconds.
|
String |
getOldSessionId()
Retrieves old session id or null if session id was not changed.
|
String |
getOriginalId()
Returns session id that was used to retrieve session from store.
|
long |
getOriginalLastAccessed()
Last accessed instant retrieved from repository.
|
String |
getPreviousOwner()
Returns id of the node that owned session in previous request
|
Set<String> |
getRepositoryKeys()
Retrieves set of keys for this session that have been stored in repository.
|
int |
hashCode() |
boolean |
isIdChanged()
Return
true if session id has changed. |
boolean |
isMaybeInRepository(String name)
Checks if key is a key of an attribute that present in repository.
|
boolean |
isNew() |
boolean |
isNonCacheable(String key)
Returns
true if attribute must be retrieved and stored
directly into repository. |
void |
setCreationTime(long creationTime)
Sets creation time of the session.
|
void |
setId(String id)
Sets session id.
|
void |
setLastAccessedTime(long lastAccessedTime)
Sets last accessed time of the session.
|
void |
setMandatoryRemoteKeys(Set<String> mandatoryRemoteKeys)
Set keys whose attributes must be directly stored and retrieved from
repository.
|
void |
setMaxInactiveInterval(int maxInactiveInterval)
Sets maximum inactivity interval before session expires
|
void |
setNew(boolean isNew)
Sets flag if the session is new or not
|
void |
setNewSessionId(String newSessionId)
Sets new session id.
|
String |
toString() |
public SessionData(String id, long lastAccessedTime, int maxInactiveInterval, long creationTime, String previousOwner)
id - the session idlastAccessedTime - timestamp when the session was previously accessedmaxInactiveInterval - maximum inactivity interval in secondscreationTime - timestamp of the session creationpreviousOwner - the node that was previous owner of the sessionpublic SessionData(String sessionId, long creationTime, int maxInactiveInterval)
sessionId - the session idcreationTime - timestamp of the session creationmaxInactiveInterval - maximum inactivity interval in secondspublic String getId()
public void setId(String id)
id - the session idpublic long getCreationTime()
public void setCreationTime(long creationTime)
creationTime - the session creation time in seconds since epochpublic long getLastAccessedTime()
public void setLastAccessedTime(long lastAccessedTime)
lastAccessedTime - the last accessed time expressed in seconds since epochpublic int getMaxInactiveInterval()
public void setMaxInactiveInterval(int maxInactiveInterval)
maxInactiveInterval - maximum inactivity interval in secondspublic boolean isNew()
true if session is newpublic void setNew(boolean isNew)
isNew - true if session is newpublic boolean isMaybeInRepository(String name)
name - key of attributetrue if attribute may be in repositorypublic Set<String> getRepositoryKeys()
null, then the set has yet not been retrieved
from repositorynull
if the set has not been retrieved from repository.public Set<String> getMandatoryRemoteKeys()
public void setMandatoryRemoteKeys(Set<String> mandatoryRemoteKeys)
mandatoryRemoteKeys - set of keys that must be directly backed by repositorypublic long getOriginalLastAccessed()
public String getPreviousOwner()
public long expiresAt()
public boolean isNonCacheable(String key)
true if attribute must be retrieved and stored
directly into repository.key - the attribute key to checkedtrue if attribute must be backed by repositorypublic String getOldSessionId()
public void setNewSessionId(String newSessionId)
newSessionId - the newSessionId to setpublic String getOriginalId()
public boolean isIdChanged()
true if session id has changed.true if session id has changedCopyright © 2018 Amadeus s.a.s.. All rights reserved.