public class MongoExpiringSession extends Object implements ExpiringSession
| Constructor and Description |
|---|
MongoExpiringSession() |
MongoExpiringSession(int maxInactiveIntervalInSeconds) |
MongoExpiringSession(String id,
int maxInactiveIntervalInSeconds) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
<T> T |
getAttribute(String attributeName)
Gets the Object associated with the specified name or null if no Object is
associated to that name.
|
Set<String> |
getAttributeNames()
Gets the attribute names that have a value associated with it.
|
long |
getCreationTime()
Gets the time when this session was created in milliseconds since midnight of
1/1/1970 GMT.
|
Date |
getExpireAt() |
String |
getId()
Gets a unique string that identifies the
Session. |
long |
getLastAccessedTime()
Gets the last time this
Session was accessed expressed in milliseconds
since midnight of 1/1/1970 GMT. |
int |
getMaxInactiveIntervalInSeconds()
Gets the maximum inactive interval in seconds between requests before this session
will be invalidated.
|
int |
hashCode() |
boolean |
isExpired()
Returns true if the session is expired.
|
void |
removeAttribute(String attributeName)
Removes the attribute with the provided attribute name.
|
void |
setAttribute(String attributeName,
Object attributeValue)
Sets the attribute value for the provided attribute name.
|
void |
setCreationTime(long created) |
void |
setExpireAt(Date expireAt) |
void |
setLastAccessedTime(long lastAccessedTime)
Sets the last accessed time in milliseconds since midnight of 1/1/1970 GMT.
|
void |
setMaxInactiveIntervalInSeconds(int interval)
Sets the maximum inactive interval in seconds between requests before this session
will be invalidated.
|
public MongoExpiringSession()
public MongoExpiringSession(int maxInactiveIntervalInSeconds)
public MongoExpiringSession(String id, int maxInactiveIntervalInSeconds)
public String getId()
SessionSession.public <T> T getAttribute(String attributeName)
SessiongetAttribute in interface SessionT - The return type of the attributeattributeName - the name of the attribute to getpublic Set<String> getAttributeNames()
SessionSession.getAttribute(String) to
obtain the attribute value.getAttributeNames in interface SessionSession.getAttribute(String)public void setAttribute(String attributeName, Object attributeValue)
SessionSession.removeAttribute(String) .setAttribute in interface SessionattributeName - the attribute name to setattributeValue - the value of the attribute to set. If null, the attribute
will be removed.public void removeAttribute(String attributeName)
SessionremoveAttribute in interface SessionattributeName - the name of the attribute to removepublic long getCreationTime()
ExpiringSessiongetCreationTime in interface ExpiringSessionpublic void setCreationTime(long created)
public void setLastAccessedTime(long lastAccessedTime)
ExpiringSessionsetLastAccessedTime in interface ExpiringSessionlastAccessedTime - the last accessed time in milliseconds since midnight of
1/1/1970 GMTpublic long getLastAccessedTime()
ExpiringSessionSession was accessed expressed in milliseconds
since midnight of 1/1/1970 GMT.getLastAccessedTime in interface ExpiringSessionpublic void setMaxInactiveIntervalInSeconds(int interval)
ExpiringSessionsetMaxInactiveIntervalInSeconds in interface ExpiringSessioninterval - the number of seconds that the Session should be kept alive
between client requests.public int getMaxInactiveIntervalInSeconds()
ExpiringSessiongetMaxInactiveIntervalInSeconds in interface ExpiringSessionpublic boolean isExpired()
ExpiringSessionisExpired in interface ExpiringSessionpublic Date getExpireAt()
public void setExpireAt(Date expireAt)