public static class AbstractGemFireOperationsSessionRepository.GemFireSession extends Object implements 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 String |
SPRING_SECURITY_CONTEXT |
protected static DateFormat |
TO_STRING_DATE_FORMAT |
Modifier | Constructor and Description |
---|---|
protected |
GemFireSession() |
protected |
GemFireSession(ExpiringSession session) |
protected |
GemFireSession(String id) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowJavaSerialization() |
int |
compareTo(ExpiringSession session) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
create(int maxInactiveIntervalInSeconds) |
boolean |
equals(Object obj) |
static AbstractGemFireOperationsSessionRepository.GemFireSession |
from(ExpiringSession expiringSession) |
void |
fromData(DataInput in) |
void |
fromDelta(DataInput in) |
<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.
|
AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes |
getAttributes() |
long |
getCreationTime()
Gets the time when this session was created in milliseconds since midnight of
1/1/1970 GMT.
|
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.
|
String |
getPrincipalName() |
boolean |
hasDelta() |
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 |
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(String principalName) |
void |
toData(DataOutput out) |
void |
toDelta(DataOutput out) |
String |
toString() |
protected static final boolean DEFAULT_ALLOW_JAVA_SERIALIZATION
protected static final DateFormat TO_STRING_DATE_FORMAT
protected static final String SPRING_SECURITY_CONTEXT
protected GemFireSession()
protected GemFireSession(String id)
protected GemFireSession(ExpiringSession session)
public static AbstractGemFireOperationsSessionRepository.GemFireSession create(int maxInactiveIntervalInSeconds)
public static AbstractGemFireOperationsSessionRepository.GemFireSession from(ExpiringSession expiringSession)
protected boolean allowJavaSerialization()
public String getId()
Session
Session
.public long getCreationTime()
ExpiringSession
getCreationTime
in interface ExpiringSession
public void setAttribute(String attributeName, Object attributeValue)
Session
Session.removeAttribute(String)
.setAttribute
in interface Session
attributeName
- the attribute name to setattributeValue
- the value of the attribute to set. If null, the attribute
will be removed.public void removeAttribute(String attributeName)
Session
removeAttribute
in interface Session
attributeName
- the name of the attribute to removepublic <T> T getAttribute(String attributeName)
Session
getAttribute
in interface Session
T
- The return type of the attributeattributeName
- the name of the attribute to getpublic Set<String> getAttributeNames()
Session
Session.getAttribute(String)
to
obtain the attribute value.getAttributeNames
in interface Session
Session.getAttribute(String)
public AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes getAttributes()
public boolean isExpired()
ExpiringSession
isExpired
in interface ExpiringSession
public void setLastAccessedTime(long lastAccessedTime)
ExpiringSession
setLastAccessedTime
in interface ExpiringSession
lastAccessedTime
- the last accessed time in milliseconds since midnight of
1/1/1970 GMTpublic long getLastAccessedTime()
ExpiringSession
Session
was accessed expressed in milliseconds
since midnight of 1/1/1970 GMT.getLastAccessedTime
in interface ExpiringSession
public void setMaxInactiveIntervalInSeconds(int maxInactiveIntervalInSeconds)
ExpiringSession
setMaxInactiveIntervalInSeconds
in interface ExpiringSession
maxInactiveIntervalInSeconds
- the number of seconds that the Session
should be kept alive
between client requests.public int getMaxInactiveIntervalInSeconds()
ExpiringSession
getMaxInactiveIntervalInSeconds
in interface ExpiringSession
public void setPrincipalName(String principalName)
public String getPrincipalName()
public void toData(DataOutput out) throws IOException
toData
in interface com.gemstone.gemfire.DataSerializable
IOException
public void fromData(DataInput in) throws ClassNotFoundException, IOException
fromData
in interface com.gemstone.gemfire.DataSerializable
ClassNotFoundException
IOException
public boolean hasDelta()
hasDelta
in interface com.gemstone.gemfire.Delta
public void toDelta(DataOutput out) throws IOException
toDelta
in interface com.gemstone.gemfire.Delta
IOException
public void fromDelta(DataInput in) throws IOException
fromDelta
in interface com.gemstone.gemfire.Delta
IOException
public int compareTo(ExpiringSession session)
compareTo
in interface Comparable<ExpiringSession>