net.sourceforge.simpleaim
Class Operations

java.lang.Object
  |
  +--net.sourceforge.simpleaim.Operations

public class Operations
extends java.lang.Object

Manages connections to the AOL TOC server. Receives all FLAP packages and parses them for messages. Embeds messages into FLAP packages and sends them back to the TOC server. Normalizes user names. 'Roasts' passwords.

Author:
simpleaim.sourceforge.net

Field Summary
(package private) static boolean away
           
(package private) static java.lang.String awayMessage
           
(package private) static java.util.Hashtable buddyList
           
(package private) static java.lang.String buddyListSetup
           
(package private) static int DATA
           
static boolean DEBUG
           
(package private) static java.lang.String FLAPON
           
(package private) static boolean greeted
           
(package private) static java.io.InputStream in
           
(package private) static java.lang.String loginHost
           
(package private) static java.lang.String loginPort
           
(package private) static int MAX_DATA_IN
           
(package private) static java.io.OutputStream out
           
(package private) static java.lang.String password
           
(package private) static java.lang.String[] permitDenyList
           
(package private) static int permitDenyStatus
           
(package private) static java.lang.String replyToUser
           
(package private) static short seq
           
(package private) static int SIGNON
           
(package private) static java.net.Socket sock
           
(package private) static java.lang.String tocHost
           
(package private) static int tocPort
           
(package private) static java.lang.String username
           
(package private) static java.lang.String VERSION
           
 
Constructor Summary
Operations()
           
 
Method Summary
 boolean connect()
          Makes a connection to the TOC server.
static java.lang.String decodeIM(java.lang.String str)
          Returns a message with all HTML tags removed.
static java.lang.String encodeIM(java.lang.String str)
          Returns an IM encoded for AOLs servers.
static java.lang.String normalize(java.lang.String name)
          Normalizes a user name.
static java.lang.String readFLAP()
          Reads an incoming FLAP packet and returns the message.
static void setPermitDenyStatus(int status)
          Changes the permit/deny status and sends the new list to the server
static void writeFLAP(int type, java.lang.String str)
          Writes an outgoing FLAP packet given the frame type and message.
static void writeFLAPSIGNON()
          Writes the FLAP SIGNON packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values

FLAPON

static final java.lang.String FLAPON
See Also:
Constant Field Values

MAX_DATA_IN

static final int MAX_DATA_IN
See Also:
Constant Field Values

SIGNON

static final int SIGNON
See Also:
Constant Field Values

DATA

static final int DATA
See Also:
Constant Field Values

tocHost

static java.lang.String tocHost

loginHost

static java.lang.String loginHost

tocPort

static int tocPort

loginPort

static java.lang.String loginPort

sock

static java.net.Socket sock

out

static java.io.OutputStream out

in

static java.io.InputStream in

seq

static short seq

username

static java.lang.String username

password

static java.lang.String password

greeted

static boolean greeted

away

static boolean away

awayMessage

static java.lang.String awayMessage

replyToUser

static java.lang.String replyToUser

permitDenyStatus

static int permitDenyStatus

buddyListSetup

static java.lang.String buddyListSetup

buddyList

static java.util.Hashtable buddyList

permitDenyList

static java.lang.String[] permitDenyList
Constructor Detail

Operations

public Operations()
Method Detail

connect

public boolean connect()
Makes a connection to the TOC server.

Returns:
was the connection successful?

writeFLAP

public static void writeFLAP(int type,
                             java.lang.String str)
                      throws java.io.IOException
Writes an outgoing FLAP packet given the frame type and message.

Parameters:
type - The frame type.
str - The message.
Throws:
java.io.IOException

readFLAP

public static java.lang.String readFLAP()
                                 throws java.io.IOException
Reads an incoming FLAP packet and returns the message.

Returns:
The message.
Throws:
java.io.IOException

writeFLAPSIGNON

public static void writeFLAPSIGNON()
                            throws java.io.IOException
Writes the FLAP SIGNON packet.

Throws:
java.io.IOException

decodeIM

public static java.lang.String decodeIM(java.lang.String str)
Returns a message with all HTML tags removed.

Parameters:
str - The string containing HTML tags.
Returns:

setPermitDenyStatus

public static void setPermitDenyStatus(int status)
Changes the permit/deny status and sends the new list to the server


encodeIM

public static java.lang.String encodeIM(java.lang.String str)
Returns an IM encoded for AOLs servers. Encoding for an AOL server means converting all newline and return characters to the HTML br tag, and converting curly brackets and double quotes to double backslashes.

Parameters:
str - The message to encode.
Returns:
The encoded message.

normalize

public static java.lang.String normalize(java.lang.String name)
Normalizes a user name. Normalizing makes all characters lower case and removes spaces.

Parameters:
name - The user name to normalize.
Returns:
The normalized user name.