com.genesyslab.omsdk.qil
Interface QILQueue


public interface QILQueue

Represents a queue, defined as a script object of type Interaction Queue in the Configuration Layer.
Changes in the queue's state, and in associated interactions, can generate events. Your application can listen for these events and update its state accordingly.

You can track changes by adding a QILQueueListener to this queue. Call the addQueueListener() method. The QILQueueListener gets QILQueueEvent events if the queue changes.

If the queue status is active, you can change this queue's monitoring status by calling the startMonitoring() and stopMonitoring() methods.

If this queue's monitoring status is MONITORED:

Since:
7.1.000.00
See Also:
isMonitored(), QILQueueEvent, QILQueueListener, QILInteractionEvent, QILInteractionListener

Method Summary
 void addInteractionListener(QILInteractionListener listener)
          Adds a QILInteractionListener to the listener list for interaction events.
 void addQueueListener(QILQueueListener listener)
          Adds a QILQueueListener to the listener list for queue events.
 QILQueryAsyncResult asyncGetInteractionsByQuery(QILInteractionQueryBySQL query, boolean shouldLock)
          Asynchronously retrieves a collection of interactions according to the given SQL criteria.
 java.util.Map getAnnex()
          Returns the queue's properties specified in the Configuration Layer.
 java.lang.String getID()
          Returns the queue ID.
 QILInteractionList getInteractionsByQuery(QILInteractionQueryBySQL query, boolean shouldLock)
          Retrieves a collection of interactions according to the given SQL criteria.
 QILQueueStatus getStatus()
          Deprecated. as of 7.2.007.00
 boolean isMonitored()
          Checks if this queue is being monitored.
 void releaseInteractionsList(QILInteractionList list)
          Releases the interactions list created by a call to the getInteractionsByQuery(QILInteractionQueryBySQL, boolean) method.
 void removeInteractionListener(QILInteractionListener listener)
          Removes a QILInteractionListener from the listener list for interaction events.
 void removeQueueListener(QILQueueListener listener)
          Removes a QILQueueListener from the listener list for queue events.
 void startMonitoring()
          Starts monitoring this queue.
 void stopMonitoring()
          Stops monitoring this queue.
 

Method Detail

getID

public java.lang.String getID()
Returns the queue ID.

This ID corresponds to the queue name defined in the Configuration Layer.

Returns:
the queue ID.
See Also:
QILFactory.getQueue(java.lang.String)

getAnnex

public java.util.Map getAnnex()
Returns the queue's properties specified in the Configuration Layer.
The returned collection is a copy of the original properties and does not reflect changes that can occur after calling this method.

Returns:
a Map of properties, where the key is a String for a section name, and the value is a second-level Map of options.
In the second-level Map, the key is a String for an option name and the value is a String for the corresponding option value.

getStatus

public QILQueueStatus getStatus()
Deprecated. as of 7.2.007.00

Returns this queue's current status.

Returns:
the current status of the queue.

startMonitoring

public void startMonitoring()
                     throws QILRequestFailedException
Starts monitoring this queue.

Throws:
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.

stopMonitoring

public void stopMonitoring()
                    throws QILQueueNotMonitoredException,
                           QILRequestFailedException
Stops monitoring this queue.

Throws:
QILQueueNotMonitoredException - exception thrown if the startMonitoring() method has not previously been issued on this queue.
QILRequestFailedException - exception thrown if the request failed. To get specific reasons for this error, see the subclasses of QILRequestFailedException.

isMonitored

public boolean isMonitored()
Checks if this queue is being monitored.

Returns:
true if the queue is being monitored, otherwise false.

addQueueListener

public void addQueueListener(QILQueueListener listener)
Adds a QILQueueListener to the listener list for queue events.

Use this listener to track queue changes:

Parameters:
listener - the listener to be added.
See Also:
QILQueueEvent

removeQueueListener

public void removeQueueListener(QILQueueListener listener)
Removes a QILQueueListener from the listener list for queue events.

Parameters:
listener - the listener to be removed.

addInteractionListener

public void addInteractionListener(QILInteractionListener listener)
Adds a QILInteractionListener to the listener list for interaction events.

Use this listener to monitor interaction activity on this queue. If an interaction's status changes, the added listener gets a QILInteractionEvent with the related QILInteraction interface.

Parameters:
listener - the listener to be added.
See Also:
QILInteraction

removeInteractionListener

public void removeInteractionListener(QILInteractionListener listener)
Removes a QILInteractionListener from the listener list for interaction events.

Parameters:
listener - the listener to be removed.

getInteractionsByQuery

public QILInteractionList getInteractionsByQuery(QILInteractionQueryBySQL query,
                                                 boolean shouldLock)
                                          throws QILRequestFailedException
Retrieves a collection of interactions according to the given SQL criteria. The retrieved interactions are ordered and can be locked. This method is synchronous.
Note: Call this method only in supervisor mode.

Parameters:
query - the SQL query.
shouldLock - true if the returned interactions should be locked.
Returns:
interaction IDs
Throws:
QILMaxNumberOfSnapshotsException - exception thrown if your application reaches the allowed maximum number of snapshots (configured in the Interaction Server)
QILNoInteractionFromIxnServer - exception thrown if the Interaction Server returns no interaction.
QILRequestFailedException
See Also:
QILFactory.getOperationalMode()

asyncGetInteractionsByQuery

public QILQueryAsyncResult asyncGetInteractionsByQuery(QILInteractionQueryBySQL query,
                                                       boolean shouldLock)
                                                throws QILRequestFailedException
Asynchronously retrieves a collection of interactions according to the given SQL criteria. The retrieved interactions are ordered and can be locked.
This method is the asynchronous equivalent of getInteractionsByQuery(). After you call this method, it immediatly returns.
Note: Call this method only in supervisor mode.

Parameters:
query - the SQL query.
shouldLock - true if the returned interactions should be locked.
Returns:
an instance of QILQueryAsyncResult to use for waiting until the operation completes.
Throws:
QILRequestFailedException

releaseInteractionsList

public void releaseInteractionsList(QILInteractionList list)
                             throws QILRequestFailedException
Releases the interactions list created by a call to the getInteractionsByQuery(QILInteractionQueryBySQL, boolean) method. This method also unlocks the interactions if they were locked. Genesys recommends releasing lists as soon as you are finished with them to avoid tying up Interaction Server resources.
Note: The lists are automatically released when the queue becomes unmonitored.

Parameters:
list - the list to be released.
Throws:
QILRequestFailedException