net.kano.joscar.snaccmd.icbm
Class RvCommand

java.lang.Object
  extended byRvCommand
Direct Known Subclasses:
AbstractRvCmd, AbstractTrillianCryptRvCmd

public abstract class RvCommand
extends java.lang.Object

Represents a single "rendezvous command." Rendezvous commands can be used in sending SendRvIcbms, and with the help of net.kano.joscar.rv can easily be generated from incoming RecvRvIcbms.


Field Summary
static int RVSTATUS_ACCEPT
          A status code indicating that a rendezvous has been accepted.
static int RVSTATUS_DENY
          A status code indicating that a rendezvous has been rejected or cancelled.
static int RVSTATUS_REQUEST
          A status code indicating that a rendezvous is a request.
 
Constructor Summary
protected RvCommand(int rvStatus, CapabilityBlock cap)
          Creates a new outgoing RvCommand with the given properties.
protected RvCommand(RecvRvIcbm icbm)
          Creates a new RvCommand with properties read from the given incoming RecvRvIcbm.
 
Method Summary
 CapabilityBlock getCapabilityBlock()
          Returns this RV command's capability block ("rendezvous type").
 int getRvStatus()
          Returns the status code for this RV command.
abstract  void writeRvData(java.io.OutputStream out)
          Writes this RV command's "rendezvous data block" to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RVSTATUS_REQUEST

public static final int RVSTATUS_REQUEST
A status code indicating that a rendezvous is a request. Simply a shortcut for AbstractRvIcbm.RVSTATUS_ACCEPT.

See Also:
Constant Field Values

RVSTATUS_ACCEPT

public static final int RVSTATUS_ACCEPT
A status code indicating that a rendezvous has been accepted. Simply a shortcut for AbstractRvIcbm.RVSTATUS_ACCEPT.

See Also:
Constant Field Values

RVSTATUS_DENY

public static final int RVSTATUS_DENY
A status code indicating that a rendezvous has been rejected or cancelled. Simply a shortcut for AbstractRvIcbm.RVSTATUS_DENY.

See Also:
Constant Field Values
Constructor Detail

RvCommand

protected RvCommand(RecvRvIcbm icbm)
Creates a new RvCommand with properties read from the given incoming RecvRvIcbm.

Parameters:
icbm - an incoming RV ICBM command

RvCommand

protected RvCommand(int rvStatus,
                    CapabilityBlock cap)
Creates a new outgoing RvCommand with the given properties.

Parameters:
rvStatus - a rendezvous status code, like RVSTATUS_ACCEPT
cap - a capability block ("rendezvous type") associated with this rendezvous command
Method Detail

getRvStatus

public final int getRvStatus()
Returns the status code for this RV command. Normally one of RVSTATUS_REQUEST, RVSTATUS_ACCEPT, and RVSTATUS_DENY.

Returns:
this RV command's status code

getCapabilityBlock

public final CapabilityBlock getCapabilityBlock()
Returns this RV command's capability block ("rendezvous type").

Returns:
this RV command's associated capability block ("RV type")

writeRvData

public abstract void writeRvData(java.io.OutputStream out)
                          throws java.io.IOException
Writes this RV command's "rendezvous data block" to the given stream.

Parameters:
out - the stream to which to write
Throws:
java.io.IOException - if an I/O error occurs