Package step.functions.type
Class AbstractFunctionType<T extends step.functions.Function>
java.lang.Object
step.functions.type.AbstractFunctionType<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected step.attachments.FileResolverprotected FunctionTypeConfigurationprotected step.grid.GridFileServicestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeFunctionCall(T function, step.functions.io.Input<?> input, Map<String, String> properties) copyFunction(T function) voiddeleteFunction(T function) abstract StringgetHandlerChain(T function) step.grid.filemanager.FileVersionIdgetHandlerPackage(T function) getHandlerProperties(T function, step.core.AbstractStepContext executionContext) protected step.resources.ResourceManagergetResourceManager(step.core.AbstractStepContext executionContext) getTokenSelectionCriteria(T function) protected voidinit()abstract TnewFunction(Map<String, String> configuration) protected step.grid.filemanager.FileVersionIdregisterFile(File file, boolean cleanable) Register the provided file in the grid's file managerprotected voidDeprecated.protected voidRegister the provided file in the grid's file manager for a given property.protected step.grid.filemanager.FileVersionIdregisterFile(String filepath, boolean cleanable) protected voidregisterFile(step.core.dynamicbeans.DynamicValue<String> dynamicValue, String propertyName, Map<String, String> props, boolean cleanable, step.core.AbstractStepContext executionContext) Register the provided file in the grid's file manager for a given property.protected step.grid.filemanager.FileVersionIdregisterResource(ClassLoader cl, String resourceName, boolean isDirectory) Deprecated.This method register non-cleanable resource only, useregisterResource(ClassLoader, String, boolean, boolean)instead to specifically define whether the registered file can be cleaned up at runtimeprotected step.grid.filemanager.FileVersionIdregisterResource(ClassLoader cl, String resourceName, boolean isDirectory, boolean cleanable) Register the provided file as resource in the grid's file manager.protected voidregisterResource(ClassLoader cl, String resourceName, boolean isDirectory, String propertyName, Map<String, String> props) Deprecated.This method register cleanable resource only, useregisterResource(ClassLoader, String, boolean, String, Map, boolean)instead to specifically define whether the registered file can be cleaned up at runtimeprotected voidregisterResource(ClassLoader cl, String resourceName, boolean isDirectory, String propertyName, Map<String, String> props, boolean cleanable) Register the provided file as resource in the grid's file manager for a given property.protected voidsetFileResolver(step.attachments.FileResolver fileResolver) protected voidsetFunctionTypeConfiguration(FunctionTypeConfiguration functionTypeConfiguration) protected voidsetGridFileServices(step.grid.GridFileService gridFileServices) voidsetupFunction(T function) updateFunction(T function)
-
Field Details
-
MISSING_ENV_VARIABLE_MESSAGE
- See Also:
-
fileResolver
protected step.attachments.FileResolver fileResolver -
fileResolverCache
-
gridFileServices
protected step.grid.GridFileService gridFileServices -
functionTypeConfiguration
-
-
Constructor Details
-
AbstractFunctionType
public AbstractFunctionType()
-
-
Method Details
-
setFunctionTypeConfiguration
-
setFileResolver
protected void setFileResolver(step.attachments.FileResolver fileResolver) -
setGridFileServices
protected void setGridFileServices(step.grid.GridFileService gridFileServices) -
init
protected void init() -
getTokenSelectionCriteria
-
getHandlerChain
-
getHandlerPackage
-
getHandlerProperties
-
beforeFunctionCall
public void beforeFunctionCall(T function, step.functions.io.Input<?> input, Map<String, String> properties) throws FunctionExecutionException- Throws:
FunctionExecutionException
-
newFunction
-
newFunction
-
setupFunction
- Throws:
SetupFunctionException
-
updateFunction
- Throws:
FunctionTypeException
-
copyFunction
- Throws:
FunctionTypeException
-
registerFile
protected void registerFile(step.core.dynamicbeans.DynamicValue<String> dynamicValue, String propertyName, Map<String, String> props, boolean cleanable, step.core.AbstractStepContext executionContext) Register the provided file in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.- Parameters:
dynamicValue- theDynamicValueof the file's path to be registeredpropertyName- the name of the property for which we register the fileprops- the map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the filecleanable- whether this version of the file can be cleaned-up at runtimeexecutionContext- the current execution context (should be defined if the function is executing via ExecutionEngine with execution-scope resource manager)- Throws:
RuntimeException
-
registerFile
Deprecated.This method register cleanable resource only, useregisterFile(File, String, Map, boolean)instead to specifically define whether the registered file can be cleaned up at runtimeRegister the provided file in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.- Parameters:
file- theFileof the resource to be registeredpropertyName- theStringname of the property for which we register the fileprops- theMapwill be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file- Throws:
RuntimeException
-
registerFile
protected void registerFile(File file, String propertyName, Map<String, String> props, boolean cleanable) Register the provided file in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.- Parameters:
file- theFileof the resource to be registeredpropertyName- the name of the property for which we register the fileprops- theMapwill be enriched with the propertyName id and version of the registered file that can be later used to retrieve the filecleanable- whether this version of the file can be cleaned-up at runtime- Throws:
RuntimeException
-
registerFile
Register the provided file in the grid's file manager- Parameters:
file- theFileof the resource to be registeredcleanable- whether this version of the file can be cleaned-up at runtime- Returns:
- the
FileVersionIdof the registered file. TheFileVersionIdcan be used for later retrieval of this version - Throws:
RuntimeException
-
registerResource
protected void registerResource(ClassLoader cl, String resourceName, boolean isDirectory, String propertyName, Map<String, String> props) Deprecated.This method register cleanable resource only, useregisterResource(ClassLoader, String, boolean, String, Map, boolean)instead to specifically define whether the registered file can be cleaned up at runtimeRegister the provided file as resource in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.- Parameters:
cl- theClassLoadercontaining the file as resourceresourceName- the name of the file's resourceisDirectory- whether this resource is a directorypropertyName- the name of the property for which we register the fileprops- theMapwill be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file- Throws:
RuntimeException
-
registerResource
protected void registerResource(ClassLoader cl, String resourceName, boolean isDirectory, String propertyName, Map<String, String> props, boolean cleanable) Register the provided file as resource in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.- Parameters:
cl- theClassLoadercontaining the file as resourceresourceName- the name of the file's resourceisDirectory- whether this resource is a directorypropertyName- the name of the property for which we register the fileprops- theMapwill be enriched with the propertyName id and version of the registered file that can be later used to retrieve the filecleanable- whether this version of the file can be cleaned-up at runtime- Throws:
RuntimeException
-
registerResource
protected step.grid.filemanager.FileVersionId registerResource(ClassLoader cl, String resourceName, boolean isDirectory) Deprecated.This method register non-cleanable resource only, useregisterResource(ClassLoader, String, boolean, boolean)instead to specifically define whether the registered file can be cleaned up at runtimeRegister the provided file as resource in the grid's file manager.- Parameters:
cl- theClassLoadercontaining the file as resourceresourceName- the name of the file's resourceisDirectory- whether this resource is a directory- Returns:
- the
FileVersionIdof the registered file. TheFileVersionIdcan be used for later retrieval of this version - Throws:
RuntimeException
-
registerResource
protected step.grid.filemanager.FileVersionId registerResource(ClassLoader cl, String resourceName, boolean isDirectory, boolean cleanable) Register the provided file as resource in the grid's file manager.- Parameters:
cl- theClassLoadercontaining the file as resourceresourceName- the name of the file's resourceisDirectory- whether this resource is a directorycleanable- whether this version of the file can be cleaned-up at runtime- Returns:
- the
FileVersionIdof the registered file. TheFileVersionIdcan be used for later retrieval of this version - Throws:
RuntimeException
-
registerFile
-
getResourceManager
protected step.resources.ResourceManager getResourceManager(step.core.AbstractStepContext executionContext) -
deleteFunction
- Throws:
FunctionTypeException
-
registerFile(File, String, Map, boolean)instead to specifically define whether the registered file can be cleaned up at runtime