|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSnacCommand
AbstractIcbm
Provides a base for all six "Inter-Client Basic Message" SNAC commands. These six commands are sending an IM, receiving an IM, sending a rendezvous packet, receiving a rendezvous packet, sending a chat room message, and receiving a chat room message. All ICBM's contain an ICBM message ID, an ICBM channel, and a channel-specific data block.
Field Summary | |
static int |
CHANNEL_CHAT
The ICBM channel on which chat messages are sent. |
static int |
CHANNEL_IM
The ICBM channel on which instant messages are sent. |
static int |
CHANNEL_RV
The ICBM channel on which rendezvous messages are sent. |
Fields inherited from class SnacCommand |
SNACFLAG_DEFAULT |
Constructor Summary | |
protected |
AbstractIcbm(int family,
int command,
long messageId,
int channel)
Creates an ICBM command with the given SNAC family and command subtype, the given ICBM message ID, and on the given ICBM channel. |
protected |
AbstractIcbm(int family,
int command,
SnacPacket packet)
Creates an ICBM command with the given SNAC family and command type, deriving ICBM fields from the contents of the given packet. |
Method Summary | |
int |
getChannel()
Returns the ICBM channel on which this command resides. |
protected ByteBlock |
getChannelData()
Returns the "channel-specific data" block of this ICBM. |
static int |
getIcbmChannel(SnacPacket packet)
Returns the ICBM channel on which the given SnacPacket
resides. |
long |
getIcbmMessageId()
Returns this ICBM command's message ID. |
java.lang.String |
toString()
|
protected abstract void |
writeChannelData(java.io.OutputStream out)
Writes the channel-specific data for this ICBM command to the given output stream. |
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 |
public static final int CHANNEL_IM
public static final int CHANNEL_RV
public static final int CHANNEL_CHAT
Constructor Detail |
protected AbstractIcbm(int family, int command, SnacPacket packet)
getChannelData()
after using this constructor to retrieve
channel-specific data for this ICBM.
family
- the SNAC family of this ICBM commandcommand
- the SNAC command subtype of this ICBM commandpacket
- the packet to representprotected AbstractIcbm(int family, int command, long messageId, int channel)
family
- the SNAC family of this ICBM commandcommand
- the SNAC command subtype of this ICBM commandmessageId
- the 8-byte ICBM message ID of this commandchannel
- the ICBM channel of this command (should be one of CHANNEL_IM
, CHANNEL_RV
, CHANNEL_CHAT
)Method Detail |
public static final int getIcbmChannel(SnacPacket packet)
SnacPacket
resides. This assumes the validity of the given packet as an ICBM
packet.
packet
- the ICBM packet whose channel number will be returned
public final long getIcbmMessageId()
public final int getChannel()
protected final ByteBlock getChannelData()
null
for incoming ICBM's created using AbstractIcbm(int, int, SnacPacket)
.
public void writeData(java.io.OutputStream out) throws java.io.IOException
SnacCommand
writeData
in class SnacCommand
out
- the stream to which to write the SNAC data
java.io.IOException
- if an I/O error occursprotected abstract void writeChannelData(java.io.OutputStream out) throws java.io.IOException
out
- the stream to write to
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |