|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSnacCommand
SsiCommand
SsiDataCheck
A SNAC command sent to request the user's server-stored data if and only if
it was modified past a certain date. Normally responded-to with either a
SsiDataCmd
or a SsiUnchangedCmd
. The purpose of this command
in addition to SsiDataRequest
is to avoid downloading the same
buddy list at the start of every connection, which both wastes bandwidth and
increases the net time it takes to sign on, especially for those with large
buddy lists. This command should only be used if the client saves the SSI
data to disk or some other non-temporary medium; otherwise one should use
SsiDataRequest
.
SsiDataCmd
,
SsiUnchangedCmd
0x13
, command 0x05
Field Summary |
Fields inherited from class SsiCommand |
CMD_ACTIVATE, CMD_CREATE_ITEMS, CMD_DATA_CHECK, CMD_DATA_REQ, CMD_DELETE_ITEMS, CMD_MOD_ACK, CMD_MODIFY_ITEMS, CMD_POST_MOD, CMD_PRE_MOD, CMD_RIGHTS, CMD_RIGHTS_REQ, CMD_SSI_DATA, CMD_UNCHANGED, FAMILY_INFO, FAMILY_SSI |
Fields inherited from class SnacCommand |
SNACFLAG_DEFAULT |
Constructor Summary | |
|
SsiDataCheck(long lastmod,
int itemCount)
Creates a new outgoing SSI data check command with the given last modification date of the client's version of the SSI data and the given number of SSI items currently present in the client's SSI data. |
protected |
SsiDataCheck(SnacPacket packet)
Generates a new SSI data check command from the given incoming SNAC packet. |
Method Summary | |
int |
getItemCount()
Returns the number of SSI "items" contained in the client's version of the SSI data. |
long |
getLastModDate()
Returns the last-modification date of the client's version of the SSI data, in seconds since the unix epoch. |
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 |
Constructor Detail |
protected SsiDataCheck(SnacPacket packet)
packet
- an incoming SSI data check packetpublic SsiDataCheck(long lastmod, int itemCount)
// create a File object for the SSI data file File ssiDataFile = new File("ssi.dat"); // lastModifed returns milliseconds since unix epoch, so we can just divide by // 1000 to get seconds long secondsSinceUnixEpoch = ssiDataFile.lastModified() / 1000; // count the items. I assume you'll have your own system for determining this // sort of thing. int itemCount = someCommandYouMadeToCountTheItems(ssiDataFile); // now send the command with some send command you made send(new SsiDataCheck(secondsSinceUnixEpoch, itemCount));
lastmod
- the last modification date of the client's version of the
SSI data, in seconds since the unix epochitemCount
- the number of SSI "items" in the local version of the
SSI dataMethod Detail |
public final long getLastModDate()
public final int getItemCount()
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 occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |