com.genesyslab.ail
Interface Dn

All Superinterfaces:
AbstractDn, ConfigObject, ConfigObjectListener, java.util.EventListener, IdObject, Possible

public interface Dn
extends AbstractDn

Representation of a DN, that is, a switch resource (of type voice) that is typically associated with an agent.

To get a Dn interface, you can either call the AilFactory.getDn(java.lang.String) method or use the Place and Agent interfaces. The following code snippet shows how to get a Dn interface using your application's AilFactory instance.

public class SimpleDnExample
{
    public Dn exampleDn;
    public SimpleDnExample(AilFactory myAilFactory)
    {
        // Getting the Dn
        exampleDn = myAilFactory.getDn("my_DN_ID");
    }
}

Call the Dn methods to:

To determine whether an action is possible at a certain time, test the corresponding Dn.Action by calling the isPossible method. For example, you can use the possible actions to activate or deactivate buttons that make calls to the corresponding Dn method.

Changes in the DN's state, and in associated interactions, generate events. Your application can listen for these events and update its state accordingly.
Create and add a DnListener to this Dn interface to:

The following code snippet shows how to add a DnListener to the Dn interface:

public class SimpleDnExample implements DnListener
{
    public SimpleDnExample(Dn exampleDn)
    {
        //Adding the listener
        exampleDn.addDnListener(this);
    }
    //Implementation of the listener methods
    //...
}

See Also:
DnListener, DnEvent, InteractionEvent

Nested Class Summary
static class Dn.Action
          Enum for the possible actions to take on a DN.
static class Dn.Media
          Deprecated. A DN is now only of type VOICE.
static class Dn.Status
          Enum for the possible statuses.
static class Dn.Workmode
          Enum for the work modes.
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.AbstractDn
AbstractDn.Type
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.IdObject
IdObject.ObjectType
 
Method Summary
 void afterCallWork()
          Same as afterCallWork( null, null, null ).
 void afterCallWork(java.lang.String queue, java.util.Map reasons)
          Same as afterCallWork( queue, reasons, null ).
 void afterCallWork(java.lang.String queue, java.util.Map reasons, java.util.Map tExtensions)
          Sets this DN to after-call work state.
 Interaction createInteraction(Interaction parent)
          Creates a new interaction on this DN.
 InteractionVoice dialNewCall(java.lang.String dn, java.lang.String location, InteractionVoice.MakeCallType callType, java.util.Map attachedData, java.util.Map reasons, java.util.Map tExtensions)
          Creates a new interaction, then dials the given directory number.
 Agent getAgent()
          Returns the agent currently logged in.
 java.util.Map getAnnex()
          Returns additional infomation about this DN.
 DnFunction getDnFunction()
          Returns the object in charge of managing DN functions such as Do Not Disturb (DND) and Hook.
 java.util.Map getLastReasonCode()
          Returns the last reason code and reasons data used for an action on this DN.
 java.util.Collection getLoggedQueues()
          Returns queues the agent is logged in.
 Dn.Media getMedia()
          Deprecated. Dn.Media is deprecated.
 Place getPlace()
          Returns the Place to which this DN is bound, or null if this DN is not bound to a Place.
 boolean[] getPossibleWorkmodes()
          Returns an array of availability of the different workmodes usable on this DN.
 Dn.Status getStatus()
          Returns the current status.
 Dn.Workmode getWorkmode()
          Gets the current workmode of the agent.
 boolean isWorkmodePossible(Dn.Workmode workmode)
          Checks if a workmode is available on this Dn.
 void login(java.lang.String loginId, java.lang.String password, java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Same as login( loginId, password, queue, workmode, reasons, null ).
 void login(java.lang.String loginId, java.lang.String password, java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Logs in this DN on this queue.
 void logout()
          Same as logout( null, null, null ).
 void logout(java.lang.String queue, java.util.Map reasons)
          Same as logout( queue, reasons, null ).
 void logout(java.lang.String queue, java.util.Map reasons, java.util.Map tExtensions)
          Logs out this DN.
 void notReady()
          Same as notReady( null, null, null, null ).
 void notReady(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Same as notReady( queue, workmode, reasons, null ).
 void notReady(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Sets this DN to not ready.
 void ready()
          Same as ready( null, null, null, null ).
 void ready(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons)
          Same as ready( queue, workmode, reasons, null ).
 void ready(java.lang.String queue, Dn.Workmode workmode, java.util.Map reasons, java.util.Map tExtensions)
          Sets this DN in ready state.
 void releaseDn()
          Releases all the non-idle interactions sitting on this DN.
 void releaseInteraction(java.lang.String id)
          Releases this interaction sitting on this DN.
 void sendUserEvent(java.util.Map data)
          Sends a user event to the T-Server with attached data.
 void setIdleReason(java.lang.String queue, java.lang.String reason, java.util.Map reasons)
          Deprecated. This feature is deprecated in T-Server.
 void setIdleReason(java.lang.String queue, java.lang.String reason, java.util.Map reasons, java.util.Map tExtensions)
          Deprecated. This feature is deprecated in T-Server.
 
Methods inherited from interface com.genesyslab.ail.AbstractDn
activate, addDnListener, getAlias, getCallableNumber, getInteractions, getName, getSwitch, queryStatus, removeDnListener, unactivate
 
Methods inherited from interface com.genesyslab.ail.Possible
arePossible, isPossible
 
Methods inherited from interface com.genesyslab.ail.IdObject
getId, getObjectType
 
Methods inherited from interface com.genesyslab.ail.ConfigObject
exists
 
Methods inherited from interface com.genesyslab.ail.event.ConfigObjectListener
deleted
 

Method Detail

getMedia

Dn.Media getMedia()
Deprecated. Dn.Media is deprecated.

Returns the media type.


getAgent

Agent getAgent()
Returns the agent currently logged in.

Returns:
the logged agent or null if no agent is logged in.

getAnnex

java.util.Map getAnnex()
Returns additional infomation about this DN. This corresponds to the 'Annex' tab in the Configuration Layer.

Since:
7.6

getStatus

Dn.Status getStatus()
Returns the current status.


getLoggedQueues

java.util.Collection getLoggedQueues()
Returns queues the agent is logged in.

Returns:
a collection of queue names as String.

login

void login(java.lang.String loginId,
           java.lang.String password,
           java.lang.String queue,
           Dn.Workmode workmode,
           java.util.Map reasons)
           throws RequestFailedException
Same as login( loginId, password, queue, workmode, reasons, null ).

Throws:
RequestFailedException

login

void login(java.lang.String loginId,
           java.lang.String password,
           java.lang.String queue,
           Dn.Workmode workmode,
           java.util.Map reasons,
           java.util.Map tExtensions)
           throws RequestFailedException
Logs in this DN on this queue.

Parameters:
loginId - the login ID of the agent.
password - the password for this login ID.
queue - the queue where to log in.
workmode - the workmode. If null, Dn.Workmode.UNKNOWN is used.
reasons - reasons specified by this agent for this Login action. Can be null. Valid keys for this map are only Strings, and the values can be
  • a non-empty String,
  • an Integer,
  • a List of Byte or
  • a Map, recursively containing the same type of pairs.
Warning : If the value is an empty String ("") or null, the pair will not be taken into account.
tExtensions - switch-specific data. Can be null. Valid keys and values are the same as for reasons. Refer to your T-Server documentation for further information.
Throws:
RequestFailedException

logout

void logout(java.lang.String queue,
            java.util.Map reasons,
            java.util.Map tExtensions)
            throws RequestFailedException
Logs out this DN.

Parameters:
queue - the queue to apply this Logout action to.
reasons - reasons specified by this agent for this Logout action. Can be null. See login(String, String, String, Dn.Workmode, Map, Map) for valid keys and values.
tExtensions - switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Throws:
RequestFailedException

logout

void logout(java.lang.String queue,
            java.util.Map reasons)
            throws RequestFailedException
Same as logout( queue, reasons, null ).

Throws:
RequestFailedException

logout

void logout()
            throws RequestFailedException
Same as logout( null, null, null ).

Throws:
RequestFailedException

ready

void ready(java.lang.String queue,
           Dn.Workmode workmode,
           java.util.Map reasons,
           java.util.Map tExtensions)
           throws RequestFailedException
Sets this DN in ready state.

Parameters:
queue - the queue to apply this ready action to.
workmode - the workmode. If null, Dn.Workmode.UNKNOWN is used.
reasons - reasons specified by this agent for this Logout action. Can be null. See login(String, String, String, Dn.Workmode, Map, Map) for valid keys and values.
tExtensions - switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Throws:
RequestFailedException

ready

void ready(java.lang.String queue,
           Dn.Workmode workmode,
           java.util.Map reasons)
           throws RequestFailedException
Same as ready( queue, workmode, reasons, null ).

Throws:
RequestFailedException

ready

void ready()
           throws RequestFailedException
Same as ready( null, null, null, null ).

Throws:
RequestFailedException

notReady

void notReady(java.lang.String queue,
              Dn.Workmode workmode,
              java.util.Map reasons,
              java.util.Map tExtensions)
              throws RequestFailedException
Sets this DN to not ready.

Parameters:
queue - the queue to apply this Not-ready action to.
workmode - the workmode. If null, Dn.Workmode.UNKNOWN is used.
reasons - reasons specified by this agent for this Logout action. Can be null. See login(String, String, String, Dn.Workmode, Map, Map) for valid keys and values.
tExtensions - additional data that take into account switch-specific features. Can be null.
Throws:
RequestFailedException

notReady

void notReady(java.lang.String queue,
              Dn.Workmode workmode,
              java.util.Map reasons)
              throws RequestFailedException
Same as notReady( queue, workmode, reasons, null ).

Throws:
RequestFailedException

notReady

void notReady()
              throws RequestFailedException
Same as notReady( null, null, null, null ).

Throws:
RequestFailedException

afterCallWork

void afterCallWork(java.lang.String queue,
                   java.util.Map reasons,
                   java.util.Map tExtensions)
                   throws RequestFailedException
Sets this DN to after-call work state.
The after-call work state is actually an extension of the not-ready state. This state means that the agent is not ready for receiving another call, for example, he is working on another task.
This method has the same effect as calling notReady( queue, Workmode.AFTER_CALL_WORK, reasons, tExtensions ).

Parameters:
queue - the queue to apply this After-call work action to.
reasons - reasons specified by this agent for this Logout action. Can be null. See login(String, String, String, Dn.Workmode, Map, Map) for valid keys and values.
tExtensions - switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Throws:
RequestFailedException

afterCallWork

void afterCallWork(java.lang.String queue,
                   java.util.Map reasons)
                   throws RequestFailedException
Same as afterCallWork( queue, reasons, null ).

Throws:
RequestFailedException

afterCallWork

void afterCallWork()
                   throws RequestFailedException
Same as afterCallWork( null, null, null ).

Throws:
RequestFailedException

setIdleReason

void setIdleReason(java.lang.String queue,
                   java.lang.String reason,
                   java.util.Map reasons,
                   java.util.Map tExtensions)
                   throws RequestFailedException
Deprecated. This feature is deprecated in T-Server.

Sets the reason why this DN is idle.

Parameters:
queue - the queue to apply this idle reason to.
reason - the reason for the idle state.
reasons - reasons specified by this agent for this Logout action. Can be null. See login(String, String, String, Dn.Workmode, Map, Map) for valid keys and values.
tExtensions - switch-specific data. Can be null. Refer to your T-Server documentation for further information.
Throws:
RequestFailedException

setIdleReason

void setIdleReason(java.lang.String queue,
                   java.lang.String reason,
                   java.util.Map reasons)
                   throws RequestFailedException
Deprecated. This feature is deprecated in T-Server.

Same as setIdleReason( queue, reason, reasons, tExtensions ).

Throws:
RequestFailedException

createInteraction

Interaction createInteraction(Interaction parent)
                              throws RequestFailedException
Creates a new interaction on this DN. The interaction is created only if an agent is logged on this DN.

Parameters:
parent - the parent interaction for the new interaction. Not used anymore. Must be null. In the history, the created interaction would appear as a child of the given parent interaction but only for the Dn.Media.COBROWSE.
Returns:
the new interaction. You may cast it to another interaction type. As all DNs are now voice DNs, this interaction is an InteractionVoice.
Throws:
NoAvailableDnException - if no agent is logged.
RequestFailedException - If the request fails for another reason.

dialNewCall

InteractionVoice dialNewCall(java.lang.String dn,
                             java.lang.String location,
                             InteractionVoice.MakeCallType callType,
                             java.util.Map attachedData,
                             java.util.Map reasons,
                             java.util.Map tExtensions)
                             throws RequestFailedException
Creates a new interaction, then dials the given directory number.

Parameters:
dn - the DN to dial on or null if you don't want to specify one.
location - the T-Server name of the switch to be used. Typically used to transfer user data along with the call in multi-site contact centers. Can be null.
callType - the type of call to make.
attachedData - attached data for this new phone call.
reasons - user defined reasons for this call.
tExtensions - additional data that take into account switch-specific features. Can be null.
Throws:
TelephonyServiceException - if an error occurred with the T-Server.
RequestFailedException - if the request fails for any other reason.

releaseDn

void releaseDn()
               throws RequestFailedException
Releases all the non-idle interactions sitting on this DN.

Throws:
TelephonyServiceException - if an occurred with the T-Server.
RequestFailedException - if the request fails for another reason.

releaseInteraction

void releaseInteraction(java.lang.String id)
                        throws RequestFailedException
Releases this interaction sitting on this DN.

Parameters:
id - the ID of the Interaction to release.
Throws:
TelephonyServiceException - if an error occurred with the T-Server.
RequestFailedException - if the request fails for another reason.

sendUserEvent

void sendUserEvent(java.util.Map data)
                   throws RequestFailedException
Sends a user event to the T-Server with attached data.

Parameters:
data - the data to set in the user event as a map of key-values. If the "AttributeConnID" key is present, it is removed and its String value is used to fill the ConnID field of the user event.
Throws:
TelephonyServiceException - if an error occurred with the T-Server.
RequestFailedException - if the request fails for another reason.

getWorkmode

Dn.Workmode getWorkmode()
Gets the current workmode of the agent.

Returns:
the current workmode or null if not available.

isWorkmodePossible

boolean isWorkmodePossible(Dn.Workmode workmode)
Checks if a workmode is available on this Dn. Workmodes that are not possible should not be used in methods such as login(), notReady(), etc...

Parameters:
workmode - the workmode that has to be checked for availability.
Returns:
true if the workmode is possible.

getPossibleWorkmodes

boolean[] getPossibleWorkmodes()
Returns an array of availability of the different workmodes usable on this DN.

Returns:
an array indexed by the workmodes, containing true if available. Use the numeric constants of the Dn.Workmode enum.

getDnFunction

DnFunction getDnFunction()
Returns the object in charge of managing DN functions such as Do Not Disturb (DND) and Hook. This object performs those operations and registers to the corresponding events.


getLastReasonCode

java.util.Map getLastReasonCode()
Returns the last reason code and reasons data used for an action on this DN.


getPlace

Place getPlace()
Returns the Place to which this DN is bound, or null if this DN is not bound to a Place.