DRCL JavaSim API

drcl.inet.socket
Class SocketContract.Message

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.comp.Message
              |
              +--drcl.inet.socket.SocketContract.Message
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, java.io.Serializable
Enclosing class:
SocketContract

public static class SocketContract.Message
extends Message

See Also:
Serialized Form

Constructor Summary
SocketContract.Message()
           
SocketContract.Message(int connectionID_)
          Creates a CLOSE request.
SocketContract.Message(int connectionID_, long remoteAddr_, int remotePort_, Port tcpPort_)
          Creates an ACCEPT_REPLY.
SocketContract.Message(int connectionID_, Port tcpPort_)
          Creates an CONNECT_REPLY.
SocketContract.Message(long localAddr_, int localPort_)
          Creates an ACCEPT request.
SocketContract.Message(long remoteAddr_, int remotePort_, long localAddr_, int localPort_)
          Creates a CONNECT request.
SocketContract.Message(java.lang.String error_)
          Creates an ERROR message.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this object.
 void duplicate(java.lang.Object source_)
          opies the content of the source_ object to this object.
 int getConnectionID()
           
 Contract getContract()
          Returns the associated contract of this message.
 java.lang.String getError()
           
 long getLocalAddr()
           
 int getLocalPort()
           
 Port getPort()
           
 long getRemoteAddr()
           
 int getRemotePort()
           
 int getType()
           
 boolean isAccept()
           
 boolean isAcceptReply()
           
 boolean isClose()
           
 boolean isConnect()
           
 boolean isConnectReply()
           
 boolean isError()
           
 void setLocalPort(int localPort_)
           
 java.lang.String toString(java.lang.String separator_)
          Prints the content of the message by separating each field with the separator string.
 
Methods inherited from class drcl.comp.Message
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketContract.Message

public SocketContract.Message()

SocketContract.Message

public SocketContract.Message(java.lang.String error_)
Creates an ERROR message.

SocketContract.Message

public SocketContract.Message(int connectionID_)
Creates a CLOSE request.

SocketContract.Message

public SocketContract.Message(long localAddr_,
                              int localPort_)
Creates an ACCEPT request.

SocketContract.Message

public SocketContract.Message(int connectionID_,
                              long remoteAddr_,
                              int remotePort_,
                              Port tcpPort_)
Creates an ACCEPT_REPLY.

SocketContract.Message

public SocketContract.Message(long remoteAddr_,
                              int remotePort_,
                              long localAddr_,
                              int localPort_)
Creates a CONNECT request.

SocketContract.Message

public SocketContract.Message(int connectionID_,
                              Port tcpPort_)
Creates an CONNECT_REPLY.
Method Detail

getConnectionID

public int getConnectionID()

getLocalAddr

public long getLocalAddr()

getLocalPort

public int getLocalPort()

setLocalPort

public void setLocalPort(int localPort_)

getRemoteAddr

public long getRemoteAddr()

getRemotePort

public int getRemotePort()

getPort

public Port getPort()

getError

public java.lang.String getError()

isAccept

public boolean isAccept()

isAcceptReply

public boolean isAcceptReply()

isConnect

public boolean isConnect()

isConnectReply

public boolean isConnectReply()

isClose

public boolean isClose()

isError

public boolean isError()

getType

public int getType()

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: DrclObj
opies the content of the source_ object to this object. he subclass must implement this method to realize DrclObj.clone().
Overrides:
duplicate in class DrclObj

clone

public java.lang.Object clone()
Description copied from class: DrclObj
Returns a clone of this object. By default, this method creates an object of the same class and calls DrclObj.duplicate(Object) to duplicate the content of this object to the newly-created one.

This method uses getClass().newInstance() to create new instance. Hence, subclasses need to override this method only if the subclass is not declared as public or does not have explicit no-argument constructor. A subclass may override this method for performance reason.

Overrides:
clone in class DrclObj

getContract

public Contract getContract()
Description copied from class: Message
Returns the associated contract of this message.
Overrides:
getContract in class Message

toString

public java.lang.String toString(java.lang.String separator_)
Description copied from class: Message
Prints the content of the message by separating each field with the separator string.
Overrides:
toString in class Message

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~