public class DeltaSession extends org.apache.catalina.session.StandardSession implements DataSerializable, Delta, GatewayDelta, com.gemstone.gemfire.internal.cache.lru.Sizeable
DataSerializable.Replaceable
accessCount, ACTIVITY_CHECK, attributes, authType, creationTime, EMPTY_ARRAY, excludedAttributes, expiring, facade, id, info, isNew, isValid, lastAccessedTime, listeners, manager, maxInactiveInterval, NOT_SERIALIZED, notes, principal, sessionContext, sm, support, thisAccessedTime
GATEWAY_DELTA_REGION_NAME
Constructor and Description |
---|
DeltaSession()
Construct a new
Session associated with no Manager . |
DeltaSession(org.apache.catalina.Manager manager)
Construct a new Session associated with the specified Manager.
|
Modifier and Type | Method and Description |
---|---|
void |
abort() |
void |
applyAttributeEvents(Region<java.lang.String,DeltaSession> region,
java.util.List<com.gemstone.gemfire.modules.session.catalina.internal.DeltaSessionAttributeEvent> events) |
void |
commit() |
void |
fromData(java.io.DataInput in)
Reads the state of this object as primitive data from the given
DataInput . |
void |
fromDelta(java.io.DataInput in)
This method is invoked on an existing application object when an update is
received as a delta.
|
java.lang.Object |
getAttribute(java.lang.String name) |
java.lang.String |
getContextName() |
GatewayDeltaEvent |
getCurrentGatewayDeltaEvent() |
protected boolean |
getExpired() |
protected Region<java.lang.String,javax.servlet.http.HttpSession> |
getOperatingRegion() |
java.security.Principal |
getPrincipal() |
javax.servlet.http.HttpSession |
getSession()
Return the
HttpSession for which this object is the facade. |
int |
getSizeInBytes() |
boolean |
hasDelta()
Returns true if this object has pending changes it can write out.
|
void |
invalidate() |
boolean |
isCommitEnabled() |
void |
localDestroyAttribute(java.lang.String name) |
void |
localUpdateAttribute(java.lang.String name,
java.lang.Object value) |
void |
processExpired() |
void |
removeAttribute(java.lang.String name,
boolean notify) |
void |
setAttribute(java.lang.String name,
java.lang.Object value,
boolean notify) |
void |
setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent) |
void |
setMaxInactiveInterval(int interval) |
void |
setOwner(java.lang.Object manager) |
void |
setPrincipal(java.security.Principal principal) |
void |
toData(java.io.DataOutput out)
Writes the state of this object as primitive data to the given
DataOutput . |
void |
toDelta(java.io.DataOutput out)
This method is invoked on an application object at the delta sender, if
GemFire determines the presence of a delta by calling
Delta.hasDelta() on the object. |
java.lang.String |
toString() |
access, activate, addSessionListener, endAccess, exclude, expire, expire, fireContainerEvent, fireSessionEvent, getAttributeNames, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getServletContext, getSessionContext, getValue, getValueNames, isAttributeDistributable, isNew, isValid, isValidInternal, keys, passivate, putValue, readObject, readObjectData, recycle, removeAttribute, removeAttributeInternal, removeNote, removeSessionListener, removeValue, setAttribute, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid, tellNew, writeObject, writeObjectData
public DeltaSession()
Session
associated with no Manager
. The Manager
will be
assigned later using setOwner(Object)
.public DeltaSession(org.apache.catalina.Manager manager)
manager
- The manager with which this Session is associatedpublic javax.servlet.http.HttpSession getSession()
HttpSession
for which this object is the facade.getSession
in interface org.apache.catalina.Session
getSession
in class org.apache.catalina.session.StandardSession
public java.security.Principal getPrincipal()
getPrincipal
in interface org.apache.catalina.Session
getPrincipal
in class org.apache.catalina.session.StandardSession
public void setPrincipal(java.security.Principal principal)
setPrincipal
in interface org.apache.catalina.Session
setPrincipal
in class org.apache.catalina.session.StandardSession
protected Region<java.lang.String,javax.servlet.http.HttpSession> getOperatingRegion()
public boolean isCommitEnabled()
public GatewayDeltaEvent getCurrentGatewayDeltaEvent()
getCurrentGatewayDeltaEvent
in interface GatewayDelta
public void setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent)
setCurrentGatewayDeltaEvent
in interface GatewayDelta
public void setOwner(java.lang.Object manager)
public void setAttribute(java.lang.String name, java.lang.Object value, boolean notify)
setAttribute
in class org.apache.catalina.session.StandardSession
public void removeAttribute(java.lang.String name, boolean notify)
removeAttribute
in class org.apache.catalina.session.StandardSession
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.http.HttpSession
getAttribute
in class org.apache.catalina.session.StandardSession
public void invalidate()
invalidate
in interface javax.servlet.http.HttpSession
invalidate
in class org.apache.catalina.session.StandardSession
public void processExpired()
public void setMaxInactiveInterval(int interval)
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
setMaxInactiveInterval
in interface org.apache.catalina.Session
setMaxInactiveInterval
in class org.apache.catalina.session.StandardSession
public void localUpdateAttribute(java.lang.String name, java.lang.Object value)
public void localDestroyAttribute(java.lang.String name)
public void applyAttributeEvents(Region<java.lang.String,DeltaSession> region, java.util.List<com.gemstone.gemfire.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)
public void commit()
public void abort()
protected boolean getExpired()
public java.lang.String getContextName()
public boolean hasDelta()
Delta
public void toDelta(java.io.DataOutput out) throws java.io.IOException
Delta
Delta.hasDelta()
on the object. The delta is written to the
DataOutput
object provided by GemFire.
Any delta state should be reset in this method.public void fromDelta(java.io.DataInput in) throws java.io.IOException, InvalidDeltaException
Delta
InvalidDeltaException
when the delta in the DataInput
cannot be applied to the object.
GemFire automatically handles an InvalidDeltaException
by
reattempting the update by sending the full application object.fromDelta
in interface Delta
java.io.IOException
InvalidDeltaException
public void toData(java.io.DataOutput out) throws java.io.IOException
DataSerializable
DataOutput
.
Since 5.7 it is possible for any method call to the specified
DataOutput
to throw GemFireRethrowable
.
It should not be caught by user code.
If it is it must be rethrown.
toData
in interface DataSerializable
java.io.IOException
- A problem occurs while writing to out
public void fromData(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
DataSerializable
DataInput
.fromData
in interface DataSerializable
java.io.IOException
- A problem occurs while reading from in
java.lang.ClassNotFoundException
- A class could not be loaded while reading from
in
public int getSizeInBytes()
getSizeInBytes
in interface com.gemstone.gemfire.internal.cache.lru.Sizeable
public java.lang.String toString()
toString
in class org.apache.catalina.session.StandardSession