|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.nukesoft.bot2.commlib.CommPort
The CommPort class wraps an externaly loaded CommLib and handles such tasks as connection maintnance and error correction.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
CommPort(String loggin,
String password,
String libPath,
int pingDelay,
CommPortCallback callback,
String bindName)
|
Method Summary | |
String |
getBindName()
Gets the Bind Name for theis CommPort. |
String |
getWarningLevel()
Returns the CommLib warning level. |
void |
handleError(String error)
Handles in incomming error. |
void |
handleIM(IM message)
Handles an incomming instant message. |
void |
handleWarn(String screenName)
Handles incomming warnings. |
void |
run()
Main loop for the connection maintnance thread. |
void |
sendMessage(IM message)
Sends an instant message over the network. |
void |
sendWarning(String screenName,
boolean anonymous)
Attempts to warn an individual. |
void |
shutdown()
Shuts down the CommPort and disconnects from the IM network. |
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 CommPort(String loggin, String password, String libPath, int pingDelay, CommPortCallback callback, String bindName)
loggin
- The loggin for this port to use.password
- The associated password.libPath
- The path to the communications library to load.pingDelay
- The number of seconds between pings. Zero for infinite.callback
- Class implementing the CommPortCallback interface
used to receive incomming message events.bindName
- The bind name of this CommPortMethod Detail |
public void shutdown()
public void sendMessage(IM message)
message
- The message to send.public void sendWarning(String screenName, boolean anonymous)
screenName
- The target.anonymous
- If true, attempt to warn anonymously.public void handleError(String error)
handleError
in interface CommLibCallback
CommLibCallback.handleError(java.lang.String)
public void handleIM(IM message)
handleIM
in interface CommLibCallback
message
- CommLibCallback.handleIM(org.nukesoft.bot2.core.IM)
public void handleWarn(String screenName)
handleWarn
in interface CommLibCallback
screenName
- The screen name that did the warning.CommLibCallback.handleWarn(java.lang.String)
public String getWarningLevel()
getWarningLevel()
public String getBindName()
public void run()
run
in interface Runnable
run
in class Thread
Runnable.run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |