com.genesyslab.ail.applicationblocks.openmedia.simplehandling
Class SimpleOpenMediaHandler

java.lang.Object
  extended bycom.genesyslab.ail.applicationblocks.openmedia.simplehandling.SimpleOpenMediaHandler
Direct Known Subclasses:
ComplexOpenMediaHandler

public class SimpleOpenMediaHandler
extends java.lang.Object

SimpleOpenMediaHandler class handles Open Media interaction. This class handles the common methods of an Open Media interaction.


Nested Class Summary
 class SimpleOpenMediaHandler.InteractionListenerAdapter
          Implements InteractionListener.
 
Constructor Summary
SimpleOpenMediaHandler()
          Creates a new instance of SimpleOpenMediaManager
SimpleOpenMediaHandler(com.genesyslab.ail.Agent anAgent)
          Creates a new instance of SimpleOpenMediaManager
SimpleOpenMediaHandler(AgentHandler agentHandler)
          Creates a new instance of SimpleOpenMediaManager
 
Method Summary
 void accept(com.genesyslab.ail.Interaction interaction)
          Accepts to process this Interaction.
 com.genesyslab.ail.Interaction createOpenMediaInteraction(java.lang.String mediaType, java.lang.String interactionType, java.lang.String interactionSubType, java.lang.String id, java.lang.String queue, java.lang.String subject, com.genesyslab.ail.Interaction parent, java.util.Map userData)
          Creates an Open Media interaction.
 void decline(com.genesyslab.ail.Interaction interaction)
          Declines this Interaction.
 void delete(com.genesyslab.ail.Interaction interaction)
          Deletes this interaction.
 java.lang.String getOpenInteractionSubType(com.genesyslab.ail.Interaction interaction)
          Get the interaction subtype of the interaction.
 java.lang.String getOpenInteractionType(com.genesyslab.ail.Interaction interaction)
          Get the interaction type of the interaction.
 java.lang.String getOpenMediaType(com.genesyslab.ail.Interaction interaction)
          Get the Media type of the interaction.
 void init(com.genesyslab.ail.Agent anAgent)
          Another way to initialize SimpleOpenMediaManager
 void markDone(com.genesyslab.ail.Interaction interaction)
          Marks this Interaction as done.
 void placeInQueue(com.genesyslab.ail.Interaction interaction, java.lang.String queue)
          Places this interaction into this queue.
 void placeInWorkbin(com.genesyslab.ail.Interaction interaction, java.lang.String workbin, java.lang.String reason, java.lang.String reason_description)
          Places an interaction into the workbin of another agent, another agent group, another place group or another place.
 void release(com.genesyslab.ail.Interaction interaction)
          Releases this Interaction.
 void save(com.genesyslab.ail.Interaction interaction)
          Saves this interaction into the Contact Server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOpenMediaHandler

public SimpleOpenMediaHandler(AgentHandler agentHandler)
Creates a new instance of SimpleOpenMediaManager


SimpleOpenMediaHandler

public SimpleOpenMediaHandler(com.genesyslab.ail.Agent anAgent)
Creates a new instance of SimpleOpenMediaManager


SimpleOpenMediaHandler

public SimpleOpenMediaHandler()
Creates a new instance of SimpleOpenMediaManager

Method Detail

init

public void init(com.genesyslab.ail.Agent anAgent)
          throws com.genesyslab.ail.exception.RequestFailedException
Another way to initialize SimpleOpenMediaManager

Throws:
com.genesyslab.ail.exception.RequestFailedException

createOpenMediaInteraction

public com.genesyslab.ail.Interaction createOpenMediaInteraction(java.lang.String mediaType,
                                                                 java.lang.String interactionType,
                                                                 java.lang.String interactionSubType,
                                                                 java.lang.String id,
                                                                 java.lang.String queue,
                                                                 java.lang.String subject,
                                                                 com.genesyslab.ail.Interaction parent,
                                                                 java.util.Map userData)
                                                          throws com.genesyslab.ail.exception.RequestFailedException
Creates an Open Media interaction.

Parameters:
mediaType - an Open Media type,
interactionType - an interaction Type (Inbound, Outbound, Internal),
interactionSubType - an interaction subtype (New ...),
id - an ID for the interaction, could be null,
queue - the queue name of the interaction,
subject - the subject of the interaction,
parent - the parent's interaction,
userData - the customer data or useful additional data. Can be null.
Returns:
an Open Media Interaction.
Throws:
com.genesyslab.ail.exception.RequestFailedException

accept

public void accept(com.genesyslab.ail.Interaction interaction)
            throws com.genesyslab.ail.exception.RequestFailedException
Accepts to process this Interaction. This method must be used to accept a call that is in 'RINGING' status.

Throws:
com.genesyslab.ail.exception.RequestFailedException

decline

public void decline(com.genesyslab.ail.Interaction interaction)
             throws com.genesyslab.ail.exception.RequestFailedException
Declines this Interaction. Rejects an Open Media interaction when its status is 'RINGING'.

Throws:
com.genesyslab.ail.exception.RequestFailedException

release

public void release(com.genesyslab.ail.Interaction interaction)
             throws com.genesyslab.ail.exception.RequestFailedException
Releases this Interaction.

Throws:
com.genesyslab.ail.exception.RequestFailedException

markDone

public void markDone(com.genesyslab.ail.Interaction interaction)
              throws com.genesyslab.ail.exception.RequestFailedException
Marks this Interaction as done.

Throws:
com.genesyslab.ail.exception.RequestFailedException

delete

public void delete(com.genesyslab.ail.Interaction interaction)
            throws com.genesyslab.ail.exception.RequestFailedException
Deletes this interaction. All database items about this interaction will be deleted. The interaction will no longer appear in the history.

Throws:
NoPlaceException - if this interaction is not currently handled on a Place.
IsServiceException - if there is a problem with the Interaction Server.
com.genesyslab.ail.exception.RequestFailedException

getOpenMediaType

public java.lang.String getOpenMediaType(com.genesyslab.ail.Interaction interaction)
                                  throws com.genesyslab.ail.exception.RequestFailedException
Get the Media type of the interaction.

Parameters:
interaction - the interaction,
Returns:
the Media type of the interaction.
Throws:
com.genesyslab.ail.exception.RequestFailedException

getOpenInteractionType

public java.lang.String getOpenInteractionType(com.genesyslab.ail.Interaction interaction)
                                        throws com.genesyslab.ail.exception.RequestFailedException
Get the interaction type of the interaction.

Parameters:
interaction - the interaction,
Returns:
the interaction type of the interaction.
Throws:
com.genesyslab.ail.exception.RequestFailedException

getOpenInteractionSubType

public java.lang.String getOpenInteractionSubType(com.genesyslab.ail.Interaction interaction)
                                           throws com.genesyslab.ail.exception.RequestFailedException
Get the interaction subtype of the interaction.

Parameters:
interaction - the interaction,
Returns:
the interaction subtype of the interaction.
Throws:
com.genesyslab.ail.exception.RequestFailedException

save

public void save(com.genesyslab.ail.Interaction interaction)
          throws com.genesyslab.ail.exception.RequestFailedException
Saves this interaction into the Contact Server.

Throws:
DatabaseServiceException - if there is a problem with the Contact Server.
com.genesyslab.ail.exception.RequestFailedException

placeInQueue

public void placeInQueue(com.genesyslab.ail.Interaction interaction,
                         java.lang.String queue)
                  throws com.genesyslab.ail.exception.RequestFailedException
Places this interaction into this queue. This method must be called on a 'TALKING' interaction (handled by this agent). It will then go into IDLE state and will be available to other agents or servers (like a router...).

Parameters:
interaction - the OpenMedia interaction,
queue - the identifier of the queue where to place this interaction. If null, this interaction will be placed back into the queue where it originally was.
Throws:
NoPlaceException - if this interaction is not currently handled on a Place.
IsServiceException - if there is a problem with the Interaction Server.
com.genesyslab.ail.exception.RequestFailedException

placeInWorkbin

public void placeInWorkbin(com.genesyslab.ail.Interaction interaction,
                           java.lang.String workbin,
                           java.lang.String reason,
                           java.lang.String reason_description)
                    throws com.genesyslab.ail.exception.RequestFailedException
Places an interaction into the workbin of another agent, another agent group, another place group or another place.

Parameters:
interaction - the interaction to be put into the workbin.
workbin - the workbin where to put the interaction. Can be null; if this value is null, the default behaviour is Workbin.put(com.genesyslab.ail.InteractionMultimedia).
reason - this action's reason.
reason_description - the reason's description.
Throws:
IsServiceException - exception thrown if there is a problem with Interaction Server.
com.genesyslab.ail.exception.RequestFailedException