Class 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 Detail

      • validActionParamTypes

        protected static Class<?>[] validActionParamTypes
      • validRedirectParamTypes

        protected static Class<?>[] validRedirectParamTypes
    • Constructor Detail

      • EntityProviderMethodStoreImpl

        public EntityProviderMethodStoreImpl()
        Full constructor
    • Method Detail

      • findCustomActions

        public org.sakaiproject.entitybroker.entityprovider.extension.CustomAction[] findCustomActions​(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider,
                                                                                                       boolean ignoreFailures)
        Specified by:
        findCustomActions in interface org.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:
        setCustomActions in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
        Parameters:
        prefix - an entity prefix
        actions - a map of action -> CustomAction
      • addCustomAction

        public void addCustomAction​(String prefix,
                                    org.sakaiproject.entitybroker.entityprovider.extension.CustomAction customAction)
        Specified by:
        addCustomAction in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • getCustomAction

        public org.sakaiproject.entitybroker.entityprovider.extension.CustomAction getCustomAction​(String prefix,
                                                                                                   String action)
        Specified by:
        getCustomAction in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • removeCustomActions

        public void removeCustomActions​(String prefix)
        Specified by:
        removeCustomActions in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • getCustomActions

        public List<org.sakaiproject.entitybroker.entityprovider.extension.CustomAction> getCustomActions​(String prefix)
        Specified by:
        getCustomActions in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • findURLRedirectMethods

        public org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] findURLRedirectMethods​(org.sakaiproject.entitybroker.entityprovider.EntityProvider entityProvider)
        Specified by:
        findURLRedirectMethods in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • addURLRedirects

        public void addURLRedirects​(String prefix,
                                    org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect[] redirects)
        Specified by:
        addURLRedirects in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • removeURLRedirects

        public void removeURLRedirects​(String prefix)
        Specified by:
        removeURLRedirects in interface org.sakaiproject.entitybroker.entityprovider.EntityProviderMethodStore
      • getURLRedirects

        public List<org.sakaiproject.entitybroker.entityprovider.extension.URLRedirect> getURLRedirects​(String prefix)
        Specified by:
        getURLRedirects in interface org.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 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​(org.sakaiproject.entitybroker.entityprovider.capabilities.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 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