com.pega.pegarules.pub.context
Interface AgentUtils


public interface AgentUtils

Utilities for managing agent queues.

A reference to the global AgentUtils object can be obtained using the getAgentUtils PublicAPI method.

Version:
$Revision: 31 $ $Date: 2009-06-24 09:38:04 -0400 (Wed, 24 Jun 2009) $
Author:
Tim Miranda

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 java.util.List checkQueuesEnabled(java.lang.String aRuleSetName)
          For the specified Agent name, return a list of booleans indicating the running status of each individual queue defined in that Agent.
 java.util.List getAgentNames()
          Returns the names of all Agents currently configured on this node.
 StringMap getQueue(java.lang.String aRuleSetName, int aQueueNumber)
          For the specified Agent name (ruleset name) and the specified row number in that Agent, return state data about that agent queue.
 java.util.List getQueues(java.lang.String aRuleSetName)
          For the specified Agent name (ruleset name), return state data about each queue owned by this Agent.
 boolean isQueueEnabled(java.lang.String aRuleSetName, int aQueueNumber)
          Determine whether the specified queue is currently enabled or not.
 boolean restartQueue(java.lang.String aRuleSetName)
          Restart all queues for the given Agent.
 boolean restartQueue(java.lang.String aRuleSetName, int aQueueNumber)
          Restart an agent queue.
 boolean startQueue(java.lang.String aRuleSetName)
          Start all currently disabled queues for the specified agent.
 boolean startQueue(java.lang.String aRuleSetName, int aQueueNumber)
          Start an agent queue.
 boolean terminateQueue(java.lang.String aRuleSetName)
          Terminate all currently enabled queues for the specified agent.
 boolean terminateQueue(java.lang.String aRuleSetName, int aQueueNumber)
          Terminate an agent queue.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values
Method Detail

startQueue

boolean startQueue(java.lang.String aRuleSetName,
                   int aQueueNumber)
Start an agent queue. If the agent queue is currently running, method will return false. Running queues must first be terminated with terminateAgentQueue first before being started again.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
aQueueNumber - The queue number corresponding to the desired row in the Rule-Agent-Queue record.
Returns:
boolean Returns true if the agent queue was found and successfully asked to start, false if the agent queue was not found.

startQueue

boolean startQueue(java.lang.String aRuleSetName)
Start all currently disabled queues for the specified agent. If a queue is already enabled, it will be ignored.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
Returns:
boolean Returns true if the Agent was found, false if the Agent was not found.

terminateQueue

boolean terminateQueue(java.lang.String aRuleSetName,
                       int aQueueNumber)
Terminate an agent queue. If the agent queue is not currently running, or is disabled, this method will log an error to the console and return false. When a queue is terminated, it's status will be updated to reflect that it was terminated manually by this interface and not by an error or exception.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
aQueueNumber - The queue number corresponding to the desired row in the Rule-Agent-Queue record.
Returns:
boolean Returns true if the agent queue was found and successfully asked to terminate, false if the agent queue was not found.

terminateQueue

boolean terminateQueue(java.lang.String aRuleSetName)
Terminate all currently enabled queues for the specified agent. If a queue is already disabled, it will be ignored.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
Returns:
boolean Returns true if the Agent was found, false if the Agent was not found.

isQueueEnabled

boolean isQueueEnabled(java.lang.String aRuleSetName,
                       int aQueueNumber)
Determine whether the specified queue is currently enabled or not. An enabled queue is a queue that is either currently running or is scheduled to run at some future time, and hasn't been terminated due to error or manually by this interface.

Parameters:
aRuleSetName -
aQueueNumber -
Returns:
boolean Is queue enabled?

checkQueuesEnabled

java.util.List checkQueuesEnabled(java.lang.String aRuleSetName)
For the specified Agent name, return a list of booleans indicating the running status of each individual queue defined in that Agent. The list is returning in row order, row by row as defined in the Rule-Agent-Queue record.

Parameters:
aRuleSetName - Name of the Agent to query
Returns:
List A list of Boolean objects; true means the queue is enabled, false means the queue is disabled

getAgentNames

java.util.List getAgentNames()
Returns the names of all Agents currently configured on this node.

Returns:
List A List object containing 0 or more String objects

getQueues

java.util.List getQueues(java.lang.String aRuleSetName)
For the specified Agent name (ruleset name), return state data about each queue owned by this Agent. See getQueue for details on how that state data is formatted and returned

Parameters:
aRuleSetName - Name of the Agent to query
Returns:
List a List object containing 0 or more StringMap objects

getQueue

StringMap getQueue(java.lang.String aRuleSetName,
                   int aQueueNumber)
For the specified Agent name (ruleset name) and the specified row number in that Agent, return state data about that agent queue. This data is returned in a StringMap, which contains a series of name/value mappings (which are String objects). The mappings are:

Description: The text description of this agent queue row
IsEnabled: (true/false) Is this queue currently enabled, or has it been terminated (manually or due to error)?
IsPeriodic: (true/false) Is this queue executing periodically, or on a recurring calendar schedule?
RescheduleInterval: A textual description of this queue's recurring schedule.
LastRunStart: Time (standard PegaRULES time stamp; ISO format, GMT zone) when queue last run. If queue has never run since the node was started, this value will be blank ("")
LastRunFinish: Time (standard PegaRULES time stamp; ISO format, GMT zone) when queue last finished a run. If queue has never finished a run since the node was started, this value will be blank ("")
NextRunTarget: Time (standard PegaRULES time stamp; ISO format, GMT zone) when queue is next scheduled to run.
LastExceptionData: If queue is disabled, detailed text information on the last exception that occurred.

Parameters:
aRuleSetName - The name of the Agent (RuleSet name)
aQueueNumber - The row number (agent queue) to describe
Returns:
StringMap A StringMap object containing name/value mappings as described above

restartQueue

boolean restartQueue(java.lang.String aRuleSetName,
                     int aQueueNumber)
Restart an agent queue. If the agent queue is currently running it will be terminated first before starting it again.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
aQueueNumber - The queue number corresponding to the desired row in the Rule-Agent-Queue record.
Returns:
boolean Returns true if the agent queue was found and successfully asked to restart, false if the agent queue was not found.

restartQueue

boolean restartQueue(java.lang.String aRuleSetName)
Restart all queues for the given Agent. If an agent queue is currently running, it will be terminated first before starting it again.

Parameters:
aRuleSetName - The name of the agent (key to the Rule-Agent-Queue record) to modify.
Returns:
boolean Returns true if the agent was found and its queues were asked to restart.


Copyright © 2012 Pegasystems Inc. All Rights Reserved.