com.genesyslab.omsdk.qil
Class QILFactory

java.lang.Object
  extended bycom.genesyslab.omsdk.qil.QILFactory
All Implemented Interfaces:
com.genesyslab.omsdk.commons.core.OMSDKLibraryInterface

public abstract class QILFactory
extends java.lang.Object
implements com.genesyslab.omsdk.commons.core.OMSDKLibraryInterface

Entry point of Queued Interaction Layer.

The QILFactory instantiates internal classes and makes them available through interfaces. You do not instantiate objects directly in your code.
The QILFactory object is a singleton. This means that only one instance of the QILFactory object exists at runtime.
The QILFactory manages both the library initialization and release, and connections to the Interaction Server and the Configuration Layer.

Before you get a QILFactory instance, first initialize the open media common library by creating an OMSDKConnector object. This object manages the connections to servers that are required in order to use the QIL library.

To initialize the OMSDKConnector class:

The following code snippet shows how to initialize the OMSDKConnector class:

InitializationServices qilInitServices = QILFactory.getInitializationServices(); InitializationParameters ip = new InitializationParameters(
    "ConfigServerPrimaryHost",
    "ConfigServerPrimaryPort",
    "back up port",
    "back up host",
    "ApplicationName",
    data.getReconnectionPeriod(),
    data.getReconnectionAttempts());
ip.addInitializationServices(qilInitServices);

OMSDKConnector.initialize(ip);
OMSDKConnector connector = OMSDKConnector.getInstance();

You can now initialize the QIL library.

Create a QILInitializationParameters object, then call the QILFactory.initialize static method, as shown in the following code snippet:

// Get initialization parameters
QILInitializationParameters initParameters = new QILInitializationParameters();

// Initialize
QILFactory.initialize(initParameters);

Then, to get a QILFactory instance, call the QILFactory.getQILFactory() static method, as shown here:

QILFactory qilFactory = QILFactory.getQILFactory();

Note: When terminating your application, release your QILFactory instance by calling the releaseFactory() method to properly release objects made available through this interface.

Use the QILFactory class to access information about:

Since:
7.1.000.00

Method Summary
abstract  void changeOperationalMode(QILOperationalMode newMode)
          Modifies the QIL application's operational mode.
abstract  java.util.Collection getAllQueues()
          Returns a collection of all the queues defined in the Configuration Layer in the same tenant as the current application.
abstract  BusinessAttribute getBusinessAttribute(java.lang.String name)
          Returns the business attribute defined in the Configuration Layer with the specified name.
static InitializationServices getInitializationServices()
          Returns a com.genesyslab.omsdk.commons.InitializationServices containing service information for initializing the QIL library.
abstract  QILInteractionManager getInteractionManager()
          Returns the interaction manager.
abstract  BusinessAttribute getInteractionSubtypes()
          Returns the "Interaction Subtype" business attribute defined in the Configuration Layer for the current application's tenant.
This business attribute contains all the interaction subtypes defined for this tenant.
abstract  BusinessAttribute getInteractionTypes()
          Returns the "Interaction Type" business attribute defined in the Configuration Layer in the current application's tenant.
This business attribute contains all the interaction types defined for this tenant.
abstract  BusinessAttribute getMediaTypes()
          Returns the "Media Type" business attribute defined in the Configuration Layer in the current application's tenant.
abstract  QILOperationalMode getOperationalMode()
          Returns the QIL application's operational mode.
static QILFactory getQILFactory()
          Returns the instance of QILFactory.
abstract  QILQueue getQueue(java.lang.String id)
          Returns the queue with the specified ID, if it exists.
static void initialize(QILInitializationParameters config)
          Initializes the QILFactory instance with the specified parameters.
static void releaseFactory()
          Releases this instance and all the objects made available through this interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getQILFactory

public static QILFactory getQILFactory()
Returns the instance of QILFactory.

Note: Before calling this method, initialize the library as shown in this code snippet.

Returns:
instance of QILFactory
Throws:
QILUninitializedException - exception thrown if the factory is not already initialized.
Since:
7.1.000.00
See Also:
initialize

initialize

public static void initialize(QILInitializationParameters config)
                       throws QILInitializationException
Initializes the QILFactory instance with the specified parameters. Use this method as shown in this code snippet.
If the QILFactory is already initialized, no reinitialization occurs.

Parameters:
config - initialization parameters. NOTE: This parameter is reserved for future use. It has no effect in the current version, but null value is not allowed here.
Throws:
QILInitializationException - exception thrown if some internal service failed to initialize.

releaseFactory

public static void releaseFactory()
Releases this instance and all the objects made available through this interface.


getQueue

public abstract QILQueue getQueue(java.lang.String id)
                           throws QILRequestFailedException
Returns the queue with the specified ID, if it exists.

The queue ID corresponds to the queue name defined in the Configuration Layer for the current application's tenant.

Parameters:
id - ID of the queue to return.
Returns:
the queue with the specified ID; otherwise, null if not found.
Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.

getAllQueues

public abstract java.util.Collection getAllQueues()
                                           throws QILRequestFailedException
Returns a collection of all the queues defined in the Configuration Layer in the same tenant as the current application.
The returned collection is a copy and does not reflect changes (such as removed queues) that can occur after calling this method. To take those changes into account, add a QILQueueListener to QILQueue objects.

Returns:
Collection of QILQueue.
Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.
See Also:
QILQueue.addQueueListener(), QILQueueMonitorStatusEvent

getBusinessAttribute

public abstract BusinessAttribute getBusinessAttribute(java.lang.String name)
                                                throws QILRequestFailedException
Returns the business attribute defined in the Configuration Layer with the specified name.

Parameters:
name - the name of the attribute to be found.
Returns:
the business attribute with the specified name.
Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.

getMediaTypes

public abstract BusinessAttribute getMediaTypes()
                                         throws QILRequestFailedException
Returns the "Media Type" business attribute defined in the Configuration Layer in the current application's tenant.
This business attribute contains all the media types defined for this tenant.

Calling this method is equivalent to calling the getBusinessAttribute(java.lang.String) as shown here:
BusinessAttribute myMediaTypes = qilFactory.getBusinessAttribute("Media Type");

Returns:
the Media Type business attribute.
Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.
See Also:
QILInteraction.getMediaType()

getInteractionTypes

public abstract BusinessAttribute getInteractionTypes()
                                               throws QILRequestFailedException
Returns the "Interaction Type" business attribute defined in the Configuration Layer in the current application's tenant.
This business attribute contains all the interaction types defined for this tenant.

Calling this method is equivalent to calling the getBusinessAttribute(java.lang.String) as shown here:
BusinessAttribute myInteractionTypes = qilFactory.getBusinessAttribute("Interaction Type");

Returns:
the "Interaction Type" business attribute.
Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.
See Also:
QILInteraction.getType()

getInteractionSubtypes

public abstract BusinessAttribute getInteractionSubtypes()
                                                  throws QILRequestFailedException
Returns the "Interaction Subtype" business attribute defined in the Configuration Layer for the current application's tenant.
This business attribute contains all the interaction subtypes defined for this tenant.

Calling this method is equivalent to calling the getBusinessAttribute(java.lang.String) as shown here:
BusinessAttribute myInteractionSubtypes = qilFactory.getBusinessAttribute("Interaction Subtype");

Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.
See Also:
QILInteraction.getSubtype()

getInitializationServices

public static InitializationServices getInitializationServices()
Returns a com.genesyslab.omsdk.commons.InitializationServices containing service information for initializing the QIL library.


getInteractionManager

public abstract QILInteractionManager getInteractionManager()
                                                     throws QILOperationalModeRestrictionException
Returns the interaction manager. This manager is for supervisors who wish to pull interactions, modify their properties, place them into a specific queue, etc.
To get this manager, your application must be in QILOperationalMode.SUPERVISOR_MODE mode.

Returns:
the interaction manager.
Throws:
QILOperationalModeRestrictionException - exception thrown if the QIL application's mode does not allow the use of this method.
See Also:
QILInteractionManager, changeOperationalMode(QILOperationalMode), getOperationalMode()

getOperationalMode

public abstract QILOperationalMode getOperationalMode()
Returns the QIL application's operational mode.

Returns:
QIL running mode

changeOperationalMode

public abstract void changeOperationalMode(QILOperationalMode newMode)
                                    throws QILUnsuccessfulModeChangeException
Modifies the QIL application's operational mode.

Parameters:
newMode - new mode
Throws:
QILUnsuccessfulModeChangeException