Gemfire JavaDocs
Class DeltaSession
- java.lang.Object
-
- org.apache.catalina.session.StandardSession
-
- org.apache.geode.modules.session.catalina.DeltaSession
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.http.HttpSession
,org.apache.catalina.Session
,DataSerializable
,Delta
,org.apache.geode.internal.size.Sizeable
,GatewayDelta
,DeltaSessionInterface
- Direct Known Subclasses:
DeltaSession10
,DeltaSession8
,DeltaSession9
public class DeltaSession extends org.apache.catalina.session.StandardSession implements DataSerializable, Delta, GatewayDelta, org.apache.geode.internal.size.Sizeable, DeltaSessionInterface
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.geode.DataSerializable
DataSerializable.Replaceable
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.session.StandardSession
accessCount, ACTIVITY_CHECK, attributes, authType, creationTime, EMPTY_ARRAY, expiring, facade, id, isNew, isValid, LAST_ACCESS_AT_START, lastAccessedTime, listeners, manager, maxInactiveInterval, notes, principal, sessionContext, sm, STRICT_SERVLET_COMPLIANCE, support, thisAccessedTime
-
Fields inherited from interface org.apache.geode.modules.gatewaydelta.GatewayDelta
GATEWAY_DELTA_REGION_NAME
-
-
Constructor Summary
Constructors Constructor Description DeltaSession()
Construct a newSession
associated with noManager
.DeltaSession(org.apache.catalina.Manager manager)
Construct a new Session associated with the specified Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
void
applyAttributeEvents(Region<java.lang.String,DeltaSessionInterface> region, java.util.List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)
void
commit()
protected void
deserializeAttributeInternal(java.lang.String name)
void
expire(boolean notify)
void
fromData(java.io.DataInput in)
Reads the state of this object as primitive data from the givenDataInput
.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)
protected java.lang.Object
getAttributeInternal(java.lang.String name)
protected java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
java.lang.String
getContextName()
GatewayDeltaEvent
getCurrentGatewayDeltaEvent()
boolean
getExpired()
java.security.Principal
getPrincipal()
javax.servlet.http.HttpSession
getSession()
Return theHttpSession
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(java.lang.String name)
void
localUpdateAttribute(java.lang.String name, java.lang.Object value)
void
processExpired()
void
removeAttribute(java.lang.String name, boolean notify)
protected void
removeAttributeInternal(java.lang.String name, boolean notify)
void
setAttribute(java.lang.String name, java.lang.Object value, boolean notify)
protected void
setAttributeInternal(java.lang.String name, java.lang.Object value)
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 givenDataOutput
.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 callingDelta.hasDelta()
on the object.java.lang.String
toString()
-
Methods inherited from class org.apache.catalina.session.StandardSession
access, activate, addSessionListener, doReadObject, doWriteObject, endAccess, exclude, expire, fireSessionEvent, getAttributeNames, getAuthType, getCreationTime, getCreationTimeInternal, getId, getIdInternal, getIdleTime, getIdleTimeInternal, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getServletContext, getSessionContext, getThisAccessedTime, getThisAccessedTimeInternal, getValue, getValueNames, isAttributeDistributable, isNew, isValid, isValidInternal, keys, passivate, putValue, readObjectData, recycle, removeAttribute, removeNote, removeSessionListener, removeValue, setAttribute, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid, tellChangedSessionId, tellNew, writeObjectData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.geode.Delta
getForceRecalculateSize
-
Methods inherited from interface org.apache.geode.modules.session.catalina.DeltaSessionInterface
activate, isValid
-
Methods inherited from interface org.apache.catalina.Session
access, addSessionListener, endAccess, expire, getAuthType, getCreationTime, getCreationTimeInternal, getId, getIdInternal, getIdleTime, getIdleTimeInternal, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getThisAccessedTime, getThisAccessedTimeInternal, isAttributeDistributable, recycle, removeNote, removeSessionListener, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid, tellChangedSessionId
-
-
-
-
Constructor Detail
-
DeltaSession
public DeltaSession()
Construct a newSession
associated with noManager
. TheManager
will be assigned later usingsetOwner(Object)
.
-
DeltaSession
public DeltaSession(org.apache.catalina.Manager manager)
Construct a new Session associated with the specified Manager.- Parameters:
manager
- The manager with which this Session is associated
-
-
Method Detail
-
getSession
public javax.servlet.http.HttpSession getSession()
Return theHttpSession
for which this object is the facade.- Specified by:
getSession
in interfaceorg.apache.catalina.Session
- Overrides:
getSession
in classorg.apache.catalina.session.StandardSession
-
getPrincipal
public java.security.Principal getPrincipal()
- Specified by:
getPrincipal
in interfaceorg.apache.catalina.Session
- Overrides:
getPrincipal
in classorg.apache.catalina.session.StandardSession
-
setPrincipal
public void setPrincipal(java.security.Principal principal)
- Specified by:
setPrincipal
in interfaceorg.apache.catalina.Session
- Overrides:
setPrincipal
in classorg.apache.catalina.session.StandardSession
-
getCurrentGatewayDeltaEvent
public GatewayDeltaEvent getCurrentGatewayDeltaEvent()
- Specified by:
getCurrentGatewayDeltaEvent
in interfaceGatewayDelta
-
setCurrentGatewayDeltaEvent
public void setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent)
- Specified by:
setCurrentGatewayDeltaEvent
in interfaceGatewayDelta
-
setOwner
public void setOwner(java.lang.Object manager)
- Specified by:
setOwner
in interfaceDeltaSessionInterface
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value, boolean notify)
- Overrides:
setAttribute
in classorg.apache.catalina.session.StandardSession
-
removeAttribute
public void removeAttribute(java.lang.String name, boolean notify)
- Overrides:
removeAttribute
in classorg.apache.catalina.session.StandardSession
-
removeAttributeInternal
protected void removeAttributeInternal(java.lang.String name, boolean notify)
- Overrides:
removeAttributeInternal
in classorg.apache.catalina.session.StandardSession
-
getAttributeInternal
protected java.lang.Object getAttributeInternal(java.lang.String name)
-
setAttributeInternal
protected void setAttributeInternal(java.lang.String name, java.lang.Object value)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Specified by:
getAttribute
in interfacejavax.servlet.http.HttpSession
- Overrides:
getAttribute
in classorg.apache.catalina.session.StandardSession
-
deserializeAttributeInternal
protected void deserializeAttributeInternal(java.lang.String name)
-
invalidate
public void invalidate()
- Specified by:
invalidate
in interfacejavax.servlet.http.HttpSession
- Overrides:
invalidate
in classorg.apache.catalina.session.StandardSession
-
processExpired
public void processExpired()
- Specified by:
processExpired
in interfaceDeltaSessionInterface
-
expire
public void expire(boolean notify)
- Overrides:
expire
in classorg.apache.catalina.session.StandardSession
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveInterval
in interfacejavax.servlet.http.HttpSession
- Specified by:
setMaxInactiveInterval
in interfaceorg.apache.catalina.Session
- Overrides:
setMaxInactiveInterval
in classorg.apache.catalina.session.StandardSession
-
localUpdateAttribute
public void localUpdateAttribute(java.lang.String name, java.lang.Object value)
- Specified by:
localUpdateAttribute
in interfaceDeltaSessionInterface
-
localDestroyAttribute
public void localDestroyAttribute(java.lang.String name)
- Specified by:
localDestroyAttribute
in interfaceDeltaSessionInterface
-
applyAttributeEvents
public void applyAttributeEvents(Region<java.lang.String,DeltaSessionInterface> region, java.util.List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)
- Specified by:
applyAttributeEvents
in interfaceDeltaSessionInterface
-
commit
public void commit()
- Specified by:
commit
in interfaceDeltaSessionInterface
-
abort
public void abort()
- Specified by:
abort
in interfaceDeltaSessionInterface
-
getExpired
public boolean getExpired()
- Specified by:
getExpired
in interfaceDeltaSessionInterface
-
getContextName
public java.lang.String getContextName()
- Specified by:
getContextName
in interfaceDeltaSessionInterface
-
hasDelta
public boolean hasDelta()
Description copied from interface:Delta
Returns true if this object has pending changes it can write out as a delta. Returns false if this object must be transmitted in its entirety.
-
toDelta
public void toDelta(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:Delta
This method is invoked on an application object at the delta sender, if GemFire determines the presence of a delta by callingDelta.hasDelta()
on the object. The delta is written to theDataOutput
object provided by GemFire.Any delta state should be reset in this method.
-
fromDelta
public void fromDelta(java.io.DataInput in) throws java.io.IOException, InvalidDeltaException
Description copied from interface:Delta
This method is invoked on an existing application object when an update is received as a delta. This method throws anInvalidDeltaException
when the delta in theDataInput
cannot be applied to the object. GemFire automatically handles anInvalidDeltaException
by reattempting the update by sending the full application object.- Specified by:
fromDelta
in interfaceDelta
- Parameters:
in
- theDataInput
to read from- Throws:
java.io.IOException
- if a problem occurs while reading fromin
InvalidDeltaException
-
toData
public void toData(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes the state of this object as primitive data to the givenDataOutput
.Since 5.7 it is possible for any method call to the specified
DataOutput
to throwGemFireRethrowable
. It should not be caught by user code. If it is it must be rethrown.- Specified by:
toData
in interfaceDataSerializable
- Specified by:
toData
in interfaceDeltaSessionInterface
- Parameters:
out
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
-
fromData
public void fromData(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Description copied from interface:DataSerializable
Reads the state of this object as primitive data from the givenDataInput
.- Specified by:
fromData
in interfaceDataSerializable
- Specified by:
fromData
in interfaceDeltaSessionInterface
- Parameters:
in
- theDataInput
to read from- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- A class could not be loaded while reading fromin
-
getSizeInBytes
public int getSizeInBytes()
- Specified by:
getSizeInBytes
in interfaceorg.apache.geode.internal.size.Sizeable
-
getAttributes
protected java.util.Map<java.lang.String,java.lang.Object> getAttributes()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classorg.apache.catalina.session.StandardSession
-
-