Class FunctionPackageManager

    • Constructor Detail

      • FunctionPackageManager

        public FunctionPackageManager​(FunctionPackageAccessor functionPackageAccessor,
                                      step.functions.manager.FunctionManager functionRepository,
                                      step.resources.ResourceManager resourceManager,
                                      step.attachments.FileResolver fileResolver,
                                      ch.exense.commons.app.Configuration configuration)
    • Method Detail

      • start

        public void start()
      • reloadFunctionPackage

        public FunctionPackage reloadFunctionPackage​(String functionPackageId,
                                                     step.core.objectenricher.ObjectEnricher objectEnricher)
                                              throws 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:
        Exception - if any error occurs during reloading
      • addOrUpdateFunctionPackage

        public FunctionPackage addOrUpdateFunctionPackage​(FunctionPackage newFunctionPackage,
                                                          step.core.objectenricher.ObjectEnricher objectEnricher)
                                                   throws 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:
        Exception - if any error occurs during loading
      • addOrUpdateResourceBasedFunctionPackage

        public FunctionPackage addOrUpdateResourceBasedFunctionPackage​(FunctionPackage newFunctionPackage,
                                                                       step.core.objectenricher.ObjectEnricher objectEnricher)
                                                                throws 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:
        Exception - if any error occurs during loading
      • getResourceSplitValue

        protected String getResourceSplitValue​(String resourceLocation)
      • getPackagePreview

        public List<step.functions.Function> getPackagePreview​(FunctionPackage functionPackage)
                                                        throws 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:
        Exception - if any error occurs during loading
      • getPackageByResourceName

        public FunctionPackage getPackageByResourceName​(String resourceName)
                                                 throws 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:
        Exception - if any error occurs during loading
      • removeFunctionPackage

        public void removeFunctionPackage​(String id)
      • deleteResource

        protected void deleteResource​(String path)
      • getPackageFunctions

        public List<step.functions.Function> getPackageFunctions​(String functionPackageId)