net.kano.joscar.rvcmd.sendbl
Class SendBuddyListRvCmd

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

public class SendBuddyListRvCmd
extends AbstractRequestRvCmd

A rendezvous command used in sending portions of one's buddy list to another user.

Important note for implementing Send Buddy List:
The official Windows AIM client (WinAIM, as I call it) always sends a RvResponse with a code of RvResponse.CODE_NOT_ACCEPTING in response to a Send Buddy List command (this class). If this RvResponse is not sent in response to an incoming SendBuddyListRvCmd and the sender is using WinAIM, he or she will not be able to send any more Send Buddy List commands to your client until he or she restarts AIM. I do not know why this happens, but this behavior should be duplicated for maximum compatibility with other users.


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
SendBuddyListRvCmd(RecvRvIcbm icbm)
          Creates a new Send Buddy List command from the given incoming Send Buddy List RV ICBM.
SendBuddyListRvCmd(SendBuddyListGroup[] groups)
          Creates a new Send Buddy List command with the given list of buddy groups.
 
Method Summary
 SendBuddyListGroup[] getGroups()
          Returns a list of the buddy groups contained in this command.
 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, hasServiceData, 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

SendBuddyListRvCmd

public SendBuddyListRvCmd(RecvRvIcbm icbm)
Creates a new Send Buddy List command from the given incoming Send Buddy List RV ICBM.

Parameters:
icbm - an incoming Send Buddy List RV ICBM

SendBuddyListRvCmd

public SendBuddyListRvCmd(SendBuddyListGroup[] groups)
Creates a new Send Buddy List command with the given list of buddy groups.

Parameters:
groups - the list of buddy groups
Method Detail

getGroups

public final SendBuddyListGroup[] getGroups()
Returns a list of the buddy groups contained in this command. Note that this method will never return null; if no groups were sent, the returned array will simply be empty.

Returns:
a list of the buddy groups sent in this command

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

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

toString

public java.lang.String toString()