net.kano.joscar.rvcmd.directim
Class DirectIMReqRvCmd

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

public class DirectIMReqRvCmd
extends AbstractRequestRvCmd

A rendezvous command used to request or redirect a Direct IM ("IM Image") session. Note that this command may be sent multiple times during a session to use multiple redirects (until one works).

See Also:
net.kano.joscar.rvproto.directim

Field Summary
 
Fields inherited from class AbstractRequestRvCmd
FPRESENT_DEFAULT, REQTYPE_INITIALREQUEST, REQTYPE_REDIRECT
 
Fields inherited from class RvCommand
RVSTATUS_ACCEPT, RVSTATUS_DENY, RVSTATUS_REQUEST
 
Constructor Summary
DirectIMReqRvCmd(int requestType, RvConnectionInfo connInfo)
          Creates a new outgoing direct IM request / redirect (depending on the value of requestType) with the given connection information.
DirectIMReqRvCmd(RecvRvIcbm icbm)
          Creates a new direct IM request RV command from the given incoming direct IM request RV ICBM.
DirectIMReqRvCmd(RvConnectionInfo connInfo)
          Creates a new outgoing initial direct IM request.
 
Method Summary
 RvConnectionInfo getConnInfo()
          Returns the connection information sent in this request.
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
 

Constructor Detail

DirectIMReqRvCmd

public DirectIMReqRvCmd(RecvRvIcbm icbm)
Creates a new direct IM request RV command from the given incoming direct IM request RV ICBM.

Parameters:
icbm - an incoming direct IM request RV ICBM command

DirectIMReqRvCmd

public DirectIMReqRvCmd(RvConnectionInfo connInfo)
Creates a new outgoing initial direct IM request. That is, an outgoing direct IM request RV command with a request type of AbstractRequestRvCmd.REQTYPE_INITIALREQUEST.

Parameters:
connInfo - a connection information block describing the connection to be made

DirectIMReqRvCmd

public DirectIMReqRvCmd(int requestType,
                        RvConnectionInfo connInfo)
Creates a new outgoing direct IM request / redirect (depending on the value of requestType) with the given connection information.

Parameters:
requestType - the "request type" for this command, like AbstractRequestRvCmd.REQTYPE_REDIRECT
connInfo - a connection information block describing the connection to be made
Method Detail

getConnInfo

public final RvConnectionInfo getConnInfo()
Returns the connection information sent in this request.

Returns:
this request's connection information block

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()