net.kano.joscar.snaccmd.invite
Class InviteFriendCmd

java.lang.Object
  extended bySnacCommand
      extended byInviteCommand
          extended byInviteFriendCmd

public class InviteFriendCmd
extends InviteCommand

A SNAC command used to request that AOL send an email to someone to invite him or her to join AIM. Normally responded-to with an InviteFriendAck.

Source of this SNAC:
AIM client
SNAC command type:
Family 0x06, command 0x02

Field Summary
 
Fields inherited from class InviteCommand
CMD_INVITE_ACK, CMD_INVITE_FRIEND, FAMILY_INFO, FAMILY_INVITE
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected InviteFriendCmd(SnacPacket packet)
          Generates a new invite-a-friend command from the given incoming SNAC packet.
  InviteFriendCmd(java.lang.String email, java.lang.String message)
          Creates a new outgoing invite-a-friend request to the given email address and with the given invitation message.
 
Method Summary
 java.lang.String getEmail()
          Returns the email address to whom an invitation should be sent.
 java.lang.String getMessage()
          Returns an "invitation message" to include in the invitation.
 java.lang.String toString()
           
 void writeData(java.io.OutputStream out)
          Writes this command's SNAC data block to the given stream.
 
Methods inherited from class SnacCommand
getCommand, getFamily, getFlag1, getFlag2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InviteFriendCmd

protected InviteFriendCmd(SnacPacket packet)
Generates a new invite-a-friend command from the given incoming SNAC packet.

Parameters:
packet - an incoming invite-a-friend packet

InviteFriendCmd

public InviteFriendCmd(java.lang.String email,
                       java.lang.String message)
Creates a new outgoing invite-a-friend request to the given email address and with the given invitation message.

Parameters:
email - the email address of the person to whom the invitation should be sent
message - a message, like "HAY JOIN AIMZ D00D"
Method Detail

getEmail

public final java.lang.String getEmail()
Returns the email address to whom an invitation should be sent.

Returns:
the email address to whom an invitatoin should be sent

getMessage

public final java.lang.String getMessage()
Returns an "invitation message" to include in the invitation.

Returns:
the invitation message to send

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: SnacCommand
Writes this command's SNAC data block to the given stream. The SNAC data block is the data after the first ten bytes of a SNAC packet.

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

toString

public java.lang.String toString()