net.kano.joscar.snaccmd.auth
Class ClientVersionInfo

java.lang.Object
  extended byClientVersionInfo
All Implemented Interfaces:
LiveWritable

public final class ClientVersionInfo
extends java.lang.Object
implements LiveWritable

A data structure used to transmit information about the client software used to connect to OSCAR. This consists of a "client string" and a set of numbers used in specifying the exact version of the sofware. Note that currently AOL seems to block client versions other than its own official clients.


Constructor Summary
ClientVersionInfo(java.lang.String versionString, int major, int minor, int point, int build, int distCode)
          Creates a new client version information object with the given properties.
 
Method Summary
 int getBuild()
          Returns the client's build number.
 int getDistCode()
          Returns the client's "distribution code."
 int getMajor()
          Returns the client's "major version."
 int getMinor()
          Returns the client's "minor version."
 int getPoint()
          Returns the client's "point version."
 java.lang.String getVersionString()
          Returns the "client version string."
 java.lang.String toString()
           
 void write(java.io.OutputStream out)
          Writes a representation of this object to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientVersionInfo

public ClientVersionInfo(java.lang.String versionString,
                         int major,
                         int minor,
                         int point,
                         int build,
                         int distCode)
Creates a new client version information object with the given properties.

Parameters:
versionString - a "client version string," like "AOL Instant Messenger, version 5.1.3036/WIN32"
major - a "major version," like 5 in the above example
minor - a "minor version," like 1 in the above example
point - a "point version"; WinAIM 5.1 sends 0
build - a "build number," 3036 in the above example
distCode - a "distribution code," whose meaning is unknown at the time of this writing
Method Detail

getVersionString

public java.lang.String getVersionString()
Returns the "client version string." This will be null if this value was not sent.

Returns:
the client's client version string

getMajor

public int getMajor()
Returns the client's "major version." This is generally the first number in a dotted version number, like 5 in "5.1.3036". This will be -1 if this value was not sent.

Returns:
the client's "major version" number

getMinor

public int getMinor()
Returns the client's "minor version." This is generally the second number in a dotted version number, like 1 in "5.1.3036". This will be -1 if this value was not sent.

Returns:
the client's "major version" number

getPoint

public int getPoint()
Returns the client's "point version." In WinAIM this is always zero; it will be -1 if this value was not sent.

Returns:
the client's "point version" number

getBuild

public int getBuild()
Returns the client's build number. This will be -1 if this value was not sent.

Returns:
the client's build number

getDistCode

public int getDistCode()
Returns the client's "distribution code." As of this writing, the significance of the distribution code is unknown.

Returns:
the client's "distribution code"

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