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()
      • registerAttributeResolver

        public void registerAttributeResolver​(java.lang.String key,
                                              java.util.function.Function<java.lang.String,​java.lang.String> value)
      • 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
      • addOrUpdateFunctionPackage

        public FunctionPackage addOrUpdateFunctionPackage​(FunctionPackage newFunctionPackage)
                                                   throws java.lang.Exception
        Adds or updates a FunctionPackage This triggers the import or re-import of the Functions contained in the package
        Parameters:
        newFunctionPackage - the FunctionPackage to be loaded
        Returns:
        the updated FunctionPackage
        Throws:
        java.lang.Exception - if any error occurs during loading
      • reloadFunctionPackage

        public FunctionPackage reloadFunctionPackage​(java.lang.String functionPackageId)
                                              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
      • getFunctionPackage

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

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

        public void removeFunctionPackage​(java.lang.String id)
      • 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