Class FunctionPackageManager

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class FunctionPackageManager
    extends java.lang.Object
    implements java.io.Closeable
    This class is responsible for the handling of FunctionPackage It is responsible for the import of FunctionPackage. The import of a FunctionPackage means:
    • Method Detail

      • start

        public void start()
      • reloadFunctionPackage

        public FunctionPackage reloadFunctionPackage​(java.lang.String functionPackageId,
                                                     ObjectEnricher objectEnricher)
                                              throws java.lang.Exception
        Reloads a FunctionPackage. This triggers a re-import of the Functions contained in the package
        Parameters:
        functionPackageId - the ID of the FunctionPackage to be reloaded
        Returns:
        the updated FunctionPackage
        Throws:
        java.lang.Exception - if any error occurs during reloading
      • addOrUpdateResourceBasedFunctionPackage

        public FunctionPackage addOrUpdateResourceBasedFunctionPackage​(FunctionPackage newFunctionPackage,
                                                                       ObjectEnricher objectEnricher)
                                                                throws java.lang.Exception
        Adds or updates a resource-based FunctionPackage This variation allows for the implicit identification and overwrite of a keyword package based on the name of the associated resource
        Parameters:
        newFunctionPackage - the FunctionPackage to be loaded
        Returns:
        the updated FunctionPackage
        Throws:
        java.lang.Exception - if any error occurs during loading
      • registerAttributeResolver

        public void registerAttributeResolver​(java.lang.String key,
                                              java.util.function.Function<java.lang.String,​java.lang.String> value)
      • getLibraryResourceId

        protected java.lang.String getLibraryResourceId​(FunctionPackage fpackage)
      • getResourceId

        protected java.lang.String getResourceId​(FunctionPackage fpackage)
      • getResourceSplitValue

        protected java.lang.String getResourceSplitValue​(java.lang.String resourceLocation)
      • getPackagePreview

        public java.util.List<Function> getPackagePreview​(FunctionPackage functionPackage)
                                                   throws java.lang.Exception
        Get the list of Function contained in the provided package
        Parameters:
        functionPackage - the FunctionPackage containing functions
        Returns:
        the list of Function found in the FunctionPackage
        Throws:
        java.lang.Exception - if any error occurs during loading
      • getPackageByResourceName

        public FunctionPackage getPackageByResourceName​(java.lang.String resourceName)
                                                 throws java.lang.Exception
        Load Keyword package based on the first match on the resource name
        Parameters:
        resourceName - the resource name to search with
        Returns:
        the first matching Keyword package
        Throws:
        java.lang.Exception - if any error occurs during loading
      • getFunctionPackage

        public FunctionPackage getFunctionPackage​(java.lang.String id)
      • removeFunctionPackage

        public void removeFunctionPackage​(java.lang.String id)
      • deleteResource

        protected void deleteResource​(java.lang.String path)
      • getPackageFunctions

        public java.util.List<Function> getPackageFunctions​(java.lang.String functionPackageId)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException