net.kano.joscar.snaccmd
Class ExchangeInfo

java.lang.Object
  extended byAbstractChatInfo
      extended byExchangeInfo
All Implemented Interfaces:
LiveWritable

public final class ExchangeInfo
extends AbstractChatInfo
implements LiveWritable

Represents information about a given chat "exchange." Exchanges are, essentially, individual chat services within a single OSCAR chat server; for example, two chat rooms with the same name can exist on two different exchanges. Exchanges are identified by numbers, and generally something like exchanges 4 through 20 are available on AOL's official AIM servers. Exchange #4 is the only exchange on which WinAIM users can create chat rooms or join without being invited; that is, if you're in a chat room in WinAIM, it's probably on exchange #4.


Field Summary
 
Fields inherited from class AbstractChatInfo
MASK_CAN_PEEK, MASK_INSTANCING_ALLOWED, MASK_NAV_ONLY, MASK_WARNABLE, PERM_CAN_CREATE_EXCHANGE, PERM_CAN_CREATE_ROOM, PERM_CANNOT_CREATE_ANYTHING, TYPE_FULL, TYPE_INSTANCE_INFO, TYPE_NAV_INSTANCE_INFO, TYPE_NAV_SHORT_DESC, TYPE_SHORT
 
Method Summary
 int getNumber()
          Returns this exchange's "exchange number."
 java.lang.String getUrl()
          Returns a URL that supposedly describes this exchange.
static ExchangeInfo readExchangeInfo(ByteBlock block)
          Returns an exchange information block read from the given data block, or null if no valid block can be read.
 java.lang.String toString()
           
 void write(java.io.OutputStream out)
          Writes a representation of this object to the given stream.
 
Methods inherited from class AbstractChatInfo
getBaseTlvCount, getCharset1, getCharset2, getContentType, getCreatePerms, getCreationDate, getFlags, getLanguage1, getLanguage2, getMaxMsgLen, getMaxOccupancy, getName, getSomething, readBaseInfo, writeBaseInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

readExchangeInfo

public static ExchangeInfo readExchangeInfo(ByteBlock block)
Returns an exchange information block read from the given data block, or null if no valid block can be read.

Parameters:
block - the data block containing an exchange info block
Returns:
an exchange information object read from the given data block, or null if none can be read

getNumber

public final int getNumber()
Returns this exchange's "exchange number."

Returns:
the exchange number of this exchange info object

getUrl

public final java.lang.String getUrl()
Returns a URL that supposedly describes this exchange. This might be a URI that represents the exchange itself or an HTTP URL containing a website describing the exchange. As of this writing I have never seen this field actually sent.

Returns:
the URL associated with this

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()
Overrides:
toString in class AbstractChatInfo