net.kano.joscar.snaccmd.conn
Class RateChange

java.lang.Object
  extended bySnacCommand
      extended byConnCommand
          extended byRateChange

public class RateChange
extends ConnCommand

A SNAC command sent when rate limiting information for a rate class changes.

Source of this SNAC:
AIM server
SNAC command type:
Family 0x01, command 0x0a

Field Summary
static int CODE_LIMIT_CLEARED
          A rate change code indicating that the user is no longer being rate-limited.
static int CODE_LIMITED
          A rate change code indicating that the user has been rate-limited and that one or more previously sent commands were ignored.
static int CODE_RATES_CHANGED
          A rate change code indicating that rates changed for some reason.
static int CODE_WARNING
          A rate change code indicating that the user is in the "warning zone."
 
Fields inherited from class ConnCommand
CMD_CLIENT_READY, CMD_CLIENT_VERS, CMD_ENCINFOACK, CMD_EXTRA_ACK, CMD_MIGRATE_PLS, CMD_MY_INFO_REQ, CMD_NOOP, CMD_PAUSE, CMD_PAUSE_ACK, CMD_RATE_ACK, CMD_RATE_CHG, CMD_RATE_INFO, CMD_RATE_REQ, CMD_RESUME, CMD_SERV_VERS, CMD_SERVER_READY, CMD_SERVICE_REDIR, CMD_SERVICE_REQ, CMD_SET_IDLE, CMD_SETENCINFO, CMD_SETEXTRAINFO, CMD_UPDATE, CMD_WARNED, CMD_YOUR_INFO, FAMILY_CONN, FAMILY_INFO
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
  RateChange(int code, RateClassInfo rateInfo)
          Creates a new outgoing rate change command of the given type and with the given new rate class information.
protected RateChange(SnacPacket packet)
          Generates a new rate change command from the given incoming SNAC packet.
 
Method Summary
 int getChangeCode()
          Returns a code indicating the type of change that occurred.
 RateClassInfo getRateInfo()
          The updated rate information for the rate class that changed.
 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

CODE_RATES_CHANGED

public static final int CODE_RATES_CHANGED
A rate change code indicating that rates changed for some reason.

See Also:
Constant Field Values

CODE_WARNING

public static final int CODE_WARNING
A rate change code indicating that the user is in the "warning zone." WinAIM indicates this state by placing the "rate bar" in the yellow region.

See Also:
Constant Field Values

CODE_LIMITED

public static final int CODE_LIMITED
A rate change code indicating that the user has been rate-limited and that one or more previously sent commands were ignored. All future commands in this rate class will be ignored until the receipt of a limit-cleared change command.

See Also:
Constant Field Values

CODE_LIMIT_CLEARED

public static final int CODE_LIMIT_CLEARED
A rate change code indicating that the user is no longer being rate-limited.

See Also:
Constant Field Values
Constructor Detail

RateChange

protected RateChange(SnacPacket packet)
Generates a new rate change command from the given incoming SNAC packet.

Parameters:
packet - an incoming rate change packet

RateChange

public RateChange(int code,
                  RateClassInfo rateInfo)
Creates a new outgoing rate change command of the given type and with the given new rate class information.

Parameters:
code - a change code, like CODE_LIMITED
rateInfo - the new rate class information for the class changed
Method Detail

getChangeCode

public final int getChangeCode()
Returns a code indicating the type of change that occurred. This will normally be one of CODE_RATES_CHANGED, CODE_WARNING, CODE_LIMITED, and CODE_LIMIT_CLEARED.

Returns:
a code indicating the type of rate change that occurred

getRateInfo

public final RateClassInfo getRateInfo()
The updated rate information for the rate class that changed.

Returns:
the changed rate class

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