net.kano.joscar.snaccmd.acct
Class AcctModCmd

java.lang.Object
  extended bySnacCommand
      extended byAcctCommand
          extended byAcctModCmd

public class AcctModCmd
extends AcctCommand

A SNAC command used to modify the formatting of one's screenname or to change one's registered email address.

See Also:
AcctModAck
Source of this SNAC:
AIM client
SNAC command type:
Family 0x07, command 0x04

Field Summary
static int REGSTATUS_FULL
          A registration status visibility code indicating that users who know one's email address can find out "My screenname."
static int REGSTATUS_NONE
          A registration status visibility code indicating that users who know one's email address can find out "Nothing about me."
static int REGSTATUS_PARTIAL
          A registration status visibility code indicating that users who know one's email address can find out "Only that I have an account."
 
Fields inherited from class AcctCommand
CMD_ACCT_MOD, CMD_CONFIRM, CMD_CONFIRM_ACK, CMD_INFO_REQ, CMD_INFO_RESP, CMD_MOD_ACK, FAMILY_ACCT, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  AcctModCmd(int regstatus)
          Creates an outgoing account modification command that sets the user's registration visibility status to the given value.
protected AcctModCmd(SnacPacket packet)
          Generates an account modification command object from the given incoming SNAC packet.
  AcctModCmd(java.lang.String sn, java.lang.String email)
          Creates an outgoing account modification command that sets the user's screenname format and/or email address to the given values.
  AcctModCmd(java.lang.String sn, java.lang.String email, int regstatus)
          Creates an outgoing account modification command that sets the given screenname and/or registered email address.
 
Method Summary
 java.lang.String getEmail()
          Returns the new registered email address requested by this command, or null if that field was not sent.
 int getRegVisStatus()
          Returns the registration visibility status code stored in this account modification command, or -1 if this value is not to be modified.
 java.lang.String getScreenname()
          Returns the new screen name format requested in this command, or null if that field was not sent.
 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
 

Field Detail

REGSTATUS_NONE

public static final int REGSTATUS_NONE
A registration status visibility code indicating that users who know one's email address can find out "Nothing about me."

See Also:
Constant Field Values

REGSTATUS_PARTIAL

public static final int REGSTATUS_PARTIAL
A registration status visibility code indicating that users who know one's email address can find out "Only that I have an account."

See Also:
Constant Field Values

REGSTATUS_FULL

public static final int REGSTATUS_FULL
A registration status visibility code indicating that users who know one's email address can find out "My screenname."

See Also:
Constant Field Values
Constructor Detail

AcctModCmd

protected AcctModCmd(SnacPacket packet)
Generates an account modification command object from the given incoming SNAC packet.

Parameters:
packet - the account modification command packet

AcctModCmd

public AcctModCmd(int regstatus)
Creates an outgoing account modification command that sets the user's registration visibility status to the given value.

Parameters:
regstatus - the new registration visibility code, like REGSTATUS_PARTIAL

AcctModCmd

public AcctModCmd(java.lang.String sn,
                  java.lang.String email)
Creates an outgoing account modification command that sets the user's screenname format and/or email address to the given values. Note that either of the parameters can be null, indicating that that value should not be modified.

Parameters:
sn - the new screenname format
email - the new email address

AcctModCmd

public AcctModCmd(java.lang.String sn,
                  java.lang.String email,
                  int regstatus)
Creates an outgoing account modification command that sets the given screenname and/or registered email address. Note that any of sn, email, and regstatus can be null or -1 to indicate that the given field should not be modified.

Parameters:
sn - a newly formatted screenname, or null to indicate that this field should not be modified
email - a new registered email address for this screenname, or null to indicate that this field should not be modified
regstatus - a new registration visibility status code, like REGSTATUS_FULL, or -1 to indicate that this field should not be modified
Method Detail

getScreenname

public final java.lang.String getScreenname()
Returns the new screen name format requested in this command, or null if that field was not sent.

Returns:
this command's requested screen name format field

getEmail

public final java.lang.String getEmail()
Returns the new registered email address requested by this command, or null if that field was not sent.

Returns:
this command's requested new registered email address field

getRegVisStatus

public final int getRegVisStatus()
Returns the registration visibility status code stored in this account modification command, or -1 if this value is not to be modified.

Returns:
the registration visibility status code stored in this command

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