net.kano.joscar.rvcmd.chatinvite
Class ChatInvitationRvCmd

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

public class ChatInvitationRvCmd
extends AbstractRequestRvCmd

A rendezvous command used to invite a user to a ("secure" or normal) chat room.


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
ChatInvitationRvCmd(MiniRoomInfo roomInfo, InvitationMessage message)
          Creates a new outgoing chat room invitation command for the room described in the given block and with the given invitation message.
ChatInvitationRvCmd(MiniRoomInfo roomInfo, InvitationMessage message, ByteBlock securityInfo)
          Creates a new outgoing chat room invitation command for the room described in the given block and with the given invitation message.
ChatInvitationRvCmd(RecvRvIcbm icbm)
          Creates a new chat room invitation RV command from the given incoming chat room invitation RV ICBM command.
 
Method Summary
 InvitationMessage getInvMessage()
          Returns the invitation message, if any, included in this invitation.
 MiniRoomInfo getRoomInfo()
          Returns the room information block describing the chat room to which the recipient is being invited.
 ByteBlock getSecurityInfo()
          Returns the block of security information sent in this chat room invitation, if any.
 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

ChatInvitationRvCmd

public ChatInvitationRvCmd(RecvRvIcbm icbm)
Creates a new chat room invitation RV command from the given incoming chat room invitation RV ICBM command.

Parameters:
icbm - an incoming chat room invitation rendezvous ICBM command

ChatInvitationRvCmd

public ChatInvitationRvCmd(MiniRoomInfo roomInfo,
                           InvitationMessage message)
Creates a new outgoing chat room invitation command for the room described in the given block and with the given invitation message. Note that if message is null, no invitation message will be sent with this invitation.

Note that the object passed as the roomInfo argument should be retrieved from the server's RoomResponse command's room information block (although the same information is provided in other places as well). See RoomResponse.getRoomInfo() and MiniRoomInfo.MiniRoomInfo(net.kano.joscar.snaccmd.FullRoomInfo) for details.

Parameters:
roomInfo - a room information block describing the chat room to which the recipient is being invited
message - an invitation message to send with this invitation, or null for none
See Also:
RoomResponse

ChatInvitationRvCmd

public ChatInvitationRvCmd(MiniRoomInfo roomInfo,
                           InvitationMessage message,
                           ByteBlock securityInfo)
Creates a new outgoing chat room invitation command for the room described in the given block and with the given invitation message. Note that if message is null, no invitation message will be sent with this invitation.

Note that the object passed as the roomInfo argument should be retrieved from the server's RoomResponse command's room information block (although the same information is provided in other places as well). See RoomResponse.getRoomInfo() and MiniRoomInfo.MiniRoomInfo(net.kano.joscar.snaccmd.FullRoomInfo) for details.

Parameters:
roomInfo - a room information block describing the chat room to which the recipient is being invited
message - an invitation message to send with this invitation, or null for none
securityInfo - a block of secure chat room information
See Also:
RoomResponse
Method Detail

getInvMessage

public final InvitationMessage getInvMessage()
Returns the invitation message, if any, included in this invitation.

Returns:
the invitation message sent in this invitation, or null if none was included

getSecurityInfo

public final ByteBlock getSecurityInfo()
Returns the block of security information sent in this chat room invitation, if any.

Returns:
the block of security information associated with the chat room to which the recipient is being invited

getRoomInfo

public final MiniRoomInfo getRoomInfo()
Returns the room information block describing the chat room to which the recipient is being invited. The returned room information block can be passed directly to a service request. Note that this method will return null if, for some reason, no room information block was sent. (This is, however, not normal behavior.)

Returns:
a chat room information block describing the chat room to which the recipient of this invitation is being invited (or null if none was sent)

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

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