|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--commLibs.AIMLib
AIMLib implements the AOL Instant Messanger protocal within the specification of the CommLib interface. This class relies on a repackaged version of the JavaTOC library written by Jeff Heaton ( http://www.jeffheaton.com).
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AIMLib()
|
Method Summary | |
void |
bindCallback(CommLibCallback callback)
Provodes callback binding. |
boolean |
connect(String loggin,
String password)
Establishes a connection with the TOC server and attempts to start the dispatch thread. |
protected String |
dehtmlify(String input)
Strips input of all HTML tags. |
void |
disconnect()
Disconnects from the TOC network. |
void |
doPing()
Called by the connection port maintnance thread. |
protected String |
err(int num)
Converts a TOC error code into a TOC error string. |
void |
error(String str,
String var)
Handles incomming errors from the TOC library. |
String |
getWarningLevel()
Gets the warning level. |
String |
identifyProtocal()
Identifies the protocal this library implements. |
void |
im(String from,
String message)
Forewards an incomming IM throught the callback chain. |
void |
run()
TOC Dispatch thread. |
void |
sendMessage(IM message)
Sends a message. |
void |
sendWarning(String screenName,
boolean anonymous)
Sends a warning. |
void |
unknown(String str)
Handles incomming unknown TOC events. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AIMLib()
Method Detail |
public void bindCallback(CommLibCallback callback)
bindCallback
in interface CommLib
callback
- The callback object to bind to.CommLib.bindCallback(org.nukesoft.bot2.commlib.CommLibCallback)
public boolean connect(String loggin, String password)
connect
in interface CommLib
loggin
- The screen name to connect to.password
- The password to use.
CommLib.connect(java.lang.String, java.lang.String)
public void disconnect()
disconnect
in interface CommLib
CommLib.disconnect()
public void sendMessage(IM message)
sendMessage
in interface CommLib
message
- The message to send.CommLib.sendMessage(org.nukesoft.bot2.core.IM)
public void sendWarning(String screenName, boolean anonymous)
sendWarning
in interface CommLib
screenName
- The screen name to warn.anonymous
- Warn anonymously if true.CommLib.sendWarning(java.lang.String, boolean)
public String identifyProtocal()
identifyProtocal
in interface CommLib
CommLib.identifyProtocal()
public void doPing()
doPing
in interface CommLib
CommLib.doPing()
public void error(String str, String var)
error
in interface JavaTOC.Chatable
str
- The ID of the error.var
- Not sure.Chatable.error(java.lang.String, java.lang.String)
public void im(String from, String message)
im
in interface JavaTOC.Chatable
Chatable.im(java.lang.String, java.lang.String)
public void unknown(String str)
unknown
in interface JavaTOC.Chatable
Chatable.unknown(java.lang.String)
public String getWarningLevel()
getWarningLevel
in interface CommLib
CommLib.getWarningLevel()
public void run()
run
in interface Runnable
run
in class Thread
Runnable.run()
protected String dehtmlify(String input)
input
- Text with embeded HTML.
protected String err(int num)
num
- Error code.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |