Class DeltaSession
java.lang.Object
org.apache.catalina.session.StandardSession
org.apache.geode.modules.session.catalina.DeltaSession
- All Implemented Interfaces:
jakarta.servlet.http.HttpSession,Serializable,org.apache.catalina.Session,DataSerializable,Delta,org.apache.geode.internal.size.Sizeable,GatewayDelta,DeltaSessionInterface
- Direct Known Subclasses:
DeltaSession10
public class DeltaSession
extends org.apache.catalina.session.StandardSession
implements DataSerializable, Delta, GatewayDelta, org.apache.geode.internal.size.Sizeable, DeltaSessionInterface
- See Also:
-
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, activityCheck, attributes, authType, creationTime, EMPTY_ARRAY, expiring, facade, id, isNew, isValid, lastAccessAtStart, lastAccessedTime, listeners, manager, maxInactiveInterval, notes, principal, sm, support, thisAccessedTimeFields inherited from interface org.apache.geode.modules.gatewaydelta.GatewayDelta
GATEWAY_DELTA_REGION_NAMEFields inherited from interface org.apache.catalina.Session
SESSION_ACTIVATED_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENTFields inherited from interface org.apache.geode.internal.size.Sizeable
PER_OBJECT_OVERHEAD -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a newSessionassociated with noManager.DeltaSession(org.apache.catalina.Manager manager) Construct a new Session associated with the specified Manager. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidapplyAttributeEvents(Region<String, DeltaSessionInterface> region, List<org.apache.geode.modules.session.catalina.internal.DeltaSessionAttributeEvent> events) voidcommit()protected voidvoidexpire(boolean notify) voidReads the state of this object as primitive data from the givenDataInput.voidThis method is invoked on an existing application object when an update is received as a delta.getAttribute(String name) protected ObjectgetAttributeInternal(String name) booleanjakarta.servlet.http.HttpSessionReturn theHttpSessionfor which this object is the facade.intbooleanhasDelta()Returns true if this object has pending changes it can write out as a delta.voidvoidlocalDestroyAttribute(String name) voidlocalUpdateAttribute(String name, Object value) voidvoidremoveAttribute(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) voidvoidsetPrincipal(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.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, getThisAccessedTime, getThisAccessedTimeInternal, isAttributeDistributable, isNew, isValid, isValidInternal, keys, passivate, readObjectData, recycle, removeAttribute, removeNote, removeSessionListener, setAttribute, setAuthType, setCreationTime, setId, setId, setManager, setNew, setNote, setValid, tellChangedSessionId, tellNew, writeObjectDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.geode.Delta
getForceRecalculateSizeMethods inherited from interface org.apache.geode.modules.session.catalina.DeltaSessionInterface
activate, isValidMethods 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 Details
-
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 Details
-
getSession
public jakarta.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
- Specified by:
getPrincipalin interfaceorg.apache.catalina.Session- Overrides:
getPrincipalin classorg.apache.catalina.session.StandardSession
-
setPrincipal
- Specified by:
setPrincipalin interfaceorg.apache.catalina.Session- Overrides:
setPrincipalin classorg.apache.catalina.session.StandardSession
-
getCurrentGatewayDeltaEvent
- Specified by:
getCurrentGatewayDeltaEventin interfaceGatewayDelta
-
setCurrentGatewayDeltaEvent
- Specified by:
setCurrentGatewayDeltaEventin interfaceGatewayDelta
-
setOwner
- Specified by:
setOwnerin interfaceDeltaSessionInterface
-
setAttribute
- Overrides:
setAttributein classorg.apache.catalina.session.StandardSession
-
removeAttribute
- Overrides:
removeAttributein classorg.apache.catalina.session.StandardSession
-
removeAttributeInternal
- Overrides:
removeAttributeInternalin classorg.apache.catalina.session.StandardSession
-
getAttributeInternal
-
setAttributeInternal
-
getAttribute
- Specified by:
getAttributein interfacejakarta.servlet.http.HttpSession- Overrides:
getAttributein classorg.apache.catalina.session.StandardSession
-
deserializeAttributeInternal
-
invalidate
public void invalidate()- Specified by:
invalidatein interfacejakarta.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 interfacejakarta.servlet.http.HttpSession- Specified by:
setMaxInactiveIntervalin interfaceorg.apache.catalina.Session- Overrides:
setMaxInactiveIntervalin classorg.apache.catalina.session.StandardSession
-
localUpdateAttribute
- Specified by:
localUpdateAttributein interfaceDeltaSessionInterface
-
localDestroyAttribute
- 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
- 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
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
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
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
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
-
getAttributes
-
toString
- Overrides:
toStringin classorg.apache.catalina.session.StandardSession
-