Package org.apache.catalina.ha.session

# Class DeltaRequest

java.lang.Object
org.apache.catalina.ha.session.DeltaRequest

All Implemented Interfaces:
  `Externalizable`, `Serializable`

public class DeltaRequest extends Object implements Externalizable
This class is used to track the series of actions that happens when a request is executed. These actions will then translate into invocations of methods on the actual session.

This class is NOT thread safe. One DeltaRequest per session.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ACTION_REMOVE`
`static final int`
`ACTION_SET`
`static final Log`
`log`
`static final String`
`NAME_AUTHTYPE`
`static final String`
`NAME_ISNEW`
`static final String`
`NAME_LISTENER`
`static final String`
`NAME_MAXINTERVAL`
`static final String`
`NAME_PRINCIPAL`
`protected static final StringManager`
`sm`
The string manager for this package.
`static final int`
`TYPE_ATTRIBUTE`
`static final int`
`TYPE_AUTHTYPE`
`static final int`
`TYPE_ISNEW`
`static final int`
`TYPE_LISTENER`
`static final int`
`TYPE_MAXINTERVAL`
`static final int`
`TYPE_NOTE`
`static final int`
`TYPE_PRINCIPAL`

## Constructor Summary

Constructors
Constructor
Description
`DeltaRequest()`
`DeltaRequest(String sessionId, boolean recordAllActions)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addAction(int type, int action, String name, Object value)`
`void`
`addSessionListener(SessionListener listener)`
`void`
`clear()`
`void`
`execute(DeltaSession session, boolean notifyListeners)`
`String`
`getSessionId()`
`int`
`getSize()`
`void`
`readExternal(ObjectInput in)`
`void`
`removeAttribute(String name)`
`void`
`removeNote(String name)`
`void`
`removeSessionListener(SessionListener listener)`
`void`
`reset()`
`protected byte[]`
`serialize()`
serialize DeltaRequest
`void`
`setAttribute(String name, Object value)`
`void`
`setAuthType(String authType)`
`void`
`setMaxInactiveInterval(int interval)`
`void`
`setNew(boolean n)`
`void`
`setNote(String name, Object value)`
`void`
`setPrincipal(Principal p)`
Only support principals from type `GenericPrincipal`
`void`
`setSessionId(String sessionId)`
`void`
`writeExternal(ObjectOutput out)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

public static final Log log

### sm

protected static final StringManager sm
The string manager for this package.

### TYPE_ATTRIBUTE

public static final int TYPE_ATTRIBUTE

See Also:
  - Constant Field Values

### TYPE_PRINCIPAL

public static final int TYPE_PRINCIPAL

See Also:
  - Constant Field Values

### TYPE_ISNEW

public static final int TYPE_ISNEW

See Also:
  - Constant Field Values

### TYPE_MAXINTERVAL

public static final int TYPE_MAXINTERVAL

See Also:
  - Constant Field Values

### TYPE_AUTHTYPE

public static final int TYPE_AUTHTYPE

See Also:
  - Constant Field Values

### TYPE_LISTENER

public static final int TYPE_LISTENER

See Also:
  - Constant Field Values

### TYPE_NOTE

public static final int TYPE_NOTE

See Also:
  - Constant Field Values

### ACTION_SET

public static final int ACTION_SET

See Also:
  - Constant Field Values

### ACTION_REMOVE

public static final int ACTION_REMOVE

See Also:
  - Constant Field Values

### NAME_PRINCIPAL

public static final String NAME_PRINCIPAL

See Also:
  - Constant Field Values

### NAME_MAXINTERVAL

public static final String NAME_MAXINTERVAL

See Also:
  - Constant Field Values

### NAME_ISNEW

public static final String NAME_ISNEW

See Also:
  - Constant Field Values

### NAME_AUTHTYPE

public static final String NAME_AUTHTYPE

See Also:
  - Constant Field Values

### NAME_LISTENER

public static final String NAME_LISTENER

See Also:
  - Constant Field Values

## Constructor Details

### DeltaRequest

public DeltaRequest()

### DeltaRequest

public DeltaRequest(String sessionId, boolean recordAllActions)

## Method Details

### setAttribute

public void setAttribute(String name, Object value)

### removeAttribute

public void removeAttribute(String name)

### setNote

public void setNote(String name, Object value)

### removeNote

public void removeNote(String name)

### setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)

### setPrincipal

public void setPrincipal(Principal p)
Only support principals from type `GenericPrincipal`

Parameters:
  `p` - Session principal
See Also:
  - `GenericPrincipal`

### setNew

public void setNew(boolean n)

### setAuthType

public void setAuthType(String authType)

### addSessionListener

public void addSessionListener(SessionListener listener)

### removeSessionListener

public void removeSessionListener(SessionListener listener)

### addAction

protected void addAction(int type, int action, String name, Object value)

### execute

public void execute(DeltaSession session, boolean notifyListeners)

### reset

public void reset()

### getSessionId

public String getSessionId()

### setSessionId

public void setSessionId(String sessionId)

### getSize

public int getSize()

### clear

public void clear()

### readExternal

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

### writeExternal

public void writeExternal(ObjectOutput out) throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

### serialize

protected byte[] serialize() throws IOException
serialize DeltaRequest

Returns:
  serialized delta request
Throws:
  `IOException` - IO error serializing
See Also:
  - `writeExternal(java.io.ObjectOutput)`