|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.ActionsEJB
@RolesAllowed(value={}) @RunAs(value="ACTION_EXECUTE") public class ActionsEJB
EJB implementation of the Actions
.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Actions |
---|
NAME |
Constructor Summary | |
---|---|
ActionsEJB()
Constructor. |
Method Summary | ||
---|---|---|
void |
cancel(java.util.UUID actionId)
Cancel a scheduled action. |
|
protected void |
checkPermission(java.lang.String... permissions)
Check that the current user has ONE OF the specified permissions. |
|
protected void |
checkRead(ResourceEntity r)
Check that a resource is readable by a user. |
|
protected void |
checkWrite(ResourceEntity r)
Check that a resource is write-able by a user. |
|
CommandFactory |
commands()
Accessor. |
|
ActionSummary |
create(Action action)
Create a new scheduled action. |
|
protected UserEntity |
currentUser()
Accessor. |
|
protected java.util.UUID |
currentUserId()
Accessor. |
|
protected
|
execute(Command<T> command)
Execute a command on behalf of the current user. |
|
void |
executeAll()
Executes all available actions whose 'execute after' date is in the past. |
|
protected java.util.Collection<? extends ResourceEntity> |
filterAccessibleTo(UserEntity u,
java.util.List<? extends ResourceEntity> resources)
Filter a collection of resources based on accessibility. |
|
protected IRepositoryFactory |
getRepoFactory()
Accessor. |
|
protected javax.ejb.TimerService |
getTimerService()
Accessor. |
|
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 |
run(javax.ejb.Timer timer)
Run the scheduled action. |
|
void |
start()
Start the scheduler running. |
|
void |
stop()
Stop the scheduler running. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
protected UserEntity |
userForId(java.util.UUID userId)
Look up the user for the specified ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionsEJB()
Method Detail |
---|
@RolesAllowed(value="ACTION_EXECUTE") public void executeAll()
executeAll
in interface Actions
@RolesAllowed(value="ACTION_LIST") public PagedCollection<ActionSummary> listPendingActions(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
listPendingActions
in interface Actions
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.
@RolesAllowed(value="ACTION_LIST") public PagedCollection<ActionSummary> listCompletedActions(java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
listCompletedActions
in interface Actions
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.
@RolesAllowed(value="ACTION_CANCEL") public void cancel(java.util.UUID actionId)
cancel
in interface Actions
actionId
- The id of the action to cancel.@RolesAllowed(value="ACTION_CREATE") public ActionSummary create(Action action)
create
in interface Actions
action
- The action to create.
@RolesAllowed(value="ACTION_LIST") public ActionSummary retrieve(java.util.UUID actionId)
retrieve
in interface Actions
actionId
- The action's ID.
@RolesAllowed(value="ACTION_SCHEDULE") public void start()
start
in interface Scheduler
@RolesAllowed(value="ACTION_SCHEDULE") public void stop()
stop
in interface Scheduler
@RolesAllowed(value="ACTION_SCHEDULE") public boolean isRunning()
isRunning
in interface Scheduler
public void run(javax.ejb.Timer timer)
timer
- The timer that called this method.protected IRepositoryFactory getRepoFactory()
public CommandFactory commands()
protected final javax.ejb.TimerService getTimerService()
protected final <T> T sudoExecute(Command<T> command, java.util.UUID actorId, java.util.Date happenedOn)
T
- The command's return type.command
- The command to execute.actorId
- The actor executing the command.happenedOn
- When the command was executed.
protected final <T> T execute(Command<T> command)
T
- The command's return type.command
- The command to execute.
protected UserEntity userForId(java.util.UUID userId)
userId
- The user's ID.
protected UserEntity currentUser()
protected java.util.UUID currentUserId()
protected void checkRead(ResourceEntity r)
r
- The resource to check.protected void checkWrite(ResourceEntity r)
r
- The resource to check.protected void checkPermission(java.lang.String... permissions)
permissions
- The permissions to check.protected java.util.Collection<? extends ResourceEntity> filterAccessibleTo(UserEntity u, java.util.List<? extends ResourceEntity> resources)
u
- The user reading the collection.resources
- The un-filtered collection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |