Class EntityProviderMethodStoreImpl
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected static Class<?>[]validActionParamTypesprotected static Class<?>[]validRedirectParamTypes
-
Constructor Summary
Constructors Constructor Description EntityProviderMethodStoreImpl()Full constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomAction(String prefix, CustomAction customAction)voidaddURLRedirects(String prefix, URLRedirect[] redirects)CustomAction[]findCustomActions(EntityProvider entityProvider, boolean ignoreFailures)URLRedirect[]findURLRedirectMethods(EntityProvider entityProvider)CustomActiongetCustomAction(String prefix, String action)List<CustomAction>getCustomActions(String prefix)List<URLRedirect>getURLRedirects(String prefix)voidremoveCustomActions(String prefix)voidremoveURLRedirects(String prefix)voidsetCustomActions(String prefix, Map<String,CustomAction> actions)Set the custom actions for this prefixprotected static Class<?>[]validateActionParamTypes(Class<?>[] paramTypes, String methodName)Validates the parameter types on a method to make sure they are validstatic URLRedirect[]validateControllableTemplates(RedirectControllable configControllable)Execute this validate and get the templates so they can be registeredstatic voidvalidateCustomActionMethods(ActionsDefineable actionsDefineable)Takes a set of custom actions and validates themstatic URLRedirect[]validateDefineableTemplates(RedirectDefinable configDefinable)Validates the provided URL templates in an entity provider and outputs the URL redirect objects as an arrayprotected static Class<?>[]validateParamTypes(Class<?>[] paramTypes, Class<?>[] validTypes)Validates param types against a given list of valid typesprotected static Class<?>[]validateRedirectParamTypes(Class<?>[] paramTypes, String methodName)Validates the parameter types on a method to make sure they are valid
-
-
-
Method Detail
-
findCustomActions
public CustomAction[] findCustomActions(EntityProvider entityProvider, boolean ignoreFailures)
- Specified by:
findCustomActionsin interfaceEntityProviderMethodStore
-
setCustomActions
public void setCustomActions(String prefix, Map<String,CustomAction> actions)
Set the custom actions for this prefix- Specified by:
setCustomActionsin interfaceEntityProviderMethodStore- Parameters:
prefix- an entity prefixactions- a map of action ->CustomAction
-
addCustomAction
public void addCustomAction(String prefix, CustomAction customAction)
- Specified by:
addCustomActionin interfaceEntityProviderMethodStore
-
getCustomAction
public CustomAction getCustomAction(String prefix, String action)
- Specified by:
getCustomActionin interfaceEntityProviderMethodStore
-
removeCustomActions
public void removeCustomActions(String prefix)
- Specified by:
removeCustomActionsin interfaceEntityProviderMethodStore
-
getCustomActions
public List<CustomAction> getCustomActions(String prefix)
- Specified by:
getCustomActionsin interfaceEntityProviderMethodStore
-
findURLRedirectMethods
public URLRedirect[] findURLRedirectMethods(EntityProvider entityProvider)
- Specified by:
findURLRedirectMethodsin interfaceEntityProviderMethodStore
-
addURLRedirects
public void addURLRedirects(String prefix, URLRedirect[] redirects)
- Specified by:
addURLRedirectsin interfaceEntityProviderMethodStore
-
removeURLRedirects
public void removeURLRedirects(String prefix)
- Specified by:
removeURLRedirectsin interfaceEntityProviderMethodStore
-
getURLRedirects
public List<URLRedirect> getURLRedirects(String prefix)
- Specified by:
getURLRedirectsin interfaceEntityProviderMethodStore
-
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 typesmethodName- 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 typesmethodName- 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 typesvalidTypes- 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 actionscustomActions-- 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
-
-