org.apache.derby.impl.services.net
Class NetworkPayload

java.lang.Object
  extended byorg.apache.derby.impl.services.net.NetworkPayload
All Implemented Interfaces:
java.io.Serializable

public class NetworkPayload
extends java.lang.Object
implements java.io.Serializable

A class representing a network payload to be sent using the LogicalServer and LogicalClient. Contains a payload and a type-id. After a NetworkPayload has been created it is read-only to ensure safety and security in the network protocol

Author:
Egil S¿rensen
See Also:
Serialized Form

Field Summary
static int TYPE_2PC_COMMIT_ACK
           
static int TYPE_2PC_DOCOMMIT
           
static int TYPE_2PC_PREP
           
static int TYPE_2PC_VOTE_ABORT
           
static int TYPE_2PC_VOTE_COMMIT
           
static int TYPE_ACK
           
static int TYPE_ERROR
           
static int TYPE_IMALIVE
           
static int TYPE_LOG
           
static int TYPE_LSN_REQUEST
           
static int TYPE_LSN_RESPONSE
           
static int TYPE_MESSAGE_STRING
           
static int TYPE_WAIT
           
 
Constructor Summary
NetworkPayload(int type, java.lang.Object payload)
          Constructor used to set the type and payload
 
Method Summary
 java.lang.Object getPayload()
          Get the object payload
 int getType()
          Get the type of this NetworkPayload
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_LOG

public static final int TYPE_LOG
See Also:
Constant Field Values

TYPE_ACK

public static final int TYPE_ACK
See Also:
Constant Field Values

TYPE_2PC_PREP

public static final int TYPE_2PC_PREP
See Also:
Constant Field Values

TYPE_2PC_VOTE_COMMIT

public static final int TYPE_2PC_VOTE_COMMIT
See Also:
Constant Field Values

TYPE_2PC_VOTE_ABORT

public static final int TYPE_2PC_VOTE_ABORT
See Also:
Constant Field Values

TYPE_2PC_DOCOMMIT

public static final int TYPE_2PC_DOCOMMIT
See Also:
Constant Field Values

TYPE_2PC_COMMIT_ACK

public static final int TYPE_2PC_COMMIT_ACK
See Also:
Constant Field Values

TYPE_IMALIVE

public static final int TYPE_IMALIVE
See Also:
Constant Field Values

TYPE_MESSAGE_STRING

public static final int TYPE_MESSAGE_STRING
See Also:
Constant Field Values

TYPE_LSN_REQUEST

public static final int TYPE_LSN_REQUEST
See Also:
Constant Field Values

TYPE_LSN_RESPONSE

public static final int TYPE_LSN_RESPONSE
See Also:
Constant Field Values

TYPE_ERROR

public static final int TYPE_ERROR
See Also:
Constant Field Values

TYPE_WAIT

public static final int TYPE_WAIT
See Also:
Constant Field Values
Constructor Detail

NetworkPayload

public NetworkPayload(int type,
                      java.lang.Object payload)
Constructor used to set the type and payload

Parameters:
type - The type of this payload. Must be one of the constants of this class
payload - The payload. Can be any object
Method Detail

getPayload

public java.lang.Object getPayload()
Get the object payload

Returns:
The object contained in the payload

getType

public int getType()
Get the type of this NetworkPayload

Returns:
The type