public class ConfiguratorImpl extends Object implements Configurator
Sequentially processes Operation
s, committing their changes. If a failure occurs
during the processing, a rollback is attempted of those handlers that had already been committed.
When the commit()
operation completes - either successfully, with a successful rollback,
or with a failure to rollback - it returns a OperationReport
of the outcome. In the case
of rollback failures, callers of this class should inform users of those failures so they may
manually intercede.
This class does not guarantee that it can reliably rollback changes in the case of failure. It makes a best-effort to revert changes and reports the outcome.
To use this class, first instantiate then invoke the various methods for feature, bundle,
config, etc. updates in the order they should be applied. When all have been completed, call the
commit()
method to write the changes to the system. The resulting OperationReport
will have the outcome.
Constructor and Description |
---|
ConfiguratorImpl() |
Modifier and Type | Method and Description |
---|---|
UUID |
add(Operation operation)
Adds an
Operation step to the transaction. |
OperationReport |
commit(String auditMessage,
String... auditParams)
Sequentially invokes all the
Operation s, committing their changes. |
public OperationReport commit(String auditMessage, String... auditParams)
Operation
s, committing their changes. If a failure occurs
during the processing, a rollback is attempted of those handlers that had already been
committed.
In the case of a successful commit, the SecurityLogger
will be invoked to log
changes.
commit
in interface Configurator
auditMessage
- In the case of a successful commit, the message to pass to the SecurityLogger
auditParams
- In the case of a successful commit, the optional parameters to pass to the
SecurityLogger
to be interpolated into the messagepublic UUID add(Operation operation)
Configurator
Operation
step to the transaction.add
in interface Configurator
operation
- the step to be addedThis work is licensed under a Creative Commons Attribution 4.0 International License.