Interface TaskHelper


public interface TaskHelper
Helper interface passed to IntervalGenerator, ActionGenerator and ActionScheduler instances for calling in to the volt system to perform logging, validation and other operations
  • Method Details

    • getTaskName

      String getTaskName()
      Returns:
      The name of the task
    • getTaskScope

      TaskScope getTaskScope()
      Returns:
      The scope in which the task will be executing
    • getScopeId

      int getScopeId()
      Returns the ID of the scope when this helper is passed to an instantiate method otherwise -1

      If scope is TaskScope.PARTITIONS id will be a partition ID. If scope is TaskScope.HOSTS id will be a host ID. Otherwise id will be -1

      Returns:
      The ID of the scope
    • isDebugLoggingEnabled

      boolean isDebugLoggingEnabled()
      Returns:
      true if debug logging is enabled
    • logDebug

      void logDebug(String message)
      Log a message in the system log at the debug log level
      Parameters:
      message - to log
    • logDebug

      void logDebug(String message, Throwable throwable)
      Log a message and throwable in the system log at the debug log level
      Parameters:
      message - to log
      throwable - to log along with message
    • logInfo

      void logInfo(String message)
      Log a message in the system log at the info log level
      Parameters:
      message - to log
    • logInfo

      void logInfo(String message, Throwable throwable)
      Log a message and throwable in the system log at the info log level
      Parameters:
      message - to log
      throwable - to log along with message
    • logWarning

      void logWarning(String message)
      Log a message in the system log at the warning log level
      Parameters:
      message - to log
    • logWarning

      void logWarning(String message, Throwable throwable)
      Log a message and throwable in the system log at the warning log level
      Parameters:
      message - to log
      throwable - to log along with message
    • logError

      void logError(String message)
      Log a message in the system log at the error log level
      Parameters:
      message - to log
    • logError

      void logError(String message, Throwable throwable)
      Log a message and throwable in the system log at the error log level
      Parameters:
      message - to log
      throwable - to log along with message
    • validateProcedure

      void validateProcedure(CompoundErrors errors, boolean restrictProcedureByScope, String procedureName, Object[] parameters)
      Validate that a procedure with name exists and parameters are valid for that procedure.

      Note: parameter validation might not work for system procedures

      Parameters:
      errors - CompoundErrors instance to collect errors
      restrictProcedureByScope - If true type of procedures will be restricted. See ActionGeneratorBase.restrictProcedureByScope()
      procedureName - Name of procedure to validate
      parameters - that will be passed to name
    • isProcedureReadOnly

      boolean isProcedureReadOnly(String procedureName)
      Test if a procedure is read only. If a procedure cannot be found with procedureName then false is returned
      Parameters:
      procedureName - Name of procedure.
      Returns:
      true if procedureName is read only