public interface ConfigurationPersister
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ConfigurationPersister.PersistenceResource
Callback for use by callers to
store(org.jboss.dmr.ModelNode, java.util.Set)
to control whether the stored model should be flushed to permanent storage. |
static interface |
ConfigurationPersister.SnapshotInfo
Contains the info about the configuration snapshots
|
| Modifier and Type | Field and Description |
|---|---|
static ConfigurationPersister.SnapshotInfo |
NULL_SNAPSHOT_INFO |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteSnapshot(String name)
Deletes a snapshot using its name.
|
default boolean |
isPersisting()
Gets whether a call to
store(ModelNode, Set) will return a ConfigurationPersister.PersistenceResource that will actually
persist to persistent storage. |
ConfigurationPersister.SnapshotInfo |
listSnapshots()
Gets the names of the snapshots in the snapshots directory
|
List<org.jboss.dmr.ModelNode> |
load()
Load the configuration model, returning it as a list of updates to be
executed by the controller.
|
void |
marshallAsXml(org.jboss.dmr.ModelNode model,
OutputStream output)
Marshals the given configuration model to XML, writing to the given stream.
|
default String |
publish(String target)
Publish the current configuration
|
default String |
snapshot()
Deprecated.
use #snapshot(String name, String message) instead.
|
default String |
snapshot(String name,
String message)
Take a snapshot of the current configuration.
|
ConfigurationPersister.PersistenceResource |
store(org.jboss.dmr.ModelNode model,
Set<PathAddress> affectedAddresses)
Persist the given configuration model if
isPersisting() would return true, otherwise
return a no-op ConfigurationPersister.PersistenceResource. |
void |
successfulBoot()
Called once the xml has been successfully parsed, translated into updates, executed in the target controller
and all services have started successfully.
|
static final ConfigurationPersister.SnapshotInfo NULL_SNAPSHOT_INFO
default boolean isPersisting()
store(ModelNode, Set) will return a ConfigurationPersister.PersistenceResource that will actually
persist to persistent storage. Some implementations may return false until successfulBoot() is
invoked. If this returns false the caller can safely omit any call to store(ModelNode, Set).
The default implementation always returns true
true if a call to store(ModelNode, Set) will return an object that actually writesConfigurationPersister.PersistenceResource store(org.jboss.dmr.ModelNode model, Set<PathAddress> affectedAddresses) throws ConfigurationPersistenceException
isPersisting() would return true, otherwise
return a no-op ConfigurationPersister.PersistenceResource.model - the model to persistaffectedAddresses - the addresses of the resources that were changednullConfigurationPersistenceExceptionvoid marshallAsXml(org.jboss.dmr.ModelNode model,
OutputStream output)
throws ConfigurationPersistenceException
model - the model to persistoutput - the streamConfigurationPersistenceException - if a configuration persistence problem occursList<org.jboss.dmr.ModelNode> load() throws ConfigurationPersistenceException
ConfigurationPersistenceExceptionvoid successfulBoot()
throws ConfigurationPersistenceException
ConfigurationPersistenceExceptionisPersisting()@Deprecated default String snapshot() throws ConfigurationPersistenceException
ConfigurationPersistenceException - if a problem happened when creating the snapshotdefault String snapshot(String name, String message) throws ConfigurationPersistenceException
message - optionnal messageConfigurationPersistenceException - if a problem happened when creating the snapshotdefault String publish(String target) throws ConfigurationPersistenceException
target - the target destination of the publication.ConfigurationPersistenceException - if a problem happened when publishingConfigurationPersister.SnapshotInfo listSnapshots()
void deleteSnapshot(String name)
name - the name of the snapshot (as returned by ConfigurationPersister.SnapshotInfo.names() returned from listSnapshots(). The whole name is not
needed, just enough to uniquely identify it.IllegalArgumentException - if there is no snapshot with the given name, or if the name resolves to more than one snapshot.Copyright © 2019 JBoss by Red Hat. All rights reserved.