org.sakaiproject.entitybroker.util.core
Class EntityProviderMethodStoreImpl

java.lang.Object
  extended by org.sakaiproject.entitybroker.util.core.EntityProviderMethodStoreImpl
All Implemented Interfaces:
EntityProviderMethodStore

public class EntityProviderMethodStoreImpl
extends Object
implements EntityProviderMethodStore

This stores the various methods used to track different methods allowed for providers and also tracks the various methods in the registry

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Field Summary
protected static Class<?>[] validActionParamTypes
           
protected static Class<?>[] validRedirectParamTypes
           
 
Constructor Summary
EntityProviderMethodStoreImpl()
          Full constructor
 
Method Summary
 void addCustomAction(String prefix, CustomAction customAction)
           
 void addURLRedirects(String prefix, URLRedirect[] redirects)
           
 CustomAction[] findCustomActions(EntityProvider entityProvider, boolean ignoreFailures)
           
 URLRedirect[] findURLRedirectMethods(EntityProvider entityProvider)
           
 CustomAction getCustomAction(String prefix, String action)
           
 List<CustomAction> getCustomActions(String prefix)
           
 List<URLRedirect> getURLRedirects(String prefix)
           
 void removeCustomActions(String prefix)
           
 void removeURLRedirects(String prefix)
           
 void setCustomActions(String prefix, Map<String,CustomAction> actions)
          Set the custom actions for this prefix
protected static Class<?>[] validateActionParamTypes(Class<?>[] paramTypes, String methodName)
          Validates the parameter types on a method to make sure they are valid
static URLRedirect[] validateControllableTemplates(RedirectControllable configControllable)
          Execute this validate and get the templates so they can be registered
static void validateCustomActionMethods(ActionsDefineable actionsDefineable)
          Takes a set of custom actions and validates them
static URLRedirect[] validateDefineableTemplates(RedirectDefinable configDefinable)
          Validates the provided URL templates in an entity provider and outputs the URL redirect objects as an array
protected static Class<?>[] validateParamTypes(Class<?>[] paramTypes, Class<?>[] validTypes)
          Validates param types against a given list of valid types
protected static Class<?>[] validateRedirectParamTypes(Class<?>[] paramTypes, String methodName)
          Validates the parameter types on a method to make sure they are valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validActionParamTypes

protected static Class<?>[] validActionParamTypes

validRedirectParamTypes

protected static Class<?>[] validRedirectParamTypes
Constructor Detail

EntityProviderMethodStoreImpl

public EntityProviderMethodStoreImpl()
Full constructor

Method Detail

findCustomActions

public CustomAction[] findCustomActions(EntityProvider entityProvider,
                                        boolean ignoreFailures)
Specified by:
findCustomActions in interface EntityProviderMethodStore

setCustomActions

public void setCustomActions(String prefix,
                             Map<String,CustomAction> actions)
Set the custom actions for this prefix

Specified by:
setCustomActions in interface EntityProviderMethodStore
Parameters:
prefix - an entity prefix
actions - a map of action -> CustomAction

addCustomAction

public void addCustomAction(String prefix,
                            CustomAction customAction)
Specified by:
addCustomAction in interface EntityProviderMethodStore

getCustomAction

public CustomAction getCustomAction(String prefix,
                                    String action)
Specified by:
getCustomAction in interface EntityProviderMethodStore

removeCustomActions

public void removeCustomActions(String prefix)
Specified by:
removeCustomActions in interface EntityProviderMethodStore

getCustomActions

public List<CustomAction> getCustomActions(String prefix)
Specified by:
getCustomActions in interface EntityProviderMethodStore

findURLRedirectMethods

public URLRedirect[] findURLRedirectMethods(EntityProvider entityProvider)
Specified by:
findURLRedirectMethods in interface EntityProviderMethodStore

addURLRedirects

public void addURLRedirects(String prefix,
                            URLRedirect[] redirects)
Specified by:
addURLRedirects in interface EntityProviderMethodStore

removeURLRedirects

public void removeURLRedirects(String prefix)
Specified by:
removeURLRedirects in interface EntityProviderMethodStore

getURLRedirects

public List<URLRedirect> getURLRedirects(String prefix)
Specified by:
getURLRedirects in interface EntityProviderMethodStore

validateActionParamTypes

protected static Class<?>[] validateActionParamTypes(Class<?>[] paramTypes,
                                                     String methodName)
Validates the parameter types on a method to make sure they are valid

Parameters:
paramTypes - an array of parameter types
methodName - the name of the method which is being validated (for debugging mostly)
Returns:
the new valid array of param types
Throws:
IllegalArgumentException - if the param types are invalid

validateRedirectParamTypes

protected static Class<?>[] validateRedirectParamTypes(Class<?>[] paramTypes,
                                                       String methodName)
Validates the parameter types on a method to make sure they are valid

Parameters:
paramTypes - an array of parameter types
methodName - the name of the method which is being validated (for debugging mostly)
Returns:
the new valid array of param types
Throws:
IllegalArgumentException - is the param types are invalid

validateParamTypes

protected static Class<?>[] validateParamTypes(Class<?>[] paramTypes,
                                               Class<?>[] validTypes)
Validates param types against a given list of valid types

Parameters:
paramTypes - an array of parameter types
validTypes - the types that are valid
Returns:
the new valid array of param types
Throws:
IllegalArgumentException - is the param types are invalid

validateCustomActionMethods

public static void validateCustomActionMethods(ActionsDefineable actionsDefineable)
Takes a set of custom actions and validates them

Parameters:
actionsDefineable - an entity provider which uses custom actions
customActions -
Throws:
IllegalArgumentException - if the custom actions are invalid

validateDefineableTemplates

public static URLRedirect[] validateDefineableTemplates(RedirectDefinable configDefinable)
Validates the provided URL templates in an entity provider and outputs the URL redirect objects as an array

Parameters:
configDefinable - the entity provider
Returns:
the array of URL redirects

validateControllableTemplates

public static URLRedirect[] validateControllableTemplates(RedirectControllable configControllable)
Execute this validate and get the templates so they can be registered

Parameters:
configControllable - the entity provider
Returns:
the array of URL redirects


Copyright © 2007-2012 CARET, University of Cambridge. All Rights Reserved.