com.dtolabs.rundeck.core.dispatcher
Class NoCentralDispatcher

java.lang.Object
  extended by com.dtolabs.rundeck.core.dispatcher.NoCentralDispatcher
All Implemented Interfaces:
CentralDispatcher

public final class NoCentralDispatcher
extends java.lang.Object
implements CentralDispatcher

NoCentralDispatcher is an implementation of the CentralDispatcher which throws exceptions indicating the operations are not supported.


Field Summary
 
Fields inherited from interface com.dtolabs.rundeck.core.dispatcher.CentralDispatcher
FORMAT_XML, FORMAT_YAML
 
Constructor Summary
NoCentralDispatcher(Framework framework)
          Required constructor
 
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()
          List the items on the dispatcher queue
 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 totalNodeCount, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCentralDispatcher

public NoCentralDispatcher(Framework framework)
Required constructor

Parameters:
framework - framework
Method Detail

queueDispatcherScript

public QueuedItemResult queueDispatcherScript(IDispatchedScript dispatch)
                                       throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Add a script dispatch to the dispatcher queue

Specified by:
queueDispatcherScript in interface CentralDispatcher
Parameters:
dispatch - script dispatch descriptor
Returns:
QueuedItemResult indicating success/failure of queue request.
Throws:
CentralDispatcherException - if an error occurs

queueDispatcherJob

public QueuedItemResult queueDispatcherJob(IDispatchedJob job)
                                    throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Add a script dispatch to the dispatcher queue

Specified by:
queueDispatcherJob in interface CentralDispatcher
Parameters:
job - job execution reference definition
Returns:
QueuedItemResult indicating success/failure of queue request.
Throws:
CentralDispatcherException - if an error occurs

listDispatcherQueue

public java.util.Collection<QueuedItem> listDispatcherQueue()
                                                     throws CentralDispatcherException
Description copied from interface: CentralDispatcher
List the items on the dispatcher queue

Specified by:
listDispatcherQueue in interface CentralDispatcher
Returns:
Collection of Strings listing the active dispatcher queue items
Throws:
CentralDispatcherException - if an error occurs

killDispatcherExecution

public DispatcherResult killDispatcherExecution(java.lang.String id)
                                         throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Attempt to kill the execution of an item currently on the dispatcher queue

Specified by:
killDispatcherExecution in interface CentralDispatcher
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

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

Specified by:
followDispatcherExecution in interface CentralDispatcher
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

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

Specified by:
listStoredJobs in interface CentralDispatcher
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

loadJobs

public java.util.Collection<IStoredJobLoadResult> loadJobs(ILoadJobsRequest request,
                                                           java.io.File input,
                                                           JobDefinitionFileFormat format)
                                                    throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Upload Jobs.xml content to the server

Specified by:
loadJobs in interface CentralDispatcher
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

public void reportExecutionStatus(java.lang.String project,
                                  java.lang.String title,
                                  java.lang.String status,
                                  int totalNodeCount,
                                  int successNodeCount,
                                  java.lang.String tags,
                                  java.lang.String script,
                                  java.lang.String summary,
                                  java.util.Date start,
                                  java.util.Date end)
                           throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Report execution status

Specified by:
reportExecutionStatus in interface CentralDispatcher
Parameters:
project - project
title - execution title
status - result status, either 'succeed','cancel','fail'
totalNodeCount - count of failed nodes
successNodeCount - count of successful nodes
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

listDispatcherQueue

public java.util.Collection<QueuedItem> listDispatcherQueue(java.lang.String project)
                                                     throws CentralDispatcherException
Description copied from interface: CentralDispatcher
List the items on the dispatcher queue

Specified by:
listDispatcherQueue in interface CentralDispatcher
Returns:
Collection of Strings listing the active dispatcher queue items
Throws:
CentralDispatcherException - if an error occurs

deleteStoredJobs

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

Specified by:
deleteStoredJobs in interface CentralDispatcher
Parameters:
jobIds - the job IDs
Returns:
collection of DeleteJobResults
Throws:
CentralDispatcherException - if an error occurs

getExecution

public ExecutionDetail getExecution(java.lang.String execId)
                             throws CentralDispatcherException
Description copied from interface: CentralDispatcher
Return execution detail for a particular execution.

Specified by:
getExecution in interface CentralDispatcher
Parameters:
execId - ID of the execution
Returns:
Execution detail
Throws:
CentralDispatcherException