org.nukesoft.bot2.lineproc
Interface LineProcContext

All Known Implementing Classes:
DynamicLoadLPContext

public interface LineProcContext

The LineProcContext interface defines the interface that line processors use to talk to and control the bot core. It provides callback services for message forewarding, as well as utility services.

Author:
Ryan Michela

Method Summary
 boolean bindConversation(String dialogID)
          Forces all trafic to and from designated dialog to also be echoed to this LineProc.
 Set getComPortBindIDs()
          Returns a set of Strings containing the bind IDs of all comports.
 Set getConversations()
          Fetches the set of all active conversations.
 String getIdentity()
          Returns the identity of the Dialog object.
 Set getLineProcBindIDs()
          Returns a set of Strings containing the bind IDs of all line procs.
 String getRemoteScreenName()
          Returns the foreign screen name attached to this context.
 String getWarningLevel()
          Fetches the warning level of the account to which this conversation is bound.
 void initiateConversation(String commPortBindID, String remoteScreenName, String salutation)
          Initates a conversation with a remote screen name.
 void interject(String dialogID, String interjection)
          Sends an interjection into another Dialog's conversation flow.
 String lastLoadedLineProc()
          The bind ID of the last loaded class.
 boolean loadNewLineProc(String lineProcBindID)
          Loads a new line processor and transfers control to it.
 boolean loadNewLineProcOnPeer(String dialogID, String lineProcBindID)
          Loads a new line processor for a peer Dialog and transfers control to it.
 void sendIM(IM message)
          Sends an IM.
 void sendWarning(String screenName, boolean anonymous)
          Sends a warning.
 boolean unbindConversation(String dialogID)
          Halts all traffic to and from designated dialog.
 

Method Detail

sendIM

public void sendIM(IM message)
Sends an IM.

Parameters:
message - The IM to send.

sendWarning

public void sendWarning(String screenName,
                        boolean anonymous)
Sends a warning. May not work on all networks.

Parameters:
screenName - The screen name to warn.
anonymous - If TRUE, warn anonymously.

getWarningLevel

public String getWarningLevel()
Fetches the warning level of the account to which this conversation is bound.

Returns:
Integer string containing warning level if warning is supported on the supporting network. "N/A" if warning is not.

getIdentity

public String getIdentity()
Returns the identity of the Dialog object. This is not the foreign screen name attached to this context, but rather the internal unique context identity. To get the foreign screen name, use the getForeignScreenName() method.

Returns:
Identity string in the form CommPortBindName~ForeignScreenName.

getRemoteScreenName

public String getRemoteScreenName()
Returns the foreign screen name attached to this context. That is, the screen name of the person at the other end of the line.

Returns:
The remote screen name.

getConversations

public Set getConversations()
Fetches the set of all active conversations.

Returns:
Set of Strings with fully qualified conversation names in the format CommPortBindName~ForeignScreenName.

bindConversation

public boolean bindConversation(String dialogID)
Forces all trafic to and from designated dialog to also be echoed to this LineProc.

Parameters:
dialogID - Dialog ID to bind to in the format CommPortBindName~ForeignScreenName.

unbindConversation

public boolean unbindConversation(String dialogID)
Halts all traffic to and from designated dialog. In other words, stops message echoing. Does nothing if not bound to target dialog.

Parameters:
dialogID - Dialog ID to unbind from in the format CommPortBindName~ForeignScreenName.

loadNewLineProc

public boolean loadNewLineProc(String lineProcBindID)
Loads a new line processor and transfers control to it.

Parameters:
lineProcBindID - The bind ID of the class to load.
Returns:
TRUE if success, FALSE if otherwise.

loadNewLineProcOnPeer

public boolean loadNewLineProcOnPeer(String dialogID,
                                     String lineProcBindID)
Loads a new line processor for a peer Dialog and transfers control to it.

Parameters:
dialogID - The peer to manipulate.
lineProcBindID - The line proc to load.
Returns:
TRUE if success, FALSE if otherwise.

lastLoadedLineProc

public String lastLoadedLineProc()
The bind ID of the last loaded class.

Returns:
Path.

getComPortBindIDs

public Set getComPortBindIDs()
Returns a set of Strings containing the bind IDs of all comports. This information can be used for internal purposes or for initiating a conversation with an unknowing victim.

Returns:
A set of Strings.

getLineProcBindIDs

public Set getLineProcBindIDs()
Returns a set of Strings containing the bind IDs of all line procs. This information can be used for internal purposes or for rebinding the current conversation to a new line proc.

Returns:
A set of Strings.

initiateConversation

public void initiateConversation(String commPortBindID,
                                 String remoteScreenName,
                                 String salutation)
Initates a conversation with a remote screen name.

Parameters:
commPortBindID - The commPort to use for the dialog.
remoteScreenName - The screen name to initiate a conversation with.
salutation - The salutation to send them.

interject

public void interject(String dialogID,
                      String interjection)
Sends an interjection into another Dialog's conversation flow.

Parameters:
dialogID - The name of the dialog to interject into.
interjection - The text to interject with.