Class AbstractFunctionType<T extends step.functions.Function>

java.lang.Object
step.functions.type.AbstractFunctionType<T>

public abstract class AbstractFunctionType<T extends step.functions.Function> extends Object
  • Field Details

    • fileResolver

      protected step.attachments.FileResolver fileResolver
    • fileResolverCache

      protected com.google.common.cache.LoadingCache<String,File> fileResolverCache
    • gridFileServices

      protected step.grid.GridFileService gridFileServices
    • functionTypeConfiguration

      protected FunctionTypeConfiguration functionTypeConfiguration
  • Constructor Details

    • AbstractFunctionType

      public AbstractFunctionType()
  • Method Details

    • setFunctionTypeConfiguration

      protected void setFunctionTypeConfiguration(FunctionTypeConfiguration functionTypeConfiguration)
    • setFileResolver

      protected void setFileResolver(step.attachments.FileResolver fileResolver)
    • setGridFileServices

      protected void setGridFileServices(step.grid.GridFileService gridFileServices)
    • init

      protected void init()
    • getTokenSelectionCriteria

      public Map<String,step.grid.tokenpool.Interest> getTokenSelectionCriteria(T function)
    • getHandlerChain

      public abstract String getHandlerChain(T function)
    • getHandlerPackage

      public step.grid.filemanager.FileVersionId getHandlerPackage(T function)
    • getHandlerProperties

      public abstract Map<String,String> 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
    • newFunction

      public abstract T newFunction()
    • newFunction

      public T newFunction(Map<String,String> configuration)
    • setupFunction

      public void setupFunction(T function) throws SetupFunctionException
      Throws:
      SetupFunctionException
    • updateFunction

      public T updateFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException
    • copyFunction

      public T copyFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException
    • registerFile

      protected void registerFile(step.core.dynamicbeans.DynamicValue<String> dynamicValue, String propertyName, Map<String,String> props)
      Deprecated.
      This method register cleanable resource only, use registerFile(DynamicValue, String, Map, boolean, AbstractStepContext) instead to specifically define whether the registered file can be cleaned up at runtime
      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 - the DynamicValue of the file's path to be registered
      propertyName - the name of the property for which we register the file
      props - the map will 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(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 - the DynamicValue of the file's path to be registered
      propertyName - the name of the property for which we register the file
      props - the map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - whether this version of the file can be cleaned-up at runtime
      executionContext - the current execution context (should be defined if the function is executing via ExecutionEngine with execution-scope resource manager)
      Throws:
      RuntimeException
    • registerFile

      protected void registerFile(File file, String propertyName, Map<String,String> props)
      Deprecated.
      This method register cleanable resource only, use registerFile(File, String, Map, boolean) instead to specifically define whether the registered file can be cleaned up at runtime
      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 - the File of the resource to be registered
      propertyName - the String name of the property for which we register the file
      props - the Map will 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 - the File of the resource to be registered
      propertyName - the name of the property for which we register the file
      props - the Map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - whether this version of the file can be cleaned-up at runtime
      Throws:
      RuntimeException
    • registerFile

      protected step.grid.filemanager.FileVersionId registerFile(File file, boolean cleanable)
      Register the provided file in the grid's file manager
      Parameters:
      file - the File of the resource to be registered
      cleanable - whether this version of the file can be cleaned-up at runtime
      Returns:
      the FileVersionId of the registered file. The FileVersionId can 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, use registerResource(ClassLoader, String, boolean, String, Map, boolean) instead to specifically define whether the registered file can be cleaned up at runtime
      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 - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      propertyName - the name of the property for which we register the file
      props - the Map will 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 - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      propertyName - the name of the property for which we register the file
      props - the Map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - 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, use registerResource(ClassLoader, String, boolean, boolean) instead to specifically define whether the registered file can be cleaned up at runtime
      Register the provided file as resource in the grid's file manager.
      Parameters:
      cl - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      Returns:
      the FileVersionId of the registered file. The FileVersionId can 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 - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      cleanable - whether this version of the file can be cleaned-up at runtime
      Returns:
      the FileVersionId of the registered file. The FileVersionId can be used for later retrieval of this version
      Throws:
      RuntimeException
    • registerFile

      protected step.grid.filemanager.FileVersionId registerFile(String filepath, boolean cleanable)
    • getResourceManager

      protected step.resources.ResourceManager getResourceManager(step.core.AbstractStepContext executionContext)
    • deleteFunction

      public void deleteFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException