Package step.functions.type
Class AbstractFunctionType<T extends step.functions.Function>
java.lang.Object
step.functions.type.AbstractFunctionType<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected step.attachments.FileResolverprotected FunctionTypeConfigurationprotected step.grid.GridFileServiceprotected step.grid.filemanager.FileVersionprotected static final org.slf4j.Loggerstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterFunctionCall(T function, step.functions.io.Input<?> input, Map<String, String> properties) voidbeforeFunctionCall(T function, step.functions.io.Input<?> input, Map<String, String> properties) protected static voidcloseRegisteredCloseable(List<AutoCloseable> registeredCloseable) 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 AbstractFunctionType<T>.FileVersionCloseableRegister the provided file in the grid's file manager for a given property.protected AbstractFunctionType<T>.FileVersionCloseableregisterFile(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.FileVersionregisterResource(ClassLoader cl, String resourceName, boolean isDirectory, boolean cleanable) Register the provided file as resource in the grid's file manager.protected AbstractFunctionType<T>.FileVersionCloseableregisterResource(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
-
logger
protected static final org.slf4j.Logger logger -
MISSING_ENV_VARIABLE_MESSAGE
- See Also:
-
fileResolver
protected step.attachments.FileResolver fileResolver -
fileResolverCache
-
gridFileServices
protected step.grid.GridFileService gridFileServices -
functionTypeConfiguration
-
handlerPackageVersion
protected step.grid.filemanager.FileVersion handlerPackageVersion
-
-
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
-
isHandlerCleanable
-
closeRegisteredCloseable
-
getHandlerProperties
public abstract AbstractFunctionType.HandlerProperties getHandlerProperties(T function, step.core.AbstractStepContext executionContext) -
beforeFunctionCall
public void beforeFunctionCall(T function, step.functions.io.Input<?> input, Map<String, String> properties) throws FunctionExecutionException- Throws:
FunctionExecutionException
-
afterFunctionCall
public void afterFunctionCall(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 AbstractFunctionType<T>.FileVersionCloseable 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)- Returns:
- a FileVersionCloseable wrapping the
FileVersionof the registered file. Closing the wrapper, release the usage on this file version. TheFileVersioncan be used for later retrieval of this version - Throws:
RuntimeException
-
registerFile
protected AbstractFunctionType<T>.FileVersionCloseable 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- Returns:
- a FileVersionCloseable wrapping the
FileVersionof the registered file. Closing the wrapper, release the usage on this file version. TheFileVersioncan be used for later retrieval of this version - Throws:
RuntimeException
-
registerResource
protected AbstractFunctionType<T>.FileVersionCloseable 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- Returns:
- the
FileVersionof the registered file. TheFileVersioncan be used for later retrieval of this version - Throws:
RuntimeException
-
registerResource
protected step.grid.filemanager.FileVersion 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
FileVersionof the registered file. TheFileVersioncan be used for later retrieval of this version - Throws:
RuntimeException
-
getResourceManager
protected step.resources.ResourceManager getResourceManager(step.core.AbstractStepContext executionContext) -
deleteFunction
- Throws:
FunctionTypeException
-