com.genesyslab.omsdk.qil.applicationblocks.monitoring
Class AdHocManagement

java.lang.Object
  extended bycom.genesyslab.omsdk.qil.applicationblocks.monitoring.AdHocManagement

public class AdHocManagement
extends java.lang.Object

Shows how to use the QIL ad hoc management features. This class assumes that the QIL factory has already been successfully initialized.


Constructor Summary
AdHocManagement()
           
 
Method Summary
 void changeOperationMode(boolean supervisor)
          Switches between supervisor and reporter modes.
 QILInteractionList findInteractionsSQL(java.lang.String queueID, java.lang.String sqlCriteria, java.lang.String orderBy)
          Synchronously retrieves interactions from a queue.
 QILInteractionList findInteractionsSQLAsync(java.lang.String queueID, java.lang.String sqlCriteria, java.lang.String orderBy, java.lang.Runnable command)
          Asynchronously retrieves interactions from a queue.
 void leave(java.lang.String ixnID, java.lang.String reason, java.lang.String code)
          Leaves an interaction.
 QILInteractionList lock(java.lang.String queueID, java.lang.String ixnID, java.lang.String reason, java.lang.String code)
          Locks the interaction.
 void pull(java.lang.String ixnID, java.lang.String reason, java.lang.String code)
          Pulls an interaction.
 void stopProcessing(java.lang.String ixnID, java.lang.String reason, java.lang.String code)
          Stops processing of an interaction.
 void unlock(java.lang.String ixnID, java.lang.String reason, java.lang.String code)
          Unlocks an interaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdHocManagement

public AdHocManagement()
Method Detail

changeOperationMode

public final void changeOperationMode(boolean supervisor)
                               throws QILUnsuccessfulModeChangeException
Switches between supervisor and reporter modes.

Parameters:
supervisor - true to change to supervisor mode; otherwise, false to change to reporter mode.
Throws:
QILUnsuccessfulModeChangeException - exception thrown if the change failed.

findInteractionsSQL

public QILInteractionList findInteractionsSQL(java.lang.String queueID,
                                              java.lang.String sqlCriteria,
                                              java.lang.String orderBy)
                                       throws QILRequestFailedException
Synchronously retrieves interactions from a queue.

Parameters:
queueID - queue ID
sqlCriteria - SQL criteria for finding interactions.
orderBy - order for the interactions to be returned (use the regular SQL syntax.)
Returns:
list of interaction IDs.
Throws:
QILRequestFailedException - exception thrown if the request fails.

findInteractionsSQLAsync

public QILInteractionList findInteractionsSQLAsync(java.lang.String queueID,
                                                   java.lang.String sqlCriteria,
                                                   java.lang.String orderBy,
                                                   java.lang.Runnable command)
                                            throws QILRequestFailedException
Asynchronously retrieves interactions from a queue. While the Interaction Server handles the request, this method runs the command passed in parameters.

Parameters:
queueID - queue ID.
sqlCriteria - SQL criteria for finding interactions.
orderBy - order for the interactions to be returned (use the regular SQL syntax.)
command - the command to be executed.
Returns:
list of interaction IDs.
Throws:
QILRequestFailedException - exception thrown if the request fails.

lock

public QILInteractionList lock(java.lang.String queueID,
                               java.lang.String ixnID,
                               java.lang.String reason,
                               java.lang.String code)
                        throws QILRequestFailedException,
                               QILOperationalModeRestrictionException
Locks the interaction. To unlock, release the returned QILInteractionList, or call the unlock(String, String, String) method.

Parameters:
queueID - queue ID.
ixnID - interaction ID.
reason - reason to lock.
code - code, used to lock.
Returns:
list of interactions.
Throws:
QILRequestFailedException - exception thrown if the request fails.
QILOperationalModeRestrictionException - exception thrown if the QIL application's operational mode does not allow this action.

unlock

public void unlock(java.lang.String ixnID,
                   java.lang.String reason,
                   java.lang.String code)
            throws QILRequestFailedException,
                   QILOperationalModeRestrictionException
Unlocks an interaction.

Parameters:
ixnID - interaction ID.
reason - reason to unlock.
code - code, used to unlock.
Throws:
QILRequestFailedException - exception thrown if the request fails.
QILOperationalModeRestrictionException - exception thrown if the QIL application's operational mode does not allow this action.

pull

public void pull(java.lang.String ixnID,
                 java.lang.String reason,
                 java.lang.String code)
          throws QILRequestFailedException,
                 QILOperationalModeRestrictionException
Pulls an interaction.

Parameters:
ixnID - ID of the interaction to be pulled.
reason - reason to pull.
code - code.
Throws:
QILRequestFailedException - exception thrown if the request fails.
QILOperationalModeRestrictionException - exception thrown if the QIL application's operational mode does not allow this action.
See Also:
leave(String, String, String)

leave

public void leave(java.lang.String ixnID,
                  java.lang.String reason,
                  java.lang.String code)
           throws QILRequestFailedException,
                  QILOperationalModeRestrictionException
Leaves an interaction.

Parameters:
ixnID - interaction ID.
reason - reason.
code - code.
Throws:
QILRequestFailedException - exception thrown if the request fails.
QILOperationalModeRestrictionException - exception thrown if the QIL application's operational mode does not allow this action.

stopProcessing

public void stopProcessing(java.lang.String ixnID,
                           java.lang.String reason,
                           java.lang.String code)
                    throws QILRequestFailedException,
                           QILOperationalModeRestrictionException
Stops processing of an interaction.

Parameters:
ixnID - interaction ID.
reason - reason.
code - code.
Throws:
QILRequestFailedException - exception thrown if the request fails.
QILOperationalModeRestrictionException - exception thrown if the QIL application's operational mode does not allow this action.