net.kano.joscar.rvcmd
Class AbstractAcceptRvCmd

java.lang.Object
  extended byRvCommand
      extended byAbstractRvCmd
          extended byAbstractAcceptRvCmd
Direct Known Subclasses:
AddinsAcceptRvCmd, DirectIMAcceptRvCmd, FileSendAcceptRvCmd, GetFileAcceptRvCmd, VoiceAcceptRvCmd

public abstract class AbstractAcceptRvCmd
extends AbstractRvCmd

A base class for "acceptance" rendezvous commands, or commands with no RV data and a status code of RvCommand.RVSTATUS_ACCEPT.


Field Summary
 
Fields inherited from class RvCommand
RVSTATUS_ACCEPT, RVSTATUS_DENY, RVSTATUS_REQUEST
 
Constructor Summary
protected AbstractAcceptRvCmd(CapabilityBlock cap)
          Creates a new outgoing RV "accept" command for an unencrypted rendezvous with the given associated capability block.
protected AbstractAcceptRvCmd(CapabilityBlock cap, boolean encrypted)
          Creates a new outgoing RV "accept" command with the given associated capability block.
protected AbstractAcceptRvCmd(RecvRvIcbm icbm)
          Creates a new RV "accept" command from the given incoming acceptance RV ICBM.
 
Method Summary
 boolean isEncrypted()
          Returns whether the rendezvous being accepted is encrypted ("secure").
 java.lang.String toString()
           
protected  void writeHeaderRvTlvs(java.io.OutputStream out)
          Writes this RV command's "header TLV's" to the given stream.
protected  void writeRvTlvs(java.io.OutputStream out)
          Provides a default implementation for writing this command's RV TLV's.
 
Methods inherited from class AbstractRvCmd
getRvTlvs, getServiceData, hasServiceData, writeRvData, writeServiceData
 
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

AbstractAcceptRvCmd

protected AbstractAcceptRvCmd(RecvRvIcbm icbm)
Creates a new RV "accept" command from the given incoming acceptance RV ICBM.

Parameters:
icbm - an incoming "acceptance" RV ICBM

AbstractAcceptRvCmd

protected AbstractAcceptRvCmd(CapabilityBlock cap)
Creates a new outgoing RV "accept" command for an unencrypted rendezvous with the given associated capability block. Using this constructor is equivalent to using AbstractAcceptRvCmd(cap, false).

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

AbstractAcceptRvCmd

protected AbstractAcceptRvCmd(CapabilityBlock cap,
                              boolean encrypted)
Creates a new outgoing RV "accept" command with the given associated capability block. If encrypted is true, this acceptance RV command will indicate that a "secure" or "encrypted" rendezvous is being accepted (such as a secure file transfer).

Parameters:
cap - the capability block associated with this RV command
encrypted - whether the rendezvous being accepted is a secure rendezvous
Method Detail

isEncrypted

public final boolean isEncrypted()
Returns whether the rendezvous being accepted is encrypted ("secure").

Returns:
whether the rendezvous being accepted is a secure rendezvous

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

writeRvTlvs

protected void writeRvTlvs(java.io.OutputStream out)
                    throws java.io.IOException
Provides a default implementation for writing this command's RV TLV's. This implementation does not write any TLV's to the given stream (as most acceptance RV commands contain no TLV's).

Specified by:
writeRvTlvs 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()