Interface RuleComponentsValidator

All Known Implementing Classes:
RuleComponentsValidatorImpl

public interface RuleComponentsValidator
Validator that can be used to validate all components of an automation rule.

Implementations should look up validators supplied at runtime.

  • Method Details

    • validate

      void validate(TenantContext context, com.codebarrel.automation.api.config.RuleConfigBean config, RemoteConnectUser remoteUser, ErrorCollection errors)
      Validates the list of configs provided, by using the ComponentValidators provided in the system at runtime.

      If no validator can be found for a particular component, then it will simply be skipped (i.e. no validation will be performed.

      Parameters:
      config - the rule whose components to validate
      remoteUser - the user performing the action
      errors - the error collection to add errors to
    • validateForExecution

      void validateForExecution(TenantContext context, com.codebarrel.automation.api.config.RuleConfigBean config, RemoteConnectUser remoteUser, ErrorCollection errors)
      Validates the list of configs provided for rule execution, by using the ComponentValidators provided in the system at runtime.

      If no validator can be found for a particular component, then it will simply be skipped (i.e. no validation will be performed.

      Parameters:
      config - the rule whose components to validate
      remoteUser - the user performing the action
      errors - the error collection to add errors to
    • validateParse

      void validateParse(TenantContext context, com.codebarrel.automation.api.config.RuleConfigBean config, RemoteConnectUser remoteUser, ErrorCollection errors)
      This is a less detailed validation that checks all components are present and the rule has all the required elements, but doesn't actually validate all the individual components.

      This should be used when disableding a rule for example.

      Parameters:
      context - The tenant context we're in
      config - the rule whose components to validate
      remoteUser - the user performing the action
      errors - the error collection to add errors to