Package step.functions.packages
Class FunctionPackageManager
java.lang.Object
step.functions.packages.FunctionPackageManager
- All Implemented Interfaces:
Closeable,AutoCloseable
This class is responsible for the handling of
FunctionPackage
It is responsible for the import of FunctionPackage. The import of a
FunctionPackage means:
- the persistence of the
FunctionPackageitself - the definition of the
Functioncontained in the package - the registration of change watcher of the package file of the
FunctionPackage
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionPackageManager(FunctionPackageAccessor functionPackageAccessor, FunctionManager functionRepository, ResourceManager resourceManager, FileResolver fileResolver, ch.exense.commons.app.Configuration configuration, step.core.objectenricher.ObjectHookRegistry objectHookRegistry) -
Method Summary
Modifier and TypeMethodDescriptionaddOrUpdateFunctionPackage(FunctionPackage newFunctionPackage) Adds or updates aFunctionPackageThis triggers the import or re-import of theFunctions contained in the packagevoidclose()getPackageFunctions(String functionPackageId) getPackagePreview(FunctionPackage functionPackage) Get the list ofFunctioncontained in the provided packagevoidregisterAttributeResolver(String key, Function<String, String> value) voidregisterFunctionPackageHandler(FunctionPackageHandler packageHandler) Registers aFunctionPackageHandlerreloadFunctionPackage(String functionPackageId) Reloads aFunctionPackage.voidvoidstart()
-
Constructor Details
-
FunctionPackageManager
public FunctionPackageManager(FunctionPackageAccessor functionPackageAccessor, FunctionManager functionRepository, ResourceManager resourceManager, FileResolver fileResolver, ch.exense.commons.app.Configuration configuration, step.core.objectenricher.ObjectHookRegistry objectHookRegistry)
-
-
Method Details
-
start
public void start() -
registerFunctionPackageHandler
Registers aFunctionPackageHandler- Parameters:
packageHandler- the instance of theFunctionPackageHandler
-
registerAttributeResolver
-
getPackagePreview
Get the list ofFunctioncontained in the provided package- Parameters:
functionPackage- theFunctionPackagecontaining functions- Returns:
- the list of
Functionfound in theFunctionPackage - Throws:
Exception- if any error occurs during loading
-
addOrUpdateFunctionPackage
public FunctionPackage addOrUpdateFunctionPackage(FunctionPackage newFunctionPackage) throws Exception Adds or updates aFunctionPackageThis triggers the import or re-import of theFunctions contained in the package- Parameters:
newFunctionPackage- theFunctionPackageto be loaded- Returns:
- the updated
FunctionPackage - Throws:
Exception- if any error occurs during loading
-
reloadFunctionPackage
Reloads aFunctionPackage. This triggers a re-import of theFunctions contained in the package- Parameters:
functionPackageId- the ID of theFunctionPackageto be reloaded- Returns:
- the updated
FunctionPackage - Throws:
Exception- if any error occurs during reloading
-
getFunctionPackage
-
getPackageFunctions
-
removeFunctionPackage
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-