net.kano.joscar.snaccmd.icbm
Class MissedMsgInfo

java.lang.Object
  extended byMissedMsgInfo
All Implemented Interfaces:
LiveWritable

public class MissedMsgInfo
extends java.lang.Object
implements LiveWritable

A data structure used to transmit information about messages that could not be sent for some reason.


Field Summary
static int REASON_SENDER_WARNING_LEVEL
          A reason code indicating that the sender has a warning level higher than the "sender" warning level set in your ICBM parameters.
static int REASON_TOO_FAST
          A reason code indicating that the message was sent too fast according to your ICBM parameters.
static int REASON_TOO_LARGE
          A reason code indicating that the message was too large according to your ICBM parameters.
static int REASON_YOUR_WARNING_LEVEL
          A reason code indicating that your warning level is higher than the sender's "receiver warning level" in his ICBM parameters.
 
Constructor Summary
MissedMsgInfo(int channel, FullUserInfo userInfo, int number, int reason)
          Creates a new missed message block with the given properties.
 
Method Summary
 int getChannel()
          Returns the ICBM channel on which the messages were missed.
 int getNumberMissed()
          Returns the number of messages missed.
 int getReasonCode()
          Returns a code indicating why the messages were missed.
 int getTotalSize()
          Returns the total size of this structure, as read from a block of binary data.
 FullUserInfo getUserInfo()
          Returns a user information block for the user whose messages were missed.
protected static MissedMsgInfo readMissedMsgInfo(ByteBlock block)
          Returns a missed message information object read from the given block of bytes.
 java.lang.String toString()
           
 void write(java.io.OutputStream out)
          Writes a representation of this object to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REASON_TOO_LARGE

public static final int REASON_TOO_LARGE
A reason code indicating that the message was too large according to your ICBM parameters.

See Also:
Constant Field Values

REASON_TOO_FAST

public static final int REASON_TOO_FAST
A reason code indicating that the message was sent too fast according to your ICBM parameters.

See Also:
Constant Field Values

REASON_SENDER_WARNING_LEVEL

public static final int REASON_SENDER_WARNING_LEVEL
A reason code indicating that the sender has a warning level higher than the "sender" warning level set in your ICBM parameters.

See Also:
Constant Field Values

REASON_YOUR_WARNING_LEVEL

public static final int REASON_YOUR_WARNING_LEVEL
A reason code indicating that your warning level is higher than the sender's "receiver warning level" in his ICBM parameters.

See Also:
Constant Field Values
Constructor Detail

MissedMsgInfo

public MissedMsgInfo(int channel,
                     FullUserInfo userInfo,
                     int number,
                     int reason)
Creates a new missed message block with the given properties.

Parameters:
channel - the ICBM channel on which the message was missed
userInfo - an object describing the user whose messages were missed
number - the number of messages missed
reason - a code indicating the reason the messages were missed, like REASON_TOO_LARGE
Method Detail

readMissedMsgInfo

protected static MissedMsgInfo readMissedMsgInfo(ByteBlock block)
Returns a missed message information object read from the given block of bytes.

Parameters:
block - the block of bytes contaoning missed message information
Returns:
a missed message information object read from the given block of data

getChannel

public final int getChannel()
Returns the ICBM channel on which the messages were missed. Normally AbstractIcbm.CHANNEL_IM.

Returns:
the ICBM channel on which the messages were missed

getUserInfo

public final FullUserInfo getUserInfo()
Returns a user information block for the user whose messages were missed.

Returns:
user information for the user whose messages were missed

getNumberMissed

public final int getNumberMissed()
Returns the number of messages missed.

Returns:
the number of messages missed

getReasonCode

public final int getReasonCode()
Returns a code indicating why the messages were missed. Normally one of {REASON_TOO_FAST, REASON_TOO_LARGE, REASON_SENDER_WARNING_LEVEL, and REASON_YOUR_WARNING_LEVEL.

Returns:
a code indicating why the messages were missed

getTotalSize

public final int getTotalSize()
Returns the total size of this structure, as read from a block of binary data. Will be -1 if this object was not read in from a block of data.

Returns:
the total size, in bytes, of this object

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
Description copied from interface: LiveWritable
Writes a representation of this object to the given stream.

Specified by:
write in interface LiveWritable
Parameters:
out - the stream to which to write
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()