net.kano.joscar.rvcmd
Class AbstractRequestRvCmd

java.lang.Object
  extended byRvCommand
      extended byAbstractRvCmd
          extended byAbstractRequestRvCmd
Direct Known Subclasses:
AddinsReqRvCmd, ChatInvitationRvCmd, DirectIMReqRvCmd, FileSendReqRvCmd, GetFileReqRvCmd, SendBuddyIconRvCmd, SendBuddyListRvCmd, VoiceReqRvCmd

public abstract class AbstractRequestRvCmd
extends AbstractRvCmd

A base class for an RV request command. RV request commands contain a mysterious empty 0x000f TLV, a "request type" (which is almost always REQTYPE_INITIALREQUEST, and, normally, more type-specific TLV's.


Field Summary
static boolean FPRESENT_DEFAULT
          The default value of the fPresent field.
static int REQTYPE_INITIALREQUEST
          A request type indicating that a command is an initial request.
static int REQTYPE_REDIRECT
          A request type indicating that a command is a "redirection request."
 
Fields inherited from class RvCommand
RVSTATUS_ACCEPT, RVSTATUS_DENY, RVSTATUS_REQUEST
 
Constructor Summary
protected AbstractRequestRvCmd(CapabilityBlock cap)
          Creates a new outgoing initial RV request command with the given ICBM message ID, associated capability block, a request type of REQTYPE_INITIALREQUEST, and a 0x000f TLV present.
protected AbstractRequestRvCmd(CapabilityBlock cap, int requestType)
          Creates a new outgoing initial RV request command with the given associated capability block, and request type, and a 0x000f TLV present.
protected AbstractRequestRvCmd(CapabilityBlock cap, int requestType, boolean fPresent)
          Creates a new outgoing initial RV request command with the given associated capability block, and request type, and a 0x000f TLV present.
protected AbstractRequestRvCmd(RecvRvIcbm icbm)
          Creates a new RV request command from the given incoming RV request ICBM command.
 
Method Summary
 int getRequestType()
          Returns this RV request's request type value.
protected  boolean isFPresent()
          Returns whether this RV command contains the mysteroius 0x000f TLV.
protected  void writeHeaderRvTlvs(java.io.OutputStream out)
          Writes this RV command's "header TLV's" to the given stream.
 
Methods inherited from class AbstractRvCmd
getRvTlvs, getServiceData, hasServiceData, writeRvData, writeRvTlvs, writeServiceData
 
Methods inherited from class RvCommand
getCapabilityBlock, getRvStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQTYPE_INITIALREQUEST

public static final int REQTYPE_INITIALREQUEST
A request type indicating that a command is an initial request.

See Also:
Constant Field Values

REQTYPE_REDIRECT

public static final int REQTYPE_REDIRECT
A request type indicating that a command is a "redirection request." This value is used to "redirect" an initial request to, for example, a new IP address/port.

See Also:
Constant Field Values

FPRESENT_DEFAULT

public static final boolean FPRESENT_DEFAULT
The default value of the fPresent field. This value indicates that the mysterious 0x000f TLV is present in a command.

See Also:
Constant Field Values
Constructor Detail

AbstractRequestRvCmd

protected AbstractRequestRvCmd(RecvRvIcbm icbm)
Creates a new RV request command from the given incoming RV request ICBM command.

Parameters:
icbm - an incoming RV request ICBM command

AbstractRequestRvCmd

protected AbstractRequestRvCmd(CapabilityBlock cap)
Creates a new outgoing initial RV request command with the given ICBM message ID, associated capability block, a request type of REQTYPE_INITIALREQUEST, and a 0x000f TLV present. Using this constructor is equivalent to using AbstractRequestRvCmd(cap, REQTYPE_INITIALREQUEST).

Parameters:
cap - the capability block associated with this RV command

AbstractRequestRvCmd

protected AbstractRequestRvCmd(CapabilityBlock cap,
                               int requestType)
Creates a new outgoing initial RV request command with the given associated capability block, and request type, and a 0x000f TLV present. Using this constructor is equivalent to using AbstractRequestRvCmd(cap, REQTYPE_INITIALREQUEST, FPRESENT_DEFAULT).

Parameters:
cap - the capability block associated with this RV command
requestType - a request type, like REQTYPE_INITIALREQUEST

AbstractRequestRvCmd

protected AbstractRequestRvCmd(CapabilityBlock cap,
                               int requestType,
                               boolean fPresent)
Creates a new outgoing initial RV request command with the given associated capability block, and request type, and a 0x000f TLV present. Using this constructor is equivalent to using AbstractRequestRvCmd(cap, REQTYPE_INITIALREQUEST, FPRESENT_DEFAULT).

Parameters:
cap - the capability block associated with this RV command
requestType - a request type, like REQTYPE_INITIALREQUEST
fPresent - whether this command should contain the mysterious type 0x000f TLV
Method Detail

getRequestType

public final int getRequestType()
Returns this RV request's request type value. Will normally be one of REQTYPE_INITIALREQUEST and REQTYPE_REDIRECT.

Returns:
the type of this RV request

isFPresent

protected final boolean isFPresent()
Returns whether this RV command contains the mysteroius 0x000f TLV. The significance of said TLV is unknown as of this writing.

Returns:
true if this RV command contains the mysterious 0x000f TLV; false otherwise

writeHeaderRvTlvs

protected final void writeHeaderRvTlvs(java.io.OutputStream out)
                                throws java.io.IOException
Description copied from class: AbstractRvCmd
Writes this RV command's "header TLV's" to the given stream. This method will always be called prior to any call to AbstractRvCmd.writeRvTlvs(java.io.OutputStream); it provides a means for subclasses to write a set of TLV's that are present in all subclasses.

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