org.nukesoft.core
Class Dialog

java.lang.Object
  |
  +--org.nukesoft.core.Dialog
All Implemented Interfaces:
LineProcContextCallback

public class Dialog
extends Object
implements LineProcContextCallback

A Dialog is the bridge between CommPort objects and LineProc objects. They serve to provide the internal glue that binds the two ends togeather. All Dialog objects are managed by the DialogManager class

Author:
Ryan Michela

Constructor Summary
Dialog(CommPort comm, DynamicLoadLPContext lineProc, String identity)
          Creates a dialog binding.
 
Method Summary
 void bindConversation(String dialogID)
          Binds this dialog to another.
 int getAge()
          Gets the Dialog age.
 String[] getConversations()
          Returns a list of active conversations.
 String getIdentity()
          Returns this dialog's identity.
 String getWarningLevel()
          Gets the warning level from the CommLib.
 void handleIM(IM message)
          Handles incomming message from the CommLib.
 void handleWarn(String screenName)
          Handles incomming warning from the CommLib.
 void sendIM(IM message)
          Sends an outbound IM.
 void sendWarning(String screenName, boolean anonymous)
          Sends an outbound warning.
 void shutdown()
          Cleanly shuts down the Dialog.
 void tickAge()
          Incraments the age by one.
 void unbindConversation(String dialogID)
          Unbinds this dialog from another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dialog

public Dialog(CommPort comm,
              DynamicLoadLPContext lineProc,
              String identity)
Creates a dialog binding.

Method Detail

handleIM

public void handleIM(IM message)
Handles incomming message from the CommLib.

Parameters:
message - The message to foreward.

handleWarn

public void handleWarn(String screenName)
Handles incomming warning from the CommLib.

Parameters:
screenName - The screen name doing the warning.

getConversations

public String[] getConversations()
Returns a list of active conversations.

Specified by:
getConversations in interface LineProcContextCallback
Returns:
String array with fully qualified conversation names in the format CommPortBindName:ForeignScreenName.
See Also:
LineProcContextCallback.getConversations()

getIdentity

public String getIdentity()
Returns this dialog's identity.

Specified by:
getIdentity in interface LineProcContextCallback
Returns:
Identity string in the form CommPortBindName:ForeignScreenName.
See Also:
LineProcContextCallback.getIdentity()

getWarningLevel

public String getWarningLevel()
Gets the warning level from the CommLib.

Specified by:
getWarningLevel in interface LineProcContextCallback
Returns:
Integer string containing warning level if warning is supported on the supporting network. "N/A" if warning is not.
See Also:
LineProcContextCallback.getWarningLevel()

sendIM

public void sendIM(IM message)
Sends an outbound IM.

Specified by:
sendIM in interface LineProcContextCallback
Parameters:
message - The IM to send.
See Also:
LineProcContextCallback.sendIM(org.nukesoft.core.IM)

sendWarning

public void sendWarning(String screenName,
                        boolean anonymous)
Sends an outbound warning.

Specified by:
sendWarning in interface LineProcContextCallback
Parameters:
screenName - The screen name to warn.
anonymous - If TRUE, warn anonymously.
See Also:
LineProcContextCallback.sendWarning(java.lang.String, boolean)

bindConversation

public void bindConversation(String dialogID)
Binds this dialog to another.

Specified by:
bindConversation in interface LineProcContextCallback
Parameters:
dialogID - Dialog ID to bind to in the format CommPortBindName:ForeignScreenName.
See Also:
LineProcContextCallback.bindConversation(java.lang.String)

unbindConversation

public void unbindConversation(String dialogID)
Unbinds this dialog from another.

Specified by:
unbindConversation in interface LineProcContextCallback
Parameters:
dialogID - Dialog ID to unbind from in the format CommPortBindName:ForeignScreenName.
See Also:
LineProcContextCallback.unbindConversation(java.lang.String)

tickAge

public void tickAge()
Incraments the age by one.


getAge

public int getAge()
Gets the Dialog age.

Returns:
Age in seconds.

shutdown

public void shutdown()
Cleanly shuts down the Dialog.