public static class AbstractGemFireOperationsSessionRepository.GemFireSession extends java.lang.Object implements java.lang.Comparable<ExpiringSession>, com.gemstone.gemfire.DataSerializable, com.gemstone.gemfire.Delta, ExpiringSession
ExpiringSession
that stores and manages Session state information in GemFire. This class implements
GemFire's DataSerializable interface to better handle replication of Session
state information across the GemFire cluster.| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DEFAULT_ALLOW_JAVA_SERIALIZATION |
protected static java.lang.String |
SPRING_SECURITY_CONTEXT |
protected static java.text.DateFormat |
TO_STRING_DATE_FORMAT |
| Modifier | Constructor and Description |
|---|---|
protected |
GemFireSession() |
protected |
GemFireSession(ExpiringSession session) |
protected |
GemFireSession(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowJavaSerialization() |
int |
compareTo(ExpiringSession session) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
copy(ExpiringSession session) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
create(int maxInactiveIntervalInSeconds) |
boolean |
equals(java.lang.Object obj) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
from(ExpiringSession session) |
void |
fromData(java.io.DataInput in) |
void |
fromDelta(java.io.DataInput in) |
<T> T |
getAttribute(java.lang.String attributeName)
Gets the Object associated with the specified name or null if no Object is
associated to that name.
|
java.util.Set<java.lang.String> |
getAttributeNames()
Gets the attribute names that have a value associated with it.
|
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes |
getAttributes() |
long |
getCreationTime()
Gets the time when this session was created in milliseconds since midnight of
1/1/1970 GMT.
|
java.lang.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.
|
java.lang.String |
getPrincipalName() |
boolean |
hasDelta() |
int |
hashCode() |
boolean |
isExpired()
Returns true if the session is expired.
|
void |
removeAttribute(java.lang.String attributeName)
Removes the attribute with the provided attribute name.
|
void |
setAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
Sets the attribute value for the provided attribute name.
|
void |
setLastAccessedTime(long lastAccessedTime)
Sets the last accessed time in milliseconds since midnight of 1/1/1970 GMT.
|
void |
setMaxInactiveIntervalInSeconds(int maxInactiveIntervalInSeconds)
Sets the maximum inactive interval in seconds between requests before this session
will be invalidated.
|
void |
setPrincipalName(java.lang.String principalName) |
void |
toData(java.io.DataOutput out) |
void |
toDelta(java.io.DataOutput out) |
java.lang.String |
toString() |
protected static final boolean DEFAULT_ALLOW_JAVA_SERIALIZATION
protected static final java.text.DateFormat TO_STRING_DATE_FORMAT
protected static final java.lang.String SPRING_SECURITY_CONTEXT
protected GemFireSession()
protected GemFireSession(java.lang.String id)
protected GemFireSession(ExpiringSession session)
public static AbstractGemFireOperationsSessionRepository.GemFireSession create(int maxInactiveIntervalInSeconds)
public static AbstractGemFireOperationsSessionRepository.GemFireSession copy(ExpiringSession session)
public static AbstractGemFireOperationsSessionRepository.GemFireSession from(ExpiringSession session)
protected boolean allowJavaSerialization()
public java.lang.String getId()
SessionSession.public long getCreationTime()
ExpiringSessiongetCreationTime in interface ExpiringSessionpublic void setAttribute(java.lang.String attributeName,
java.lang.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(java.lang.String attributeName)
SessionremoveAttribute in interface SessionattributeName - the name of the attribute to removepublic <T> T getAttribute(java.lang.String attributeName)
SessiongetAttribute in interface SessionT - The return type of the attributeattributeName - the name of the attribute to getpublic java.util.Set<java.lang.String> getAttributeNames()
SessionSession.getAttribute(String) to
obtain the attribute value.getAttributeNames in interface SessionSession.getAttribute(String)public AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes getAttributes()
public boolean isExpired()
ExpiringSessionisExpired in interface ExpiringSessionpublic 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 maxInactiveIntervalInSeconds)
ExpiringSessionsetMaxInactiveIntervalInSeconds in interface ExpiringSessionmaxInactiveIntervalInSeconds - the number of seconds that the Session should be kept alive
between client requests.public int getMaxInactiveIntervalInSeconds()
ExpiringSessiongetMaxInactiveIntervalInSeconds in interface ExpiringSessionpublic void setPrincipalName(java.lang.String principalName)
public java.lang.String getPrincipalName()
public void toData(java.io.DataOutput out)
throws java.io.IOException
toData in interface com.gemstone.gemfire.DataSerializablejava.io.IOExceptionpublic void fromData(java.io.DataInput in)
throws java.lang.ClassNotFoundException,
java.io.IOException
fromData in interface com.gemstone.gemfire.DataSerializablejava.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic boolean hasDelta()
hasDelta in interface com.gemstone.gemfire.Deltapublic void toDelta(java.io.DataOutput out)
throws java.io.IOException
toDelta in interface com.gemstone.gemfire.Deltajava.io.IOExceptionpublic void fromDelta(java.io.DataInput in)
throws java.io.IOException
fromDelta in interface com.gemstone.gemfire.Deltajava.io.IOExceptionpublic int compareTo(ExpiringSession session)
compareTo in interface java.lang.Comparable<ExpiringSession>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object