Interface Configurator


public interface Configurator
Provides pseudo-transactional semantics to system configuration tasks.

In order to use, invoke the various start, stop, create, delete, update, methods in the intended order of operation, then invoke one of the commit methods to complete the transaction.

This code is experimental. While this class is functional and tested, it may change or be removed in a future version of the library.

  • Method Summary

    Modifier and Type
    Method
    Description
    add(Operation operation)
    Adds an Operation step to the transaction.
    commit(String auditMessage, String... auditParams)
    Sequentially invokes all the transaction's operations, committing their changes.
  • Method Details

    • commit

      OperationReport commit(String auditMessage, String... auditParams)
      Sequentially invokes all the transaction's operations, committing their changes. If a failure occurs during the processing, a rollback is attempted of those handlers that had already been committed.

      After commit is called, this Configurator should not be used again.

      In the case of a successful commit, changes should be logged. auditParams are interpolated into the auditMessage using the Log4J interpolation style.

      Parameters:
      auditMessage - In the case of a successful commit, the message to pass to be audited
      auditParams - In the case of a successful commit, optional parameters to pass to be interpolated into the message.
      Returns:
      report of the commit status, whether successful, successfully rolled back, or partially rolled back with errors
    • add

      UUID add(Operation operation)
      Adds an Operation step to the transaction.
      Parameters:
      operation - the step to be added
      Returns:
      a unique identifier for the step