net.kano.joscar.rvcmd.voice
Class VoiceReqRvCmd

java.lang.Object
  extended byRvCommand
      extended byAbstractRvCmd
          extended byAbstractRequestRvCmd
              extended byVoiceReqRvCmd

public class VoiceReqRvCmd
extends AbstractRequestRvCmd

A rendezvous command used to request a voice chat session.


Field Summary
static long VERSION_DEFAULT
          The voice chat protocol version used by WinAIM.
 
Fields inherited from class AbstractRequestRvCmd
FPRESENT_DEFAULT, REQTYPE_INITIALREQUEST, REQTYPE_REDIRECT
 
Fields inherited from class RvCommand
RVSTATUS_ACCEPT, RVSTATUS_DENY, RVSTATUS_REQUEST
 
Constructor Summary
VoiceReqRvCmd(long version, RvConnectionInfo connInfo)
          Creates a new outgoing voice chat request with the given protocol version and the given connection information block.
VoiceReqRvCmd(RecvRvIcbm icbm)
          Creates a new voice chat request command from the given incoming voice chat request RV ICBM.
VoiceReqRvCmd(RvConnectionInfo connInfo)
          Creates a new outgoing voice chat request with the given connection information block and a protocol version number of VERSION_DEFAULT.
 
Method Summary
 RvConnectionInfo getConnInfo()
          Returns the connection information block sent in this command.
 long getVersion()
          Returns the voice chat protocol version sent in this command, or -1 if none was sent.
protected  boolean hasServiceData()
          Returns whether this RV command's TLV list should contain a "service data block" TLV.
 java.lang.String toString()
           
protected  void writeRvTlvs(java.io.OutputStream out)
          Writes this RV command's list of rendezvous TLV's to the given stream.
protected  void writeServiceData(java.io.OutputStream out)
          Writes this RV command's "service data block."
 
Methods inherited from class AbstractRequestRvCmd
getRequestType, isFPresent, writeHeaderRvTlvs
 
Methods inherited from class AbstractRvCmd
getRvTlvs, getServiceData, writeRvData
 
Methods inherited from class RvCommand
getCapabilityBlock, getRvStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION_DEFAULT

public static final long VERSION_DEFAULT
The voice chat protocol version used by WinAIM.

See Also:
Constant Field Values
Constructor Detail

VoiceReqRvCmd

public VoiceReqRvCmd(RecvRvIcbm icbm)
Creates a new voice chat request command from the given incoming voice chat request RV ICBM.

Parameters:
icbm - an incoming voice chat request RV ICBM command

VoiceReqRvCmd

public VoiceReqRvCmd(RvConnectionInfo connInfo)
Creates a new outgoing voice chat request with the given connection information block and a protocol version number of VERSION_DEFAULT.

Using this constructor is equivalent to using new VoiceReqRvCmd(VERSION_DEFAULT, connInfo).

Parameters:
connInfo - a block of connection information

VoiceReqRvCmd

public VoiceReqRvCmd(long version,
                     RvConnectionInfo connInfo)
Creates a new outgoing voice chat request with the given protocol version and the given connection information block.

Parameters:
version - a protocol version; normally VERSION_DEFAULT
connInfo - a connection information block, or null to not send any connection information in this command
Method Detail

getVersion

public final long getVersion()
Returns the voice chat protocol version sent in this command, or -1 if none was sent. This value is normally VERSION_DEFAULT.

Returns:
the voice chat protocol version sent in this command, or -1 if none was sent

getConnInfo

public final RvConnectionInfo getConnInfo()
Returns the connection information block sent in this command. Note that this method will never return null; the returned object's fields will simply be empty if no connection information information was sent.

Returns:
an object containing the connection information sent in this command

writeRvTlvs

protected void writeRvTlvs(java.io.OutputStream out)
                    throws java.io.IOException
Description copied from class: AbstractRvCmd
Writes this RV command's list of rendezvous TLV's to the given stream.

Specified by:
writeRvTlvs in class AbstractRvCmd
Parameters:
out - the stream to which to write
Throws:
java.io.IOException - if an I/O error occurs

hasServiceData

protected boolean hasServiceData()
Description copied from class: AbstractRvCmd
Returns whether this RV command's TLV list should contain a "service data block" TLV. The return value of this method must be consistent throughout this object's existence. Note that if this method returns false for an object, writeServiceData will never be called on that object. The default implementation of this method returns true.

Overrides:
hasServiceData in class AbstractRvCmd
Returns:
whether or not this RV command has a "service data block"
See Also:
AbstractRvCmd.writeServiceData(java.io.OutputStream)

writeServiceData

protected void writeServiceData(java.io.OutputStream out)
                         throws java.io.IOException
Description copied from class: AbstractRvCmd
Writes this RV command's "service data block." A service data block's format changes from rendezvous to rendezvous, but generally provides information specific to the type of rendezvous being sent. For example, in a file transfer request, the file's name and size (among other fields) are sent in the service block. This method will never be called if AbstractRvCmd.hasServiceData() returns false. The default implementation of this method does not write any data to the stream.

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

toString

public java.lang.String toString()