public class AIM
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| java.lang.String | authHostThe OSCAR authentication server. | 
| int | authPortThe OSCAR authentication server's port. | 
| protected java.net.Socket | connectionThe connection to the TOC server. | 
| static int | DATAThe ID number for a DATA packet (flap). | 
| protected java.lang.String | idScreen name of current user. | 
| protected java.io.InputStream | isAn InputStream to the connection. | 
| java.lang.String | languageWhat language to use. | 
| protected java.io.OutputStream | osAn OutputStream to the connection. | 
| java.lang.String | roastStringThe string used to "roast" passwords. | 
| protected short | sequenceThe sequence number used for FLAP packets. | 
| static int | SIGNONThe ID number for a SIGNON packet(FLAP). | 
| java.lang.String | tocHostThe host address of the TOC server. | 
| int | tocPortThe port used to connect to the TOC server. | 
| java.lang.String | versionThe version of the client. | 
| Constructor and Description | 
|---|
| AIM(java.lang.String id,
   java.lang.String password)Constructor for AIM. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected int | calculateCode(java.lang.String uid,
             java.lang.String pwd)Calculate a login security code from the user id and password. | 
| protected java.lang.String | encode(java.lang.String str)Called to encode a message. | 
| java.lang.String | getError()Getter for error | 
| protected java.lang.String | getFlap()Get a FLAP packet | 
| boolean | isLoggedin()Getter for loggedin | 
| boolean | login(java.lang.String id,
     java.lang.String password)Log in to TOC | 
| void | logout()Logout of toc and close the socket | 
| protected java.lang.String | normalize(java.lang.String name)Called to normalize a screen name. | 
| protected java.lang.String | roastPassword(java.lang.String str)Called to roast the password. | 
| void | send(java.lang.String to,
    java.lang.String msg)Send a IM | 
| protected void | sendFlap(int type,
        java.lang.String str)Send a FLAP packet | 
| protected void | sendFlapSignon()Send a FLAP signon packet | 
| protected void | sendRaw(java.lang.String str)Send a string over the socket as raw bytes | 
| protected void | writeWord(short word)Write a little endian word | 
public java.lang.String tocHost
public int tocPort
public java.lang.String authHost
public int authPort
public java.lang.String language
public java.lang.String version
public java.lang.String roastString
protected short sequence
protected java.net.Socket connection
protected java.io.InputStream is
protected java.io.OutputStream os
protected java.lang.String id
public static final int SIGNON
public static final int DATA
public AIM(java.lang.String id,
           java.lang.String password)
id - password - public boolean login(java.lang.String id,
                     java.lang.String password)
id - The screen name to login withpassword - The screen name's passwordpublic void logout()
protected java.lang.String roastPassword(java.lang.String str)
str - The password to roastprotected int calculateCode(java.lang.String uid,
                            java.lang.String pwd)
uid - The user id to encodepwd - The password to encoudeprotected void sendRaw(java.lang.String str)
                throws java.io.IOException
str - The string to sendjava.io.IOExceptionprotected void writeWord(short word)
                  throws java.io.IOException
word - A word to writejava.io.IOExceptionprotected void sendFlapSignon()
                       throws java.io.IOException
java.io.IOExceptionprotected void sendFlap(int type,
                        java.lang.String str)
                 throws java.io.IOException
type - The type DATA or SIGNONstr - The string message to sendjava.io.IOExceptionprotected java.lang.String getFlap()
                            throws java.io.IOException
java.io.IOExceptionpublic void send(java.lang.String to,
                 java.lang.String msg)
to - Screen name to send an IM tomsg - The instant messageprotected java.lang.String normalize(java.lang.String name)
name - The screen nameprotected java.lang.String encode(java.lang.String str)