net.kano.joscar.flapcmd
Class LoginFlapCmd

java.lang.Object
  extended byFlapCommand
      extended byLoginFlapCmd

public class LoginFlapCmd
extends FlapCommand

A command sent to identify oneself on a new FLAP connection with a FLAP protocol version and, optionally, a "login cookie" provided by another OSCAR server. This is always the first packet sent and received on a FLAP connection.

FLAP channel:
1

Field Summary
static int CHANNEL_LOGIN
          The FLAP channel on which this command resides.
static long VERSION_DEFAULT
          I guess this is the FLAP protocol version joscar implements; this is what should be sent in a FLAP version command.
 
Constructor Summary
LoginFlapCmd()
          Creates a LoginCookieCmd with the default FLAP version and no login cookie.
LoginFlapCmd(ByteBlock cookie)
          Creates a LoginCookieCmd with the default FLAP version and the given login cookie.
LoginFlapCmd(FlapPacket packet)
          Generates a LoginCookieCmd from the given packet.
LoginFlapCmd(long version)
          Creates a LoginCookieCmd with the given FLAP version and no login cookie.
LoginFlapCmd(long version, ByteBlock cookie)
          Creates a new LoginCookieCmd with the given FLAP protocol version and with the given cookie.
 
Method Summary
 ByteBlock getCookie()
          Returns the login cookie associated with this command.
 long getVersion()
          Returns the FLAP protocol version declared in this command.
 void writeData(java.io.OutputStream out)
          Writes this command's FLAP data to the given stream.
 
Methods inherited from class FlapCommand
getChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANNEL_LOGIN

public static final int CHANNEL_LOGIN
The FLAP channel on which this command resides.

See Also:
Constant Field Values

VERSION_DEFAULT

public static final long VERSION_DEFAULT
I guess this is the FLAP protocol version joscar implements; this is what should be sent in a FLAP version command. 1 is the only publically known FLAP protocol version.

See Also:
Constant Field Values
Constructor Detail

LoginFlapCmd

public LoginFlapCmd(FlapPacket packet)
Generates a LoginCookieCmd from the given packet.

Parameters:
packet - the packet from which this object should be generated

LoginFlapCmd

public LoginFlapCmd()
Creates a LoginCookieCmd with the default FLAP version and no login cookie.


LoginFlapCmd

public LoginFlapCmd(long version)
Creates a LoginCookieCmd with the given FLAP version and no login cookie. This constructor is useful for server developers because no login cookie is ever sent by the server; also, no login cookie is sent by the client or the server upon initial connection to the login ("auth") server.

Parameters:
version - the FLAP protocol version in use on the FLAP connection on which this command will be sent

LoginFlapCmd

public LoginFlapCmd(ByteBlock cookie)
Creates a LoginCookieCmd with the default FLAP version and the given login cookie.

Parameters:
cookie - the login cookie for the connection on which this command will be sent

LoginFlapCmd

public LoginFlapCmd(long version,
                    ByteBlock cookie)
Creates a new LoginCookieCmd with the given FLAP protocol version and with the given cookie.

Parameters:
version - the FLAP protocol version in use
cookie - a login "cookie" provided by another OSCAR connection
Method Detail

getVersion

public final long getVersion()
Returns the FLAP protocol version declared in this command.

Returns:
the FLAP version of the FLAP connection on which this packet was received

getCookie

public final ByteBlock getCookie()
Returns the login cookie associated with this command.

Returns:
this command's login cookie

writeData

public void writeData(java.io.OutputStream out)
               throws java.io.IOException
Description copied from class: FlapCommand
Writes this command's FLAP data to the given stream.

Specified by:
writeData in class FlapCommand
Parameters:
out - the stream to which the FLAP data should be written
Throws:
java.io.IOException - if an I/O error occurs