public class FunctionPackageManager extends Object implements Closeable
FunctionPackage
It is responsible for the import of FunctionPackage.
The import of a FunctionPackage means:
FunctionPackage itselfFunction contained in the packageFunctionPackage| Constructor and Description |
|---|
FunctionPackageManager(FunctionPackageAccessor functionPackageAccessor,
step.functions.manager.FunctionManager functionRepository,
step.resources.ResourceManager resourceManager,
step.attachments.FileResolver fileResolver,
ch.exense.commons.app.Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
FunctionPackage |
addOrUpdateFunctionPackage(FunctionPackage newFunctionPackage,
step.core.objectenricher.ObjectEnricher objectEnricher)
Adds or updates a
FunctionPackage
This triggers the import or re-import of the Functions contained in the package |
FunctionPackage |
addOrUpdateResourceBasedFunctionPackage(FunctionPackage newFunctionPackage,
step.core.objectenricher.ObjectEnricher objectEnricher)
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 |
void |
close() |
protected void |
deleteResource(String path) |
FunctionPackage |
getFunctionPackage(String id) |
protected String |
getLibraryResourceId(FunctionPackage fpackage) |
FunctionPackage |
getPackageByResourceName(String resourceName)
Load Keyword package based on the first match on the resource name
|
List<step.functions.Function> |
getPackageFunctions(String functionPackageId) |
List<step.functions.Function> |
getPackagePreview(FunctionPackage functionPackage)
Get the list of
Function contained in the provided package |
protected String |
getResourceId(FunctionPackage fpackage) |
protected String |
getResourceSplitValue(String resourceLocation) |
void |
registerAttributeResolver(String key,
Function<String,String> value) |
void |
registerFunctionPackageHandler(FunctionPackageHandler packageHandler)
Registers a
FunctionPackageHandler |
FunctionPackage |
reloadFunctionPackage(String functionPackageId,
step.core.objectenricher.ObjectEnricher objectEnricher)
Reloads a
FunctionPackage. |
void |
removeFunctionPackage(String id) |
void |
start() |
public FunctionPackageManager(FunctionPackageAccessor functionPackageAccessor, step.functions.manager.FunctionManager functionRepository, step.resources.ResourceManager resourceManager, step.attachments.FileResolver fileResolver, ch.exense.commons.app.Configuration configuration)
public void start()
public void registerFunctionPackageHandler(FunctionPackageHandler packageHandler)
FunctionPackageHandlerpackageHandler - the instance of the FunctionPackageHandlerpublic FunctionPackage reloadFunctionPackage(String functionPackageId, step.core.objectenricher.ObjectEnricher objectEnricher) throws Exception
FunctionPackage.
This triggers a re-import of the Functions contained in the packagefunctionPackageId - the ID of the FunctionPackage to be reloadedFunctionPackageException - if any error occurs during reloadingpublic FunctionPackage addOrUpdateFunctionPackage(FunctionPackage newFunctionPackage, step.core.objectenricher.ObjectEnricher objectEnricher) throws Exception
FunctionPackage
This triggers the import or re-import of the Functions contained in the packagenewFunctionPackage - the FunctionPackage to be loadedFunctionPackageException - if any error occurs during loadingpublic FunctionPackage addOrUpdateResourceBasedFunctionPackage(FunctionPackage newFunctionPackage, step.core.objectenricher.ObjectEnricher objectEnricher) throws Exception
FunctionPackage
This variation allows for the implicit identification and overwrite of a keyword package
based on the name of the associated resourcenewFunctionPackage - the FunctionPackage to be loadedFunctionPackageException - if any error occurs during loadingpublic void registerAttributeResolver(String key, Function<String,String> value)
protected String getLibraryResourceId(FunctionPackage fpackage)
protected String getResourceId(FunctionPackage fpackage)
public List<step.functions.Function> getPackagePreview(FunctionPackage functionPackage) throws Exception
Function contained in the provided packagefunctionPackage - the FunctionPackage containing functionsFunction found in the FunctionPackageException - if any error occurs during loadingpublic FunctionPackage getPackageByResourceName(String resourceName) throws Exception
resourceName - the resource name to search withException - if any error occurs during loadingpublic FunctionPackage getFunctionPackage(String id)
public void removeFunctionPackage(String id)
protected void deleteResource(String path)
public List<step.functions.Function> getPackageFunctions(String functionPackageId)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2020. All rights reserved.