net.kano.joscar.snaccmd.conn
Class SetIdleCmd

java.lang.Object
  extended bySnacCommand
      extended byConnCommand
          extended bySetIdleCmd

public class SetIdleCmd
extends ConnCommand

A SNAC command used to set how long the user has been idle. This command should only be sent once when the user becomes idle; the server will handle increasing the amount of idle time as time progresses. When the user becomes unidle, the command should be sent with an idle time value of zero (SetIdleCmd.IDLETIME_NOT_IDLE).

Source of this SNAC:
AIM client
SNAC command type:
Family 0x01, command 0x11

Field Summary
static long IDLETIME_NOT_IDLE
          An idle time value (0l) indicating that the user is not idle.
 
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
  SetIdleCmd(long seconds)
          Creates a new outgoing set idle time command with the given number of seconds idle.
protected SetIdleCmd(SnacPacket packet)
          Generates a new set idle time command from the given incoming SNAC packet.
 
Method Summary
 long getSecondsIdle()
          Returns the number of seconds the user has been idle, as sent in this command.
 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

IDLETIME_NOT_IDLE

public static final long IDLETIME_NOT_IDLE
An idle time value (0l) indicating that the user is not idle.

See Also:
Constant Field Values
Constructor Detail

SetIdleCmd

protected SetIdleCmd(SnacPacket packet)
Generates a new set idle time command from the given incoming SNAC packet.

Parameters:
packet - the incoming set idle time packet

SetIdleCmd

public SetIdleCmd(long seconds)
Creates a new outgoing set idle time command with the given number of seconds idle. If seconds is 0, the idle time is reset to zero and the user is marked "active" until another set idle time command is sent with a nonzero value.

Parameters:
seconds - the number of seconds the user has been idle
Method Detail

getSecondsIdle

public final long getSecondsIdle()
Returns the number of seconds the user has been idle, as sent in this command.

Returns:
the user's idle time, in seconds

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