org.caleigo.toolkit.tunnel
Class AbstractTunnel.DefaultPackage

java.lang.Object
  extended byorg.caleigo.toolkit.tunnel.AbstractTunnel.DefaultPackage
All Implemented Interfaces:
AbstractTunnel.IPackage, java.io.Serializable
Enclosing class:
AbstractTunnel

public static class AbstractTunnel.DefaultPackage
extends java.lang.Object
implements AbstractTunnel.IPackage

See Also:
Serialized Form

Field Summary
protected  int mID
           
protected  java.lang.Object mMessage
           
protected  int mOriginID
           
protected  int mSessionID
           
protected  int mType
           
 
Fields inherited from interface org.caleigo.toolkit.tunnel.AbstractTunnel.IPackage
DATA, ERROR, INFO, PING, REPLY, REQUEST
 
Constructor Summary
AbstractTunnel.DefaultPackage(int ID, int originID, int type, java.lang.Object message, int sessionID)
           
AbstractTunnel.DefaultPackage(int ID, java.lang.Object message, int sessionID)
           
 
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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mID

protected int mID

mOriginID

protected int mOriginID

mType

protected int mType

mMessage

protected java.lang.Object mMessage

mSessionID

protected int mSessionID
Constructor Detail

AbstractTunnel.DefaultPackage

public AbstractTunnel.DefaultPackage(int ID,
                                     java.lang.Object message,
                                     int sessionID)

AbstractTunnel.DefaultPackage

public AbstractTunnel.DefaultPackage(int ID,
                                     int originID,
                                     int type,
                                     java.lang.Object message,
                                     int sessionID)
Method Detail

toString

public java.lang.String toString()

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.

Specified by:
getID in interface AbstractTunnel.IPackage

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.

Specified by:
getOriginID in interface AbstractTunnel.IPackage

setOriginID

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

Specified by:
setOriginID in interface AbstractTunnel.IPackage

getType

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

Specified by:
getType in interface AbstractTunnel.IPackage

setType

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

Specified by:
setType in interface AbstractTunnel.IPackage

getMessage

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

Specified by:
getMessage in interface AbstractTunnel.IPackage

getSessionID

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

Specified by:
getSessionID in interface AbstractTunnel.IPackage


Copyright © 2005 Caleigo. All Rights Reserved.