net.kano.joscar.rvproto.rvproxy
Class RvProxyCmd

java.lang.Object
  extended byRvProxyCmd
Direct Known Subclasses:
RvProxyAckCmd, RvProxyErrorCmd, RvProxyInitRecvCmd, RvProxyInitSendCmd, RvProxyReadyCmd

public abstract class RvProxyCmd
extends java.lang.Object

Represents a single AOL Proxy protocol command to be sent over an AOL Proxy Server connection.

See Also:
RvProxyPacket

Constructor Summary
protected RvProxyCmd(int cmdType)
          Creates a new outgoing server-bound RV proxy command with the given command type, a packet version of RvProxyPacket.PACKETVERSION_DEFAULT, and a flag set containing RvProxyPacket.FLAGS_DEFAULT_FROM_CLIENT.
protected RvProxyCmd(int cmdType, int flags)
          Creates a new outgoing RV proxy command with the given command type and bit flags.
protected RvProxyCmd(int packetVersion, int cmdType, int flags)
          Creates a new outgoing RV proxy command with the given command type, bit flags, and packet version.
protected RvProxyCmd(RvProxyPacket packet)
          Creates a new RV proxy command with properties read from the given incoming RV proxy packet.
 
Method Summary
 int getCommandType()
          Returns this RV proxy command's command type code.
 int getFlags()
          Returns this RV proxy command's set of bit flags.
 int getPacketVersion()
          Returns this RV proxy command's "packet version" value.
abstract  void writeCommandData(java.io.OutputStream out)
          Writes this command's raw "command-specific data" to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RvProxyCmd

protected RvProxyCmd(RvProxyPacket packet)
Creates a new RV proxy command with properties read from the given incoming RV proxy packet.

Parameters:
packet - an incoming RV proxy packet

RvProxyCmd

protected RvProxyCmd(int cmdType)
Creates a new outgoing server-bound RV proxy command with the given command type, a packet version of RvProxyPacket.PACKETVERSION_DEFAULT, and a flag set containing RvProxyPacket.FLAGS_DEFAULT_FROM_CLIENT.

Parameters:
cmdType - a RV proxy command type for this command, like RvProxyPacket.CMDTYPE_INIT_SEND

RvProxyCmd

protected RvProxyCmd(int cmdType,
                     int flags)
Creates a new outgoing RV proxy command with the given command type and bit flags. The packet version value will be set to RvProxyPacket.PACKETVERSION_DEFAULT}.

Parameters:
cmdType - a RV proxy command type for this command, like RvProxyPacket.CMDTYPE_INIT_SEND
flags - a set of bit flags, like RvProxyPacket.FLAGS_DEFAULT_FROM_CLIENT

RvProxyCmd

protected RvProxyCmd(int packetVersion,
                     int cmdType,
                     int flags)
Creates a new outgoing RV proxy command with the given command type, bit flags, and packet version.

Parameters:
packetVersion - a "packet version" value for this command; should normally be RvProxyPacket.PACKETVERSION_DEFAULT
cmdType - a RV proxy command type for this command, like RvProxyPacket.CMDTYPE_INIT_SEND
flags - a set of bit flags, like RvProxyPacket.FLAGS_DEFAULT_FROM_CLIENT
Method Detail

getPacketVersion

public final int getPacketVersion()
Returns this RV proxy command's "packet version" value. This will normally be RvProxyPacket.PACKETVERSION_DEFAULT.

Returns:
this RV proxy command's "packet version" value

getCommandType

public final int getCommandType()
Returns this RV proxy command's command type code. This value will normally be one of RvProxyPacket's CMDTYPE_* constants.

Returns:
this command's RV proxy command type code

getFlags

public final int getFlags()
Returns this RV proxy command's set of bit flags. This value will normally contain either RvProxyPacket.FLAGS_DEFAULT_FROM_CLIENT or RvProxyPacket.FLAGS_DEFAULT_FROM_SERVER.

Returns:
this command's set of RV proxy command bit flags

writeCommandData

public abstract void writeCommandData(java.io.OutputStream out)
                               throws java.io.IOException
Writes this command's raw "command-specific data" to the given stream.

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