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
FunctionPackage
itself - the definition of the
Function
contained in the package - the registration of change watcher of the package file of the
FunctionPackage
-
Constructor Summary
ConstructorDescriptionFunctionPackageManager
(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 aFunctionPackage
This triggers the import or re-import of theFunction
s contained in the packagevoid
close()
getPackageFunctions
(String functionPackageId) getPackagePreview
(FunctionPackage functionPackage) Get the list ofFunction
contained in the provided packagevoid
registerAttributeResolver
(String key, Function<String, String> value) void
registerFunctionPackageHandler
(FunctionPackageHandler packageHandler) Registers aFunctionPackageHandler
reloadFunctionPackage
(String functionPackageId) Reloads aFunctionPackage
.void
void
start()
-
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 ofFunction
contained in the provided package- Parameters:
functionPackage
- theFunctionPackage
containing functions- Returns:
- the list of
Function
found in theFunctionPackage
- Throws:
Exception
- if any error occurs during loading
-
addOrUpdateFunctionPackage
public FunctionPackage addOrUpdateFunctionPackage(FunctionPackage newFunctionPackage) throws Exception Adds or updates aFunctionPackage
This triggers the import or re-import of theFunction
s contained in the package- Parameters:
newFunctionPackage
- theFunctionPackage
to be loaded- Returns:
- the updated
FunctionPackage
- Throws:
Exception
- if any error occurs during loading
-
reloadFunctionPackage
Reloads aFunctionPackage
. This triggers a re-import of theFunction
s contained in the package- Parameters:
functionPackageId
- the ID of theFunctionPackage
to be reloaded- Returns:
- the updated
FunctionPackage
- Throws:
Exception
- if any error occurs during reloading
-
getFunctionPackage
-
getPackageFunctions
-
removeFunctionPackage
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-