agent.interaction.samples
Class SimpleVoiceInteraction

java.lang.Object
  extended by agent.interaction.samples.SimplePlace
      extended by agent.interaction.samples.SimpleVoiceInteraction
All Implemented Interfaces:
com.genesyslab.ail.event.ConfigObjectListener, com.genesyslab.ail.event.DnListener, com.genesyslab.ail.event.InteractionListener, com.genesyslab.ail.event.PlaceListener, java.util.EventListener
Direct Known Subclasses:
MultipartyVoiceInteraction

public class SimpleVoiceInteraction
extends SimplePlace

This example uses a GUI application to show how to make and answer a call, place the call on hold, release the call, and mark it done.

One PlaceListener is registered, which receives InteractionEvents.


Field Summary
 
Fields inherited from class agent.interaction.samples.SimplePlace
sampleAgent, sampleChat, sampleDn, sampleEmail, sampleOpenMedia, samplePlace
 
Constructor Summary
SimpleVoiceInteraction(java.lang.String windowTitle)
          Creates an instance of SimpleVoiceInteraction.
 
Method Summary
 void handleInteractionEvent(com.genesyslab.ail.event.InteractionEvent event)
          Receives InteractionEvents, which report changes to the status or data of an Interaction of this place.
 void linkWidgetsToGui()
          Links widgets (user interface components) to API functionality and registers a listener for events on the Place the agent has logged in to.
static void main(java.lang.String[] args)
          This method is used to run the SimpleVoiceInteraction example.
 void setInteractionWidgetState()
          This class receives InteractionEvents, which are handled by the handleInteractionEvent() method.
 void setSampleType()
          Tells the AgentInteractionGui class which example has called the GUI, so that it can determine which widgets will be enabled when the GUI is created.
 
Methods inherited from class agent.interaction.samples.SimplePlace
contactChanged, deleted, dnAdded, dnRemoved, handleDnEvent, handlePlaceEvent, idModified, setPlaceWidgetState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleVoiceInteraction

public SimpleVoiceInteraction(java.lang.String windowTitle)
Creates an instance of SimpleVoiceInteraction.
The super constructor connects to the Agent Interaction Layer. After connecting, it sets up an agent, place, media, and DN for use by the examples. Then it creates the GUI, links the GUI components (widgets) to API functionality, and starts the application.

Parameters:
windowTitle - The title of the GUI window for this example.
Method Detail

setSampleType

public void setSampleType()
Tells the AgentInteractionGui class which example has called the GUI, so that it can determine which widgets will be enabled when the GUI is created.


linkWidgetsToGui

public void linkWidgetsToGui()
Links widgets (user interface components) to API functionality and registers a listener for events on the Place the agent has logged in to.

The linked widgets for Simple Voice are buttons for processing a voice interaction. These buttons correspond to the following actions:

Overrides:
linkWidgetsToGui in class SimplePlace
See Also:
SimplePlace.linkWidgetsToGui()

setInteractionWidgetState

public void setInteractionWidgetState()
This class receives InteractionEvents, which are handled by the handleInteractionEvent() method. This class also has widgets whose state must be set when it receives these events. This method enables or disables the specified widgets, which are normally just buttons and radio buttons, but may include other widgets. To do this, it uses the isPossible() method of the Possible interface. The isPossible() method returns either true or false, depending on whether a particular action is possible. This boolean value is used to determine whether the widget will be enabled.

Overrides:
setInteractionWidgetState in class SimplePlace

handleInteractionEvent

public void handleInteractionEvent(com.genesyslab.ail.event.InteractionEvent event)
Receives InteractionEvents, which report changes to the status or data of an Interaction of this place. If you implement the PlaceListener interface, you must implement this method.

The SimpleVoiceInteraction code example uses this method to log these InteractionEvents as they occur and, if the event involves a voice interaction to set the state of the widgets used by the SimpleVoiceInteraction and MultipartyVoiceInteraction examples.

Specified by:
handleInteractionEvent in interface com.genesyslab.ail.event.InteractionListener
Overrides:
handleInteractionEvent in class SimplePlace

main

public static void main(java.lang.String[] args)
This method is used to run the SimpleVoiceInteraction example.

Parameters:
args - There are no arguments for this class.