ccc.api.jaxrs
Class ActionsImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.ActionsImpl
All Implemented Interfaces:
Actions, Scheduler

public class ActionsImpl
extends JaxrsCollection
implements Actions

Implementation of the Actions interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Actions
NAME
 
Constructor Summary
ActionsImpl(Actions actions)
          Constructor.
 
Method Summary
 void cancel(java.util.UUID actionId)
          Cancel a scheduled action.
 ActionSummary create(Action action)
          Create a new scheduled action.
 void executeAll()
          Executes all available actions whose 'execute after' date is in the past.
 boolean isRunning()
          Query whether the scheduler is running.
 PagedCollection<ActionSummary> listCompletedActions(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          List all CCC actions that have been executed.
 PagedCollection<ActionSummary> listPendingActions(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          List all CCC actions that haven't yet been executed.
 ActionSummary retrieve(java.util.UUID actionId)
          Find the action with the specified ID.
 void start()
          Start the scheduler running.
 void stop()
          Stop the scheduler running.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionsImpl

public ActionsImpl(Actions actions)
Constructor.

Parameters:
actions - The actions delegate.
Method Detail

listCompletedActions

public PagedCollection<ActionSummary> listCompletedActions(java.lang.String sort,
                                                           SortOrder sortOrder,
                                                           int pageNo,
                                                           int pageSize)
List all CCC actions that have been executed.

Specified by:
listCompletedActions in interface Actions
Parameters:
sort - The field to sort on.
sortOrder - The order results be sorted in.
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A collection of action summaries, one per completed action.

listPendingActions

public PagedCollection<ActionSummary> listPendingActions(java.lang.String sort,
                                                         SortOrder sortOrder,
                                                         int pageNo,
                                                         int pageSize)
List all CCC actions that haven't yet been executed.

Specified by:
listPendingActions in interface Actions
Parameters:
sort - The field to sort on.
sortOrder - The order results be sorted in.
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A collection of action summaries, one per outstanding action.

create

public ActionSummary create(Action action)
Create a new scheduled action.

Specified by:
create in interface Actions
Parameters:
action - The action to create.
Returns:
A summary of the new action.

cancel

public void cancel(java.util.UUID actionId)
Cancel a scheduled action.

Specified by:
cancel in interface Actions
Parameters:
actionId - The id of the action to cancel.

executeAll

public void executeAll()
Executes all available actions whose 'execute after' date is in the past.

Specified by:
executeAll in interface Actions

retrieve

public ActionSummary retrieve(java.util.UUID actionId)
Find the action with the specified ID.

Specified by:
retrieve in interface Actions
Parameters:
actionId - The action's ID.
Returns:
A summary of the action.

isRunning

public boolean isRunning()
Query whether the scheduler is running.

Specified by:
isRunning in interface Scheduler
Returns:
True if the scheduler is running; false otherwise.

start

public void start()
Start the scheduler running.

Specified by:
start in interface Scheduler

stop

public void stop()
Stop the scheduler running.

Specified by:
stop in interface Scheduler


Copyright © 2010. All Rights Reserved.