public class DeltaSession extends org.apache.catalina.session.StandardSession implements DataSerializable, Delta, GatewayDelta, org.apache.geode.internal.size.Sizeable, DeltaSessionInterface
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<String,DeltaSessionInterface> region,
List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events) |
void |
commit() |
protected void |
deserializeAttributeInternal(String name) |
void |
expire(boolean notify) |
void |
fromData(DataInput in)
Reads the state of this object as primitive data from the given
DataInput . |
void |
fromDelta(DataInput in)
This method is invoked on an existing application object when an update is received as a delta.
|
Object |
getAttribute(String name) |
protected Object |
getAttributeInternal(String name) |
protected Map<String,Object> |
getAttributes() |
String |
getContextName() |
GatewayDeltaEvent |
getCurrentGatewayDeltaEvent() |
boolean |
getExpired() |
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 as a delta.
|
void |
invalidate() |
void |
localDestroyAttribute(String name) |
void |
localUpdateAttribute(String name,
Object value) |
void |
processExpired() |
void |
removeAttribute(String name,
boolean notify) |
protected void |
removeAttributeInternal(String name,
boolean notify) |
void |
setAttribute(String name,
Object value,
boolean notify) |
protected void |
setAttributeInternal(String name,
Object value) |
void |
setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent) |
void |
setMaxInactiveInterval(int interval) |
void |
setOwner(Object manager) |
void |
setPrincipal(Principal principal) |
void |
toData(DataOutput out)
Writes the state of this object as primitive data to the given
DataOutput . |
void |
toDelta(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. |
String |
toString() |
access, activate, addSessionListener, endAccess, exclude, 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, removeNote, removeSessionListener, removeValue, setAttribute, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid, tellNew, writeObject, writeObjectData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getForceRecalculateSize
activate, isValid
access, addSessionListener, endAccess, expire, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, recycle, removeNote, removeSessionListener, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid
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 Principal getPrincipal()
getPrincipal
in interface org.apache.catalina.Session
getPrincipal
in class org.apache.catalina.session.StandardSession
public void setPrincipal(Principal principal)
setPrincipal
in interface org.apache.catalina.Session
setPrincipal
in class org.apache.catalina.session.StandardSession
public GatewayDeltaEvent getCurrentGatewayDeltaEvent()
getCurrentGatewayDeltaEvent
in interface GatewayDelta
public void setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent)
setCurrentGatewayDeltaEvent
in interface GatewayDelta
public void setOwner(Object manager)
setOwner
in interface DeltaSessionInterface
public void setAttribute(String name, Object value, boolean notify)
setAttribute
in class org.apache.catalina.session.StandardSession
public void removeAttribute(String name, boolean notify)
removeAttribute
in class org.apache.catalina.session.StandardSession
protected void removeAttributeInternal(String name, boolean notify)
removeAttributeInternal
in class org.apache.catalina.session.StandardSession
public Object getAttribute(String name)
getAttribute
in interface javax.servlet.http.HttpSession
getAttribute
in class org.apache.catalina.session.StandardSession
protected void deserializeAttributeInternal(String name)
public void invalidate()
invalidate
in interface javax.servlet.http.HttpSession
invalidate
in class org.apache.catalina.session.StandardSession
public void processExpired()
processExpired
in interface DeltaSessionInterface
public void expire(boolean notify)
expire
in class org.apache.catalina.session.StandardSession
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(String name, Object value)
localUpdateAttribute
in interface DeltaSessionInterface
public void localDestroyAttribute(String name)
localDestroyAttribute
in interface DeltaSessionInterface
public void applyAttributeEvents(Region<String,DeltaSessionInterface> region, List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)
applyAttributeEvents
in interface DeltaSessionInterface
public void commit()
commit
in interface DeltaSessionInterface
public void abort()
abort
in interface DeltaSessionInterface
public boolean getExpired()
getExpired
in interface DeltaSessionInterface
public String getContextName()
getContextName
in interface DeltaSessionInterface
public boolean hasDelta()
Delta
public void toDelta(DataOutput out) throws 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.
toDelta
in interface Delta
out
- the DataOutput
to write toIOException
- if a problem occurs while writing to out
public void fromDelta(DataInput in) throws 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
in
- the DataInput
to read fromIOException
- if a problem occurs while reading from in
InvalidDeltaException
public void toData(DataOutput out) throws 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
toData
in interface DeltaSessionInterface
out
- the DataOutput
to write toIOException
- A problem occurs while writing to out
public void fromData(DataInput in) throws IOException, ClassNotFoundException
DataSerializable
DataInput
.fromData
in interface DataSerializable
fromData
in interface DeltaSessionInterface
in
- the DataInput
to read fromIOException
- A problem occurs while reading from in
ClassNotFoundException
- A class could not be loaded while reading from in
public int getSizeInBytes()
getSizeInBytes
in interface org.apache.geode.internal.size.Sizeable
public String toString()
toString
in class org.apache.catalina.session.StandardSession