VMware GemFire Java API Reference
Class DeltaSession
- java.lang.Object
-
- org.apache.catalina.session.StandardSession
-
- org.apache.geode.modules.session.catalina.DeltaSession
-
- All Implemented Interfaces:
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 newSessionassociated 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 voidabort()voidapplyAttributeEvents(Region<String,DeltaSessionInterface> region, List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)voidcommit()protected voiddeserializeAttributeInternal(String name)voidexpire(boolean notify)voidfromData(DataInput in)Reads the state of this object as primitive data from the givenDataInput.voidfromDelta(DataInput in)This method is invoked on an existing application object when an update is received as a delta.ObjectgetAttribute(String name)protected ObjectgetAttributeInternal(String name)protected Map<String,Object>getAttributes()StringgetContextName()GatewayDeltaEventgetCurrentGatewayDeltaEvent()booleangetExpired()PrincipalgetPrincipal()javax.servlet.http.HttpSessiongetSession()Return theHttpSessionfor which this object is the facade.intgetSizeInBytes()booleanhasDelta()Returns true if this object has pending changes it can write out as a delta.voidinvalidate()voidlocalDestroyAttribute(String name)voidlocalUpdateAttribute(String name, Object value)voidprocessExpired()voidremoveAttribute(String name, boolean notify)protected voidremoveAttributeInternal(String name, boolean notify)voidsetAttribute(String name, Object value, boolean notify)protected voidsetAttributeInternal(String name, Object value)voidsetCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent)voidsetMaxInactiveInterval(int interval)voidsetOwner(Object manager)voidsetPrincipal(Principal principal)voidtoData(DataOutput out)Writes the state of this object as primitive data to the givenDataOutput.voidtoDelta(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.StringtoString()-
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 newSessionassociated with noManager. TheManagerwill 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 theHttpSessionfor which this object is the facade.- Specified by:
getSessionin interfaceorg.apache.catalina.Session- Overrides:
getSessionin classorg.apache.catalina.session.StandardSession
-
getPrincipal
public Principal getPrincipal()
- Specified by:
getPrincipalin interfaceorg.apache.catalina.Session- Overrides:
getPrincipalin classorg.apache.catalina.session.StandardSession
-
setPrincipal
public void setPrincipal(Principal principal)
- Specified by:
setPrincipalin interfaceorg.apache.catalina.Session- Overrides:
setPrincipalin classorg.apache.catalina.session.StandardSession
-
getCurrentGatewayDeltaEvent
public GatewayDeltaEvent getCurrentGatewayDeltaEvent()
- Specified by:
getCurrentGatewayDeltaEventin interfaceGatewayDelta
-
setCurrentGatewayDeltaEvent
public void setCurrentGatewayDeltaEvent(GatewayDeltaEvent currentGatewayDeltaEvent)
- Specified by:
setCurrentGatewayDeltaEventin interfaceGatewayDelta
-
setOwner
public void setOwner(Object manager)
- Specified by:
setOwnerin interfaceDeltaSessionInterface
-
setAttribute
public void setAttribute(String name, Object value, boolean notify)
- Overrides:
setAttributein classorg.apache.catalina.session.StandardSession
-
removeAttribute
public void removeAttribute(String name, boolean notify)
- Overrides:
removeAttributein classorg.apache.catalina.session.StandardSession
-
removeAttributeInternal
protected void removeAttributeInternal(String name, boolean notify)
- Overrides:
removeAttributeInternalin classorg.apache.catalina.session.StandardSession
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttributein interfacejavax.servlet.http.HttpSession- Overrides:
getAttributein classorg.apache.catalina.session.StandardSession
-
deserializeAttributeInternal
protected void deserializeAttributeInternal(String name)
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfacejavax.servlet.http.HttpSession- Overrides:
invalidatein classorg.apache.catalina.session.StandardSession
-
processExpired
public void processExpired()
- Specified by:
processExpiredin interfaceDeltaSessionInterface
-
expire
public void expire(boolean notify)
- Overrides:
expirein classorg.apache.catalina.session.StandardSession
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveIntervalin interfacejavax.servlet.http.HttpSession- Specified by:
setMaxInactiveIntervalin interfaceorg.apache.catalina.Session- Overrides:
setMaxInactiveIntervalin classorg.apache.catalina.session.StandardSession
-
localUpdateAttribute
public void localUpdateAttribute(String name, Object value)
- Specified by:
localUpdateAttributein interfaceDeltaSessionInterface
-
localDestroyAttribute
public void localDestroyAttribute(String name)
- Specified by:
localDestroyAttributein interfaceDeltaSessionInterface
-
applyAttributeEvents
public void applyAttributeEvents(Region<String,DeltaSessionInterface> region, List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events)
- Specified by:
applyAttributeEventsin interfaceDeltaSessionInterface
-
commit
public void commit()
- Specified by:
commitin interfaceDeltaSessionInterface
-
abort
public void abort()
- Specified by:
abortin interfaceDeltaSessionInterface
-
getExpired
public boolean getExpired()
- Specified by:
getExpiredin interfaceDeltaSessionInterface
-
getContextName
public String getContextName()
- Specified by:
getContextNamein interfaceDeltaSessionInterface
-
hasDelta
public boolean hasDelta()
Description copied from interface:DeltaReturns 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(DataOutput out) throws IOException
Description copied from interface:DeltaThis 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 theDataOutputobject provided by GemFire.Any delta state should be reset in this method.
- Specified by:
toDeltain interfaceDelta- Parameters:
out- theDataOutputto write to- Throws:
IOException- if a problem occurs while writing toout
-
fromDelta
public void fromDelta(DataInput in) throws IOException, InvalidDeltaException
Description copied from interface:DeltaThis method is invoked on an existing application object when an update is received as a delta. This method throws anInvalidDeltaExceptionwhen the delta in theDataInputcannot be applied to the object. GemFire automatically handles anInvalidDeltaExceptionby reattempting the update by sending the full application object.- Specified by:
fromDeltain interfaceDelta- Parameters:
in- theDataInputto read from- Throws:
IOException- if a problem occurs while reading frominInvalidDeltaException
-
toData
public void toData(DataOutput out) throws IOException
Description copied from interface:DataSerializableWrites the state of this object as primitive data to the givenDataOutput.Since 5.7 it is possible for any method call to the specified
DataOutputto throwGemFireRethrowable. It should not be caught by user code. If it is it must be rethrown.- Specified by:
toDatain interfaceDataSerializable- Specified by:
toDatain interfaceDeltaSessionInterface- Parameters:
out- theDataOutputto write to- Throws:
IOException- A problem occurs while writing toout
-
fromData
public void fromData(DataInput in) throws IOException, ClassNotFoundException
Description copied from interface:DataSerializableReads the state of this object as primitive data from the givenDataInput.- Specified by:
fromDatain interfaceDataSerializable- Specified by:
fromDatain interfaceDeltaSessionInterface- Parameters:
in- theDataInputto read from- Throws:
IOException- A problem occurs while reading frominClassNotFoundException- A class could not be loaded while reading fromin
-
getSizeInBytes
public int getSizeInBytes()
- Specified by:
getSizeInBytesin interfaceorg.apache.geode.internal.size.Sizeable
-
toString
public String toString()
- Overrides:
toStringin classorg.apache.catalina.session.StandardSession
-
-