com.genesyslab.ail
Interface Agent

All Superinterfaces:
ConfigObject, IdObject, Person

public interface Agent
extends Person

An agent. To get an Agent interface, call the AilFactory.getPerson(java.lang.String) method, as shown in the following code snippet.

public class SimpleAgentExample
{
    public Agent exampleAgent;
    public SimpleAgentExample(AilFactory myAilFactory)
    {
        // Getting the Agent instance
        exampleAgent = (Agent) myAilFactory.getPerson ("my_Agent_ID");
    }
}

Call the Agent methods to:

First log your agent into the place, by calling the login or loginMultimedia method, in order to associate your agent with the place, to access interactions, and to access MCR features.

Changes in the place's DN and media state, and in associated interactions, generate events. For example, these events propagate the agent status on the place (DN and media status) or interactions' status. Your application can listen for these events and update its state accordingly.

Create and add an AgentListener to this Agent interface to:

The following code snippet shows how to add an AgentListener to the Agent interface:

public class SimpleAgentExample implements AgentListener
{
    public SimpleAgentExample (Agent exampleAgent)
    {
        //Adding the listener
        exampleAgent.addAgentListener(this);
    }
    //Implementation of the listener methods
    //...
}

Note: When the monitored agent is logged out of the place, this listener no longer receives events regarding this place or interactions on this place.

See Also:
AgentListener

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.IdObject
IdObject.ObjectType
 
Method Summary
 void addAgentListener(AgentListener listener)
          Adds a listener.
 java.util.Map afterCallWork(java.lang.String queue, java.util.Map reasons)
          Deprecated. Use afterCallWork( String, Map, Map ).
 java.util.Map afterCallWork(java.lang.String queue, java.util.Map reasons, java.util.Map tExtensions)
          Sets all the DNs of the current place to the 'after-call-work' state.
 Interaction createInteraction(Dn.Media media, Interaction parent)
          Deprecated. since 7.0 Dn.Media should be replaced by MediaType
 Interaction createInteraction(MediaType media, Interaction parent, java.lang.String queue)
          Creates a new interaction on a place of this agent.
 Interaction createInteractionOpenMedia(java.lang.String mediaType, java.lang.String interactionType, java.lang.String interactionSubtype, java.lang.String id, java.lang.String queue, java.lang.String subject, Interaction parent, java.util.Map userData)
          Creates a new Open Media interaction without submitting it.
 java.util.Collection getAgentGroups()
          Returns the AgentGroups to which this Agent belongs as a Collection of AgentGroup.
 java.util.Collection getAvailableMedia()
          Returns the available media for this agent.
 CallbackService getCallbackService()
          Returns the callback service associated with the current place.
 Place getDefaultPlace()
          Returns the default place as defined in the Configuration Layer.
 java.util.Collection getDns()
          Returns all the DNs of the current place.
 java.util.Collection getDns(Dn.Media media)
          Deprecated. use instead getDns().
 java.util.Collection getInteractions()
          Returns the active interactions on the current place.
 java.util.Collection getLoggedDns()
          Returns the DNs on which this agent is currently logged in.
 java.util.Collection getLoggedDns(Dn.Media media)
          Deprecated. use instead getLoggedDns().
 java.lang.String getLoginId(Dn dn)
          Returns the agent's login identifier for this DN.
 java.util.Collection getLoginIds()
          Returns the agent's login identifiers configured in the 'Agent Info' tab of the Configuration Layer.
 java.util.Map getLoginIdsBySwitch()
          Returns the agent's login identifiers per switch.
 OutboundService getOutboundService()
          Returns the outbound service associated with the current place.
 Place getPlace()
          Returns the current place.
 ResourceProperty getResourceProperty(java.lang.String key)
          Returns a resource property.
 java.lang.String getSignature()
          Returns the agent's signature, or the default signature (defined the application options) if this agent has no signature defined in the Configuration Layer.
 java.util.Collection getSkills()
          Returns the skills defined in the Configuration Layer.
 java.util.Collection getSupportedMedia()
          Returns the supported media types for this agent.
 java.util.Map login(Place place, java.lang.String loginId, java.lang.String password, java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Deprecated. Use login( Place, String, String, String, Dn.Workmode, Map, Map ).
 java.util.Map login(Place place, java.lang.String loginId, java.lang.String password, java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Logs this agent on all the DNs of this place.
 java.util.Map loginMultimedia(Place place, java.util.Collection mediaList, java.lang.String reason, java.lang.String reasonDescription)
          Logs this agent in the specified media.
 java.util.Map logout(java.lang.String queue, java.util.Map reasons)
          Deprecated. Use logout( String, Map, Map ).
 java.util.Map logout(java.lang.String queue, java.util.Map reasons, java.util.Map tExtensions)
          Logs the agent out of all the DNs of the current place.
 java.util.Map logoutMultimedia(java.util.Collection mediaList, java.lang.String reason, java.lang.String reasonDescription)
          Logs out the specified media.
 void moveToWorkbin(java.lang.String interactionId, Workbin workbin)
          Pulls an interaction, then puts it in the specified workbin.
 java.util.Map notReady(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Deprecated. Use notReady( String, Dn.Workmode, Map, Map ).
 java.util.Map notReady(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Sets all the DNs of the current place to not ready.
 java.util.Map notReadyMultimedia(java.util.Collection mediaList, java.lang.String reason, java.lang.String reasonDescription)
          Sets the specified media to not ready.
 InteractionMultimedia openInteraction(java.lang.String interactionId)
          Opens an interaction.
 java.util.Map ready(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Deprecated. Use ready( String, Dn.Workmode, Map, Map ).
 java.util.Map ready(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Sets all the DNs of the current place to ready.
 java.util.Map readyMultimedia(java.util.Collection mediaList, java.lang.String reason, java.lang.String reasonDescription)
          Sets the specified media to ready.
 void removeAgentListener(AgentListener listener)
          Removes a listener.
 void setResourceProperty(java.lang.String key, byte[] value)
          Sets a binary resource property.
 void setResourceProperty(java.lang.String aKey, java.lang.String aValue)
          Sets a string resource property.
 void setSignature(java.lang.String signature)
          Modifies the agent's signature.
 
Methods inherited from interface com.genesyslab.ail.Person
changePassword, checkPassword, getAnnex, getEmployeeId, getFirstName, getLastName, getLastPasswordErrorCode, getLastPasswordReason, getTenantId, getUserName, isAgent, isEnabled, isLastPasswordErrorCodeExternal, setAnnex
 
Methods inherited from interface com.genesyslab.ail.IdObject
getId, getObjectType
 
Methods inherited from interface com.genesyslab.ail.ConfigObject
exists
 

Method Detail

getDefaultPlace

Place getDefaultPlace()
Returns the default place as defined in the Configuration Layer.

Returns:
the default place or null if none is configured.

getPlace

Place getPlace()
Returns the current place.
When an agent logs into a DN, he is considered as sitting on the place of this DN. Only the last logged DN is taken into account. It means that, if he logs into a DN of another place, he is no more seen as sitting on the first place but on the one of the last logged DN. And this despite the fact that he is still logged on the first DN.
Test the DNs and media status to get the agent status on this place.

Returns:
the place or null if this place is not available.

getLoggedDns

java.util.Collection getLoggedDns(Dn.Media media)
Deprecated. use instead getLoggedDns().

Returns the DNs on which this agent is currently logged in.

Parameters:
media - the desired media type or null for all.
Returns:
a collection of Dn.

getLoggedDns

java.util.Collection getLoggedDns()
Returns the DNs on which this agent is currently logged in.

Returns:
a collection of Dn.

getDns

java.util.Collection getDns(Dn.Media media)
Deprecated. use instead getDns().

Returns all the DNs of the current place.

Parameters:
media - the desired media type or null for all.
Returns:
a collection of Dn.

getDns

java.util.Collection getDns()
Returns all the DNs of the current place.

Returns:
a collection of Dn.

getAgentGroups

java.util.Collection getAgentGroups()
Returns the AgentGroups to which this Agent belongs as a Collection of AgentGroup.


getSkills

java.util.Collection getSkills()
Returns the skills defined in the Configuration Layer.

Returns:
a collection of Skill.

getAvailableMedia

java.util.Collection getAvailableMedia()
Returns the available media for this agent.

Returns:
a collection of media names as String.

getSupportedMedia

java.util.Collection getSupportedMedia()
Returns the supported media types for this agent.

Returns:
a collection of MediaType.

getLoginIds

java.util.Collection getLoginIds()
Returns the agent's login identifiers configured in the 'Agent Info' tab of the Configuration Layer.

Returns:
a collection of String.

getLoginIdsBySwitch

java.util.Map getLoginIdsBySwitch()
Returns the agent's login identifiers per switch. Those identifiers are configured in the 'Agent Info' tab of the Configuration Layer.

Returns:
a map where the key is a Switch and the value a collection of LoginId.
Since:
6.5.302.00

getLoginId

java.lang.String getLoginId(Dn dn)
                            throws InvalidParameterException
Returns the agent's login identifier for this DN.

Parameters:
dn - the DN for which the login identifier is requested.
Returns:
the agent's login identifier.
Throws:
InvalidParameterException - if this agent has no login identifier configured on this DN's switch.

getSignature

java.lang.String getSignature()
Returns the agent's signature, or the default signature (defined the application options) if this agent has no signature defined in the Configuration Layer.

Returns:
the agent's signature.

setSignature

void setSignature(java.lang.String signature)
                  throws ConfigServiceException
Modifies the agent's signature.
This modification is committed into the Configuration Layer.

Parameters:
signature - the new signature.
Throws:
ConfigServiceException - if the Configuration Layer failed in updating the signature.

loginMultimedia

java.util.Map loginMultimedia(Place place,
                              java.util.Collection mediaList,
                              java.lang.String reason,
                              java.lang.String reasonDescription)
Logs this agent in the specified media.

Parameters:
place - the place where the agent attempts to log in.
mediaList - a collection of media names as String, or null to log the agent in all the available media on the place.
reason - the reason specified by this agent for this Login action.
reasonDescription - a String describing this reason.
Returns:
a map where the key is a media name as a String and the value an Exception for an error, or null if the operation is successful.

logoutMultimedia

java.util.Map logoutMultimedia(java.util.Collection mediaList,
                               java.lang.String reason,
                               java.lang.String reasonDescription)
Logs out the specified media. If mediaList is null, the place is also logged out of the Interaction Server. Otherwise, the place is still considered as 'logged in' in the Interaction Server, though it may no longer have any media logged in.

Parameters:
mediaList - a collection of media names as String, or null to logout all the available media on the place.
reason - the reason for this Logout action.
reasonDescription - a String describing this reason.
Returns:
a map where the key is a media name as a String and the value an Exception for an error, or null if the operation is successful.

readyMultimedia

java.util.Map readyMultimedia(java.util.Collection mediaList,
                              java.lang.String reason,
                              java.lang.String reasonDescription)
Sets the specified media to ready.

Parameters:
mediaList - a collection of media names as String, or null to set ready all the available media of the place where the agent is logged.
reason - the reason for this Ready action.
reasonDescription - a String describing this reason.
Returns:
a map where the key is a media name as a String and the value an Exception for an error or null if the operation is successful.

notReadyMultimedia

java.util.Map notReadyMultimedia(java.util.Collection mediaList,
                                 java.lang.String reason,
                                 java.lang.String reasonDescription)
Sets the specified media to not ready.

Parameters:
mediaList - a collection of media names as String, or null for all the available media on the place where the agent has been logged.
reason - the reason for this not-ready action.
reasonDescription - a String describing this reason.
Returns:
a map where the key is a media name as a String and the value an Exception for an error, or null if the operation is successful.

login

java.util.Map login(Place place,
                    java.lang.String loginId,
                    java.lang.String password,
                    java.lang.String queue,
                    Dn.Workmode workmode,
                    java.util.Map reasons,
                    java.util.Map tExtensions)
Logs this agent on all the DNs of this place.
It is assumed that all the DNs can be logged in using the same login ID.
Map result = myAgent.login(myPlace, "login", "password", "queue", null, null, null);
Map.Entry entry;
Iterator it = result.entrySet().iterator();
while (it.hasNext()) {
   entry = (Map.Entry) it.next();
   if (entry.getValue() == null) {
     System.out.println("Login succeeded for the DN " + entry.getKey());
   }
   else {
     System.out.println("Login failed for the DN " + entry.getKey());
     ((RequestFailedException) entry.getValue()).printStackTrace();
   }
}

Parameters:
place - the place where the agent attempts to log in. Can be null, in which case the method attempts to log the agent into this agent's default place.
loginId - the login ID of the agent.
password - the password for this login ID.
queue - the queue to apply this (Login) action to. Can be null.
workmode - the workmode to apply this (Login) action. If null, the value used is Dn.Workmode.UNKNOWN.
reasons - reasons specified by this agent for this Login action. Can be null.
tExtensions - additional switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Returns:
a map where for each DN in the place, the key is the DN ID as a String and the value either null if the action on this DN was successful, or a RequestFailedException if an error occurred.
See Also:
Place.login(java.lang.String, java.lang.String, java.lang.String, com.genesyslab.ail.Dn.Workmode, java.util.Map), Dn.login(java.lang.String, java.lang.String, java.lang.String, com.genesyslab.ail.Dn.Workmode, java.util.Map)

login

java.util.Map login(Place place,
                    java.lang.String loginId,
                    java.lang.String password,
                    java.lang.String queue,
                    Dn.Workmode workmode,
                    java.util.Map reasons)
Deprecated. Use login( Place, String, String, String, Dn.Workmode, Map, Map ).

Same as login( place, loginId, password, queue, workmode, reasons, null ).


logout

java.util.Map logout(java.lang.String queue,
                     java.util.Map reasons,
                     java.util.Map tExtensions)
Logs the agent out of all the DNs of the current place.
See also this code snippet.

Parameters:
queue - the queue to apply this Logout action. Can be null.
reasons - reasons specified by this agent for this Logout action. Can be null.
tExtensions - additional switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Returns:
a map where for each DN in the place, the key is the DN ID as a String and the value either null if the action on this DN was successful, or a RequestFailedException if an error occurred.
See Also:
Place.logout(), Dn.logout(java.lang.String, java.util.Map, java.util.Map)

logout

java.util.Map logout(java.lang.String queue,
                     java.util.Map reasons)
Deprecated. Use logout( String, Map, Map ).

Same as logout( queue, reasons, null ).


ready

java.util.Map ready(java.lang.String queue,
                    Dn.Workmode workmode,
                    java.util.Map reasons,
                    java.util.Map tExtensions)
Sets all the DNs of the current place to ready.
See also this code snippet.

Parameters:
queue - the queue to apply this Ready action. Can be null.
workmode - the workmode. Can be null.
reasons - reasons specified by this agent for this Ready action. Can be null.
tExtensions - additional switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Returns:
a map where for each DN in the place, the key is the DN ID as a String and the value either null if the action on this DN was successful, or a RequestFailedException if an error occurred.
See Also:
Place.ready(), Dn.ready(java.lang.String, com.genesyslab.ail.Dn.Workmode, java.util.Map, java.util.Map)

ready

java.util.Map ready(java.lang.String queue,
                    Dn.Workmode workmode,
                    java.util.Map reasons)
Deprecated. Use ready( String, Dn.Workmode, Map, Map ).

Same as ready( queue, workmode, reasons, null ).


notReady

java.util.Map notReady(java.lang.String queue,
                       Dn.Workmode workmode,
                       java.util.Map reasons,
                       java.util.Map tExtensions)
Sets all the DNs of the current place to not ready.
See also this code snippet.

Parameters:
queue - the queue to apply this not-ready action. Can be null.
workmode - the workmode. Can be null.
reasons - reasons specified by this agent for this not-ready action. Can be null.
tExtensions - additional switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Returns:
a map where for each DN in the place, the key is the DN ID as a String and the value either null if the action on this DN was successful, or a RequestFailedException if an error occurred.
See Also:
Place.notReady(), Dn.notReady(java.lang.String, com.genesyslab.ail.Dn.Workmode, java.util.Map, java.util.Map)

notReady

java.util.Map notReady(java.lang.String queue,
                       Dn.Workmode workmode,
                       java.util.Map reasons)
Deprecated. Use notReady( String, Dn.Workmode, Map, Map ).

Same as notReady( queue, workmode, reasons, null ).


afterCallWork

java.util.Map afterCallWork(java.lang.String queue,
                            java.util.Map reasons,
                            java.util.Map tExtensions)
Sets all the DNs of the current place to the 'after-call-work' state.
This method has the same effect as calling notReady with the workmode Dn.Workmode.AFTER_CALL_WORK. See also this code snippet.

Parameters:
queue - the queue to apply this after-call-work action. action. Can be null.
reasons - reasons specified by this agent for this after-call-work action. work. Can be null.
tExtensions - additional switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Returns:
a map where for each DN in the place, the key is the DN ID as a String and the value either null if the action on this DN was successful, or a RequestFailedException if an error occurred.
See Also:
Place.afterCallWork(), Dn.afterCallWork(java.lang.String, java.util.Map, java.util.Map)

afterCallWork

java.util.Map afterCallWork(java.lang.String queue,
                            java.util.Map reasons)
Deprecated. Use afterCallWork( String, Map, Map ).

Same as afterCallWork( queue, reasons, nulll ).


createInteraction

Interaction createInteraction(Dn.Media media,
                              Interaction parent)
                              throws RequestFailedException
Deprecated. since 7.0 Dn.Media should be replaced by MediaType

Creates a new interaction on a DN of this agent.

Parameters:
media - the type of interaction to create. Valid media are Dn.Media.EMAIL, Dn.Media.VOICE and Dn.Media.COBROWSE.
parent - the parent interaction for the new interaction. Used when the media is Dn.Media.COBROWSE.
Returns:
the new Interaction. Depending on the requested media, you may want to cast it to InteractionMailOut, InteractionVoice or InteractionCoBrowse.
Throws:
InvalidParameterException - if the media does not allow a new interaction to be created
NoAvailableDnException - if this Agent has no available Dn for this action
RequestFailedException - if the request fails for any other reason

createInteraction

Interaction createInteraction(MediaType media,
                              Interaction parent,
                              java.lang.String queue)
                              throws RequestFailedException
Creates a new interaction on a place of this agent.

Parameters:
media - the type of interaction to create. Valid media are MediaType.EMAIL, MediaType.VOICE and MediaType.COBROWSE.
parent - the parent interaction for the new interaction. Used when media is MediaType.COBROWSE.
queue - the queue on which this interaction must be created. Can be null for voice interactions.
Throws:
InvalidParameterException - If the media does not allow a new interaction to be created.
NoAvailableDnException - If no DN is available for this action.
NoPlaceException - if the agent has no current place.
RequestFailedException - If the request fails for any other reason.

createInteractionOpenMedia

Interaction createInteractionOpenMedia(java.lang.String mediaType,
                                       java.lang.String interactionType,
                                       java.lang.String interactionSubtype,
                                       java.lang.String id,
                                       java.lang.String queue,
                                       java.lang.String subject,
                                       Interaction parent,
                                       java.util.Map userData)
                                       throws RequestFailedException
Creates a new Open Media interaction without submitting it. Use InteractionMultimedia.submit(java.lang.String) to put it into workflow.

AIL tests the specified media type. If AIL is connected to UCS (Universal Contact Server), it checks whether the mediaType belongs to the value list of the multimedia/open-media-saved-list option of your application's configuration template. If this is true, AIL saves the created open media interaction in UCS.

If the ID is null, and if UCS is connected, UCS creates an interaction ID for this new interaction. Otherwise, AIL creates a random ID.

Note: You cannot use predefined Genesys media types - that is, email or chat - to create your Open Media interaction.

Parameters:
mediaType - a media type defined in the "Business Attributes/Media Type" section of the Configuration Layer. Do not use email or chat values.
interactionType - an interaction type defined in the "Business Attributes/Interaction Type" section of the Configuration Layer.
interactionSubtype - an interaction subtype defined in the "Business Attributes/Interaction Subtype" values.
id - the customer interaction ID when the interaction is received from a customer server, not a Genesys server.
queue - - parameter is ignored -
subject - the interaction subject.
parent - the parent interaction; or null if there is no parent.
userData - the customer data or useful additional data. Can be null.
Returns:
the new interaction.
Throws:
NoPlaceException - if the agent has no current place.
RequestFailedException

openInteraction

InteractionMultimedia openInteraction(java.lang.String interactionId)
                                      throws RequestFailedException
Opens an interaction.
Once the interaction was opened, it is active on the current place for treatment.

Parameters:
interactionId - the ID of the interaction to pull.
Returns:
the pulled interaction, or null if this ID is incorrect.
Throws:
NoPlaceException - if the agent has no current place.
RequestFailedException - if the request fails for other reason.

getInteractions

java.util.Collection getInteractions()
Returns the active interactions on the current place.

Returns:
a collection of Interaction.

getOutboundService

OutboundService getOutboundService()
Returns the outbound service associated with the current place. This object can be used to handle outbound features.

Returns:
the outbound service or null if there is no current place.

getCallbackService

CallbackService getCallbackService()
Returns the callback service associated with the current place. This object can be used to handle callback features.

Returns:
the callback service or null if there is no current place.

addAgentListener

void addAgentListener(AgentListener listener)
Adds a listener.

Parameters:
listener - a new listener.

removeAgentListener

void removeAgentListener(AgentListener listener)
Removes a listener.

Parameters:
listener - a previously added listener.

getResourceProperty

ResourceProperty getResourceProperty(java.lang.String key)
                                     throws RequestFailedException
Returns a resource property.

Parameters:
key - the resource identifier.
Returns:
a resource or null if the key does not exist.
Throws:
DatabaseServiceException - exception thrown if the request could not be performed.
InvalidParameterException - exception thrown if method parameters are invalid.
RequestFailedException

setResourceProperty

void setResourceProperty(java.lang.String key,
                         byte[] value)
                         throws RequestFailedException
Sets a binary resource property.

Parameters:
key - a resource identifier.
value - the value.
Throws:
DatabaseServiceException - exception thrown if the request could not be performed.
InvalidParameterException - exception thrown if method's parameters are invalid.
RequestFailedException

setResourceProperty

void setResourceProperty(java.lang.String aKey,
                         java.lang.String aValue)
                         throws RequestFailedException
Sets a string resource property.

Parameters:
aKey - a resource identifier.
aValue - the value.
Throws:
DatabaseServiceException - exception thrown if the request could not be performed.
InvalidParameterException - exception thrown if method's parameters are invalid.
RequestFailedException

moveToWorkbin

void moveToWorkbin(java.lang.String interactionId,
                   Workbin workbin)
                   throws RequestFailedException
Pulls an interaction, then puts it in the specified workbin.

Parameters:
interactionId - an interaction identifier.
workbin - the destination workbin.
Throws:
DatabaseServiceException - exception thrown if the request could not be performed.
InvalidParameterException - exception thrown if the method's parameters are invalid.
NoPlaceException - exception thrown if the agent has no current place.
RequestFailedException