use of org.apache.activemq.artemis.core.config.HAPolicyConfiguration in project wildfly by wildfly.
the class HAPolicyConfigurationBuilder method addHAPolicyConfiguration.
public void addHAPolicyConfiguration(OperationContext context, Configuration configuration, ModelNode model) throws OperationFailedException {
if (!model.hasDefined(HA_POLICY)) {
return;
}
Property prop = model.get(HA_POLICY).asProperty();
ModelNode haPolicy = prop.getValue();
final HAPolicyConfiguration haPolicyConfiguration;
String type = prop.getName();
switch(type) {
case LIVE_ONLY:
{
haPolicyConfiguration = buildLiveOnlyConfiguration(context, haPolicy);
break;
}
case REPLICATION_MASTER:
{
haPolicyConfiguration = buildReplicationMasterConfiguration(context, haPolicy);
break;
}
case REPLICATION_SLAVE:
{
haPolicyConfiguration = buildReplicationSlaveConfiguration(context, haPolicy);
break;
}
case REPLICATION_COLOCATED:
{
haPolicyConfiguration = buildReplicationColocatedConfiguration(context, haPolicy);
break;
}
case SHARED_STORE_MASTER:
{
haPolicyConfiguration = buildSharedStoreMasterConfiguration(context, haPolicy);
break;
}
case SHARED_STORE_SLAVE:
{
haPolicyConfiguration = buildSharedStoreSlaveConfiguration(context, haPolicy);
break;
}
case SHARED_STORE_COLOCATED:
{
haPolicyConfiguration = buildSharedStoreColocatedConfiguration(context, haPolicy);
break;
}
default:
{
throw new OperationFailedException("unknown ha policy type");
}
}
configuration.setHAPolicyConfiguration(haPolicyConfiguration);
}
Aggregations