ccc.persistence
Interface ActionRepository


public interface ActionRepository

Repository for actions.

Author:
Civic Computing Ltd.

Method Summary
 java.util.List<ActionEntity> completed(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          Retrieve subset of actions not in the status SCHEDULED.
 long countCompleted()
          Count all actions not in the status SCHEDULED.
 long countPending()
          Count all actions in the status SCHEDULED.
 void create(ActionEntity action)
          Persist a newly created action.
 ActionEntity find(java.util.UUID actionId)
          Find an action from its ID.
 java.util.List<ActionEntity> latest(java.util.Date until)
          Retrieve the latest actions.
 java.util.List<ActionEntity> pending(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          Retrieve subset of actions in the status SCHEDULED.
 

Method Detail

latest

java.util.List<ActionEntity> latest(java.util.Date until)
Retrieve the latest actions.

Parameters:
until - Cut off date.
Returns:
All SCHEDULED actions with an execute_after date less than the specified date.

pending

java.util.List<ActionEntity> pending(java.lang.String sort,
                                     SortOrder sortOrder,
                                     int pageNo,
                                     int pageSize)
Retrieve subset of actions in the status SCHEDULED.

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 list of actions.

completed

java.util.List<ActionEntity> completed(java.lang.String sort,
                                       SortOrder sortOrder,
                                       int pageNo,
                                       int pageSize)
Retrieve subset of actions not in the status SCHEDULED.

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 list of actions.

countCompleted

long countCompleted()
Count all actions not in the status SCHEDULED.

Returns:
The number of actions.

countPending

long countPending()
Count all actions in the status SCHEDULED.

Returns:
The number of actions.

find

ActionEntity find(java.util.UUID actionId)
Find an action from its ID.

Parameters:
actionId - The action's ID.
Returns:
The corresponding action.

create

void create(ActionEntity action)
Persist a newly created action.

Parameters:
action - The action to persist.


Copyright © 2010. All Rights Reserved.