use of org.infinispan.configuration.cache.BackupConfigurationBuilder in project wildfly by wildfly.
the class BackupsBuilder method configure.
@Override
public Builder<SitesConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException {
this.backups.clear();
if (model.hasDefined(BackupResourceDefinition.WILDCARD_PATH.getKey())) {
SitesConfigurationBuilder builder = new ConfigurationBuilder().sites();
for (Property property : model.get(BackupResourceDefinition.WILDCARD_PATH.getKey()).asPropertyList()) {
String siteName = property.getName();
ModelNode backup = property.getValue();
BackupConfigurationBuilder backupBuilder = builder.addBackup();
backupBuilder.site(siteName).enabled(ENABLED.resolveModelAttribute(context, backup).asBoolean()).backupFailurePolicy(ModelNodes.asEnum(FAILURE_POLICY.resolveModelAttribute(context, backup), BackupFailurePolicy.class)).replicationTimeout(TIMEOUT.resolveModelAttribute(context, backup).asLong()).strategy(ModelNodes.asEnum(STRATEGY.resolveModelAttribute(context, backup), BackupStrategy.class)).takeOffline().afterFailures(AFTER_FAILURES.resolveModelAttribute(context, backup).asInt()).minTimeToWait(MIN_WAIT.resolveModelAttribute(context, backup).asLong());
this.backups.put(siteName, backupBuilder.create());
}
}
return this;
}
Aggregations