Class EntityProviderMethodStoreImpl
- java.lang.Object
-
- org.sakaiproject.entitybroker.util.core.EntityProviderMethodStoreImpl
-
- All Implemented Interfaces:
org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
public class EntityProviderMethodStoreImpl extends Object implements org.sakaiproject.entitybroker.entityprovider.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, org.sakaiproject.entitybroker.entityprovider.extension.CustomAction customAction)voidaddURLRedirects(String prefix, org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] redirects)org.sakaiproject.entitybroker.entityprovider.extension.CustomAction[]findCustomActions(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider, boolean ignoreFailures)org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[]findURLRedirectMethods(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider)org.sakaiproject.entitybroker.entityprovider.extension.CustomActiongetCustomAction(String prefix, String action)List<org.sakaiproject.entitybroker.entityprovider.extension.CustomAction>getCustomActions(String prefix)List<org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect>getURLRedirects(String prefix)voidremoveCustomActions(String prefix)voidremoveURLRedirects(String prefix)voidsetCustomActions(String prefix, Map<String,org.sakaiproject.entitybroker.entityprovider.extension.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 org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[]validateControllableTemplates(org.sakaiproject.entitybroker.entityprovider.capabilities.RedirectControllable configControllable)Execute this validate and get the templates so they can be registeredstatic voidvalidateCustomActionMethods(org.sakaiproject.entitybroker.entityprovider.capabilities.ActionsDefineable actionsDefineable)Takes a set of custom actions and validates themstatic org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[]validateDefineableTemplates(org.sakaiproject.entitybroker.entityprovider.capabilities.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 org.sakaiproject.entitybroker.entityprovider.extension.CustomAction[] findCustomActions(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider, boolean ignoreFailures)- Specified by:
findCustomActionsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
setCustomActions
public void setCustomActions(String prefix, Map<String,org.sakaiproject.entitybroker.entityprovider.extension.CustomAction> actions)
Set the custom actions for this prefix- Specified by:
setCustomActionsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore- Parameters:
prefix- an entity prefixactions- a map of action ->CustomAction
-
addCustomAction
public void addCustomAction(String prefix, org.sakaiproject.entitybroker.entityprovider.extension.CustomAction customAction)
- Specified by:
addCustomActionin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
getCustomAction
public org.sakaiproject.entitybroker.entityprovider.extension.CustomAction getCustomAction(String prefix, String action)
- Specified by:
getCustomActionin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
removeCustomActions
public void removeCustomActions(String prefix)
- Specified by:
removeCustomActionsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
getCustomActions
public List<org.sakaiproject.entitybroker.entityprovider.extension.CustomAction> getCustomActions(String prefix)
- Specified by:
getCustomActionsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
findURLRedirectMethods
public org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] findURLRedirectMethods(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider)
- Specified by:
findURLRedirectMethodsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
addURLRedirects
public void addURLRedirects(String prefix, org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] redirects)
- Specified by:
addURLRedirectsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
removeURLRedirects
public void removeURLRedirects(String prefix)
- Specified by:
removeURLRedirectsin interfaceorg.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
-
getURLRedirects
public List<org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect> getURLRedirects(String prefix)
- Specified by:
getURLRedirectsin interfaceorg.sakaiproject.entitybroker.entityprovider.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 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(org.sakaiproject.entitybroker.entityprovider.capabilities.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 org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] validateDefineableTemplates(org.sakaiproject.entitybroker.entityprovider.capabilities.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 org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] validateControllableTemplates(org.sakaiproject.entitybroker.entityprovider.capabilities.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
-
-