org.caleigo.toolkit.tunnel
Interface AbstractTunnel.IPackage

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractTunnel.DefaultPackage
Enclosing interface:
AbstractTunnel

public static interface AbstractTunnel.IPackage
extends java.io.Serializable

An IPackage represents a package that is sent by an ITunnel. It encapsulates the actual message and provides extra information needed by the ITunnel.


Field Summary
static int DATA
           
static int ERROR
           
static int INFO
           
static int PING
           
static int REPLY
           
static int REQUEST
           
 
Method Summary
 int getID()
          Returns the unique package ID for this package.
 java.lang.Object getMessage()
          Returns the encapsulated message.
 int getOriginID()
          If this IPackage is the reply to a request message, the ID of the request IPackage is returned.
 int getSessionID()
          Returns the session id that should be used by the server to find the session to use.
 int getType()
          Returns the type of this IPackage.
 void setOriginID(int originID)
          Sets the origin id of this IPackage.
 void setType(int type)
          Sets the type of this IPackage.
 

Field Detail

PING

public static final int PING
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

REQUEST

public static final int REQUEST
See Also:
Constant Field Values

REPLY

public static final int REPLY
See Also:
Constant Field Values

DATA

public static final int DATA
See Also:
Constant Field Values
Method Detail

getID

public int getID()
Returns the unique package ID for this package. The ID must be unique within the ITunnels that are used to send this package. IDs must be positive integers.


getOriginID

public int getOriginID()
If this IPackage is the reply to a request message, the ID of the request IPackage is returned. Otherwise -1 is returned.


setOriginID

public void setOriginID(int originID)
Sets the origin id of this IPackage.


getType

public int getType()
Returns the type of this IPackage.


setType

public void setType(int type)
Sets the type of this IPackage.


getMessage

public java.lang.Object getMessage()
Returns the encapsulated message.


getSessionID

public int getSessionID()
Returns the session id that should be used by the server to find the session to use.



Copyright © 2005 Caleigo. All Rights Reserved.