org.sakaiproject.entitybroker.rest
Class EntityActionsManager

java.lang.Object
  extended by org.sakaiproject.entitybroker.rest.EntityActionsManager

public class EntityActionsManager
extends Object

Handles everything related to the custom actions registration and execution

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Constructor Summary
protected EntityActionsManager()
           
  EntityActionsManager(EntityProviderMethodStore entityProviderMethodStore)
          Full constructor
 
Method Summary
 CustomAction getCustomAction(String prefix, String action)
          Get the CustomAction for a prefix and action if it exists
 ActionReturn handleCustomActionExecution(ActionsExecutable actionProvider, EntityReference ref, String action, Map<String,Object> actionParams, OutputStream outputStream, EntityView view, Map<String,Object> searchParams)
          Handles the execution of custom actions based on a request for execution
 ActionReturn handleCustomActionRequest(ActionsExecutable actionProvider, EntityView entityView, String action, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> searchParams)
          Execute a custom action request
 void setEntityProviderMethodStore(EntityProviderMethodStore entityProviderMethodStore)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityActionsManager

protected EntityActionsManager()

EntityActionsManager

public EntityActionsManager(EntityProviderMethodStore entityProviderMethodStore)
Full constructor

Parameters:
entityProviderMethodStore - the provider method store service
Method Detail

setEntityProviderMethodStore

public void setEntityProviderMethodStore(EntityProviderMethodStore entityProviderMethodStore)

handleCustomActionRequest

public ActionReturn handleCustomActionRequest(ActionsExecutable actionProvider,
                                              EntityView entityView,
                                              String action,
                                              javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              Map<String,Object> searchParams)
Execute a custom action request

Parameters:
actionProvider -
entityView -
action -
request -
response -
Returns:
an action return (may be null)
Throws:
IllegalArgumentException - if any args are invalid
UnsupportedOperationException - if the action is not valid for this prefix
IllegalStateException - if a failure occurs

handleCustomActionExecution

public ActionReturn handleCustomActionExecution(ActionsExecutable actionProvider,
                                                EntityReference ref,
                                                String action,
                                                Map<String,Object> actionParams,
                                                OutputStream outputStream,
                                                EntityView view,
                                                Map<String,Object> searchParams)
Handles the execution of custom actions based on a request for execution

Throws:
IllegalArgumentException - if any args are invalid
UnsupportedOperationException - if the action is not valid for this prefix

getCustomAction

public CustomAction getCustomAction(String prefix,
                                    String action)
Get the CustomAction for a prefix and action if it exists

Parameters:
prefix - an entity prefix
action - an action key
Returns:
the custom action OR null if none found


Copyright © 2007-2012 Sakai Project. All Rights Reserved.