org.walluck.oscar
Class AIMSession

java.lang.Object
  extended byorg.walluck.oscar.AIMSession

public class AIMSession
extends java.lang.Object

Everything starts with an AIM session.

Since:
1.0
Version:
1.0
Author:
David Walluck

Nested Class Summary
 class AIMSession.SSIObject
          This is for SSI support.
 
Constructor Summary
AIMSession()
          Creates a new AIM session.
 
Method Summary
 void addConn(AIMConnection conn)
          Add a connection to this session.
 void deregisiterListener(int family, int subtype, Listener listener)
          Remove a listener for this connection.
 java.lang.Object getAuxData()
          Get the value of auxData.
 java.util.Vector getConnList()
          Get the value of connList.
 java.util.ArrayList getEmailInfo()
          Get the value of emailInfo.
 int getFlags()
          Get the value of flags.
 SNACHandler getHandler(int family)
          Get the handler for the given SNAC family.
 java.util.ArrayList getHandlers()
          Get the value of handlers.
 java.util.Iterator getListeners(int family, int subtype)
          Get the connection listeners for the given SNAC family.
 LoginResponseInfo getLoginInfo()
          Get the value of loginInfo.
 java.util.ArrayList getRendezvous()
          Get the value of rendezvous.
 Rendezvous getRendezvous(int service)
          Get the rendezvous for the given type.
 ScriptInterpreter getScriptInterpreter()
          Get the script interpreter for this session.
 java.lang.String getSN()
          Get the value of sn.
 AIMSession.SSIObject getSSI()
          Get the value of ssi.
 java.util.Timer getTimer()
          Get the timer for this session.
 Tool getTool(int family)
          Get the tool for the given SNAC family.
 java.util.ArrayList getTools()
          Get the value of tools.
 void init()
          Call this once, after setting the screenname.
 boolean isIChat()
          Return whether or not this is an iChat session.
 boolean isICQ()
          Return whether or not this is an ICQ session.
 void kill()
          Kills a session.
 ListenerEntry lookupListenerEntry(int family, int subtype)
          Look up a listener entry for this connection.
 ListenerEntry lookupListenerEntryCreate(int family, int subtype)
          Look up a listener entry for this connection.
 void registerHandlers()
          Register all SNAC handlers for this session.
 void registerListener(int family, int subtype, Listener listener)
          Add the given listener to the given listener entry family for this connection.
 void registerRendezous()
          Register the rendezvous for this session.
 void registerTools()
          Register the tools for this session.
 void remConn(AIMConnection conn)
          Remove a connection from this session.
 void setAuxData(java.lang.Object auxData)
          Set the value of auxData.
 void setEmailInfo(java.util.ArrayList emailInfo)
          Set the value of emailInfo.
 void setFlags(int flags)
          Set the value of flags.
 void setIChat(boolean iChat)
          Set the value of iChat.
 void setICQ(boolean icq)
          Set the value of icq.
 void setLoginInfo(LoginResponseInfo loginInfo)
          Set the value of loginInfo.
 void setScriptInterpreter(ScriptInterpreter si)
          Set the script interpreter for this session.
 void setSN(java.lang.String sn)
          Set the value of sn.
 void setSSI(AIMSession.SSIObject ssi)
          Set the value of ssi.
 void setTimer(java.util.Timer timer)
          Set the timer for this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AIMSession

public AIMSession()
Creates a new AIM session.

Method Detail

init

public void init()
Call this once, after setting the screenname.


registerHandlers

public void registerHandlers()
Register all SNAC handlers for this session.


getHandler

public SNACHandler getHandler(int family)
Get the handler for the given SNAC family.

Parameters:
family - the SNAC family
Returns:
the handler for the given family

getHandlers

public java.util.ArrayList getHandlers()
Get the value of handlers.

Returns:
value of handlers.

registerTools

public void registerTools()
Register the tools for this session.


getTool

public Tool getTool(int family)
Get the tool for the given SNAC family.

Parameters:
family - the SNAC family
Returns:
the tool for the given SNAC family

getTools

public java.util.ArrayList getTools()
Get the value of tools.

Returns:
value of tools.

registerRendezous

public void registerRendezous()
Register the rendezvous for this session.


getRendezvous

public Rendezvous getRendezvous(int service)
Get the rendezvous for the given type.

Parameters:
service - the rendezvous service (capability constant)
Returns:
the rendezvous for the given service

getRendezvous

public java.util.ArrayList getRendezvous()
Get the value of rendezvous.

Returns:
value of rendezvous.

setScriptInterpreter

public void setScriptInterpreter(ScriptInterpreter si)
Set the script interpreter for this session.

Parameters:
si - the script

getScriptInterpreter

public ScriptInterpreter getScriptInterpreter()
Get the script interpreter for this session.

Returns:
value of script.

setTimer

public void setTimer(java.util.Timer timer)
Set the timer for this session.

Parameters:
timer - the timer

getTimer

public java.util.Timer getTimer()
Get the timer for this session.

Returns:
value of timer.

kill

public void kill()
Kills a session.


getSN

public java.lang.String getSN()
Get the value of sn.

Returns:
value of sn.

setSN

public void setSN(java.lang.String sn)
Set the value of sn.

Parameters:
sn - Value to assign to sn.

isICQ

public boolean isICQ()
Return whether or not this is an ICQ session.

Returns:
true if an ICQ session, false otherwise

setICQ

public void setICQ(boolean icq)
Set the value of icq.

Parameters:
icq - Value to assign to icq.

isIChat

public boolean isIChat()
Return whether or not this is an iChat session.

Returns:
true if an iChat session, false otherwise

setIChat

public void setIChat(boolean iChat)
Set the value of iChat.

Parameters:
iChat - Value to assign to iChat.

addConn

public void addConn(AIMConnection conn)
Add a connection to this session.

Parameters:
conn - the connection to add

remConn

public void remConn(AIMConnection conn)
Remove a connection from this session.

Parameters:
conn - the connection to remove

getConnList

public java.util.Vector getConnList()
Get the value of connList.

Returns:
value of connList.

getFlags

public int getFlags()
Get the value of flags.

Returns:
value of flags.

setFlags

public void setFlags(int flags)
Set the value of flags.

Parameters:
flags - Value to assign to flags.

getSSI

public AIMSession.SSIObject getSSI()
Get the value of ssi.

Returns:
value of ssi.

setSSI

public void setSSI(AIMSession.SSIObject ssi)
Set the value of ssi.

Parameters:
ssi - Value to assign to ssi.

getAuxData

public java.lang.Object getAuxData()
Get the value of auxData.

Returns:
value of auxData.

setAuxData

public void setAuxData(java.lang.Object auxData)
Set the value of auxData.

Parameters:
auxData - Value to assign to auxData.

getLoginInfo

public LoginResponseInfo getLoginInfo()
Get the value of loginInfo.

Returns:
the value of LoginInfo.

setLoginInfo

public void setLoginInfo(LoginResponseInfo loginInfo)
Set the value of loginInfo.

Parameters:
loginInfo - Value to assign to loginInfo.

getEmailInfo

public java.util.ArrayList getEmailInfo()
Get the value of emailInfo.

Returns:
value of emailInfo.

setEmailInfo

public void setEmailInfo(java.util.ArrayList emailInfo)
Set the value of emailInfo.

Parameters:
emailInfo - Value to assign to emailInfo.

lookupListenerEntry

public ListenerEntry lookupListenerEntry(int family,
                                         int subtype)
Look up a listener entry for this connection.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
Returns:
the listener entry if found, or null otherwise

lookupListenerEntryCreate

public ListenerEntry lookupListenerEntryCreate(int family,
                                               int subtype)
Look up a listener entry for this connection. If the entry exists, return it, else create a new listener entry and return that listener transparently.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
Returns:
the listener entry

registerListener

public void registerListener(int family,
                             int subtype,
                             Listener listener)
Add the given listener to the given listener entry family for this connection. We could disallow certain SNAC pairs 0x0001/0x0002, 0x0001/0x0003, 0x0001/0x0006, 0x0001/0x0007, 0x0001/0x0008, 0x0001/0x0017, 0x0001/0x0018, but when the tools are implemented everything should start to work out.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
listener - the SNAC listener

deregisiterListener

public void deregisiterListener(int family,
                                int subtype,
                                Listener listener)
Remove a listener for this connection. Make sure that both the listener entry and the given listener exist for this connection before calling this method.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
listener - the SNAC listener

getListeners

public java.util.Iterator getListeners(int family,
                                       int subtype)
Get the connection listeners for the given SNAC family.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
Returns:
the listeners