net.kano.joscar.snaccmd.conn
Class UpdateAdvisory

java.lang.Object
  extended bySnacCommand
      extended byConnCommand
          extended byUpdateAdvisory

public class UpdateAdvisory
extends ConnCommand

A SNAC command sent to alert the user that he or she should upgrade to a newer version of AOL Instant Messenger.

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

Field Summary
static int TYPE_MANDATORY_UPDATE
          An update advisory type indicating that the given update is "mandatory," and that the client cannot connect until he or she updates.
static int TYPE_OKAY
          An update advisory type indicating that there is nothing to upgrade.
static int TYPE_RECOMMENDED_UPDATE
          An update advisory type indicating that the given update is recommended, but not (yet) necessary.
static int TYPE_SYSTEM_BULLETIN
          An update advisory type indicating that this is not an update advisory but in fact contains a "message of the day."
 
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
  UpdateAdvisory(int type)
          Creates a new outgoing update advisory command of the given type and with no message.
  UpdateAdvisory(int type, java.lang.String message)
          Creates a new outgoing update advisory command with the given type and message.
protected UpdateAdvisory(SnacPacket packet)
          Generates a new update advisory command from the given incoming SNAC packet.
 
Method Summary
 int getAdvisoryType()
          Returns the type of this advisory.
 java.lang.String getMessage()
          Returns the message associated with this update advisory.
 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

TYPE_MANDATORY_UPDATE

public static final int TYPE_MANDATORY_UPDATE
An update advisory type indicating that the given update is "mandatory," and that the client cannot connect until he or she updates.

See Also:
Constant Field Values

TYPE_RECOMMENDED_UPDATE

public static final int TYPE_RECOMMENDED_UPDATE
An update advisory type indicating that the given update is recommended, but not (yet) necessary.

See Also:
Constant Field Values

TYPE_SYSTEM_BULLETIN

public static final int TYPE_SYSTEM_BULLETIN
An update advisory type indicating that this is not an update advisory but in fact contains a "message of the day." Supposedly, anyway. I've never seen this one.

See Also:
Constant Field Values

TYPE_OKAY

public static final int TYPE_OKAY
An update advisory type indicating that there is nothing to upgrade.

See Also:
Constant Field Values
Constructor Detail

UpdateAdvisory

protected UpdateAdvisory(SnacPacket packet)
Generates a new update advisory command from the given incoming SNAC packet.

Parameters:
packet - an incoming update advisory packet

UpdateAdvisory

public UpdateAdvisory(int type)
Creates a new outgoing update advisory command of the given type and with no message. Using this constructor is equivalent to calling new UpdateAdvisory(type, null).

Parameters:
type - the update advisory type, like TYPE_RECOMMENDED_UPDATE

UpdateAdvisory

public UpdateAdvisory(int type,
                      java.lang.String message)
Creates a new outgoing update advisory command with the given type and message.

Parameters:
type - he update advisory type, like TYPE_MANDATORY_UPDATE
message - a message to be displayed to the user
Method Detail

getAdvisoryType

public final int getAdvisoryType()
Returns the type of this advisory. Normally one of TYPE_MANDATORY_UPDATE, TYPE_RECOMMENDED_UPDATE, TYPE_SYSTEM_BULLETIN, and TYPE_OKAY.

Returns:
the advisory type code

getMessage

public final java.lang.String getMessage()
Returns the message associated with this update advisory.

Returns:
the update advisory message

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