com.dtolabs.rundeck.core.dispatcher
Interface CentralDispatcher

All Known Implementing Classes:
NoCentralDispatcher, RundeckAPICentralDispatcher

public interface CentralDispatcher

CentralDispatcher interface provides methods for accessing central dispatcher of the app server. Implementations must have a constructor with a single Framework argument.


Field Summary
static java.lang.String FORMAT_XML
           
static java.lang.String FORMAT_YAML
           
 
Method Summary
 java.util.Collection<DeleteJobResult> deleteStoredJobs(java.util.Collection<java.lang.String> jobIds)
          Delete the jobs specified by the IDs, and return a list of results
 ExecutionFollowResult followDispatcherExecution(java.lang.String id, ExecutionFollowRequest request, ExecutionFollowReceiver receiver)
          Attempt to kill the execution of an item currently on the dispatcher queue
 ExecutionDetail getExecution(java.lang.String execId)
          Return execution detail for a particular execution.
 DispatcherResult killDispatcherExecution(java.lang.String id)
          Attempt to kill the execution of an item currently on the dispatcher queue
 java.util.Collection<QueuedItem> listDispatcherQueue()
          Deprecated. The rundeck API requires a project parameter, use listDispatcherQueue(String)
 java.util.Collection<QueuedItem> listDispatcherQueue(java.lang.String project)
          List the items on the dispatcher queue
 java.util.Collection<IStoredJob> listStoredJobs(IStoredJobsQuery query, java.io.OutputStream output, JobDefinitionFileFormat format)
          Return a list of stored jobs matching the query criteria
 java.util.Collection<IStoredJobLoadResult> loadJobs(ILoadJobsRequest request, java.io.File input, JobDefinitionFileFormat format)
          Upload Jobs.xml content to the server
 QueuedItemResult queueDispatcherJob(IDispatchedJob job)
          Add a script dispatch to the dispatcher queue
 QueuedItemResult queueDispatcherScript(IDispatchedScript dispatch)
          Add a script dispatch to the dispatcher queue
 void reportExecutionStatus(java.lang.String project, java.lang.String title, java.lang.String status, int failedNodeCount, int successNodeCount, java.lang.String tags, java.lang.String script, java.lang.String summary, java.util.Date start, java.util.Date end)
          Report execution status
 

Field Detail

FORMAT_XML

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

FORMAT_YAML

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

queueDispatcherScript

QueuedItemResult queueDispatcherScript(IDispatchedScript dispatch)
                                       throws CentralDispatcherException
Add a script dispatch to the dispatcher queue

Parameters:
dispatch - script dispatch descriptor
Returns:
QueuedItemResult indicating success/failure of queue request.
Throws:
CentralDispatcherException - if an error occurs

queueDispatcherJob

QueuedItemResult queueDispatcherJob(IDispatchedJob job)
                                    throws CentralDispatcherException
Add a script dispatch to the dispatcher queue

Parameters:
job - job execution reference definition
Returns:
QueuedItemResult indicating success/failure of queue request.
Throws:
CentralDispatcherException - if an error occurs

listDispatcherQueue

java.util.Collection<QueuedItem> listDispatcherQueue()
                                                     throws CentralDispatcherException
Deprecated. The rundeck API requires a project parameter, use listDispatcherQueue(String)

List the items on the dispatcher queue

Returns:
Collection of Strings listing the active dispatcher queue items
Throws:
CentralDispatcherException - if an error occurs

listDispatcherQueue

java.util.Collection<QueuedItem> listDispatcherQueue(java.lang.String project)
                                                     throws CentralDispatcherException
List the items on the dispatcher queue

Returns:
Collection of Strings listing the active dispatcher queue items
Throws:
CentralDispatcherException - if an error occurs

killDispatcherExecution

DispatcherResult killDispatcherExecution(java.lang.String id)
                                         throws CentralDispatcherException
Attempt to kill the execution of an item currently on the dispatcher queue

Parameters:
id - the ID string of the item
Returns:
result, success if the item was running and was successfully killed, false if the item could not be killed or the item was not running
Throws:
CentralDispatcherException - if an error occurs

followDispatcherExecution

ExecutionFollowResult followDispatcherExecution(java.lang.String id,
                                                ExecutionFollowRequest request,
                                                ExecutionFollowReceiver receiver)
                                                throws CentralDispatcherException
Attempt to kill the execution of an item currently on the dispatcher queue

Parameters:
id - the ID string of the item
Returns:
result, success if the item was running and was successfully killed, false if the item could not be killed or the item was not running
Throws:
CentralDispatcherException - if an error occurs

listStoredJobs

java.util.Collection<IStoredJob> listStoredJobs(IStoredJobsQuery query,
                                                java.io.OutputStream output,
                                                JobDefinitionFileFormat format)
                                                throws CentralDispatcherException
Return a list of stored jobs matching the query criteria

Parameters:
query - jobs query
output - optional outputstream to store the XML content
Returns:
collection of IStoredJob objects matching the query.
Throws:
CentralDispatcherException - if an error occurs

deleteStoredJobs

java.util.Collection<DeleteJobResult> deleteStoredJobs(java.util.Collection<java.lang.String> jobIds)
                                                       throws CentralDispatcherException
Delete the jobs specified by the IDs, and return a list of results

Parameters:
jobIds - the job IDs
Returns:
collection of DeleteJobResults
Throws:
CentralDispatcherException - if an error occurs

loadJobs

java.util.Collection<IStoredJobLoadResult> loadJobs(ILoadJobsRequest request,
                                                    java.io.File input,
                                                    JobDefinitionFileFormat format)
                                                    throws CentralDispatcherException
Upload Jobs.xml content to the server

Parameters:
request - load request parameters
input - XML file
Returns:
collection of IStoredJobLoadResult objects, indicating the status of each job in the input file.
Throws:
CentralDispatcherException - if an error occurs

reportExecutionStatus

void reportExecutionStatus(java.lang.String project,
                           java.lang.String title,
                           java.lang.String status,
                           int failedNodeCount,
                           int successNodeCount,
                           java.lang.String tags,
                           java.lang.String script,
                           java.lang.String summary,
                           java.util.Date start,
                           java.util.Date end)
                           throws CentralDispatcherException
Report execution status

Parameters:
project - project
title - execution title
status - result status, either 'succeed','cancel','fail'
failedNodeCount - count of failed nodes
successNodeCount - count of successful nodes
tags -
script - script content (can be null if summary specified)
summary - summary of execution (can be null if script specified)
start - start date (can be null)
end - end date (can be null)
Throws:
CentralDispatcherException

getExecution

ExecutionDetail getExecution(java.lang.String execId)
                             throws CentralDispatcherException
Return execution detail for a particular execution.

Parameters:
execId - ID of the execution
Returns:
Execution detail
Throws:
CentralDispatcherException