@Override protected void finishModelStage( final OperationContext context, final ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, final Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); assert !USEHORNETQSTORE.isAllowExpression() && !USE_JDBC_STORE.isAllowExpression() : "rework this before enabling expression"; if (attributeName.equals(USEHORNETQSTORE.getName()) || attributeName.equals(USE_JDBC_STORE.getName())) { if (newValue.asBoolean() == true) { // check the value of the mutual attribute and disable it if it is set to true final String mutualAttributeName = attributeName.equals(USE_JDBC_STORE.getName()) ? USEHORNETQSTORE.getName() : USE_JDBC_STORE.getName(); ModelNode resourceModel = model.getModel(); if (resourceModel.hasDefined(mutualAttributeName) && resourceModel.get(mutualAttributeName).asBoolean()) { resourceModel.get(mutualAttributeName).set(new ModelNode(false)); } } } }
@Override protected void validateUpdatedModel(OperationContext context, Resource model) throws OperationFailedException { super.validateUpdatedModel(context, model); validateResourceModel(model.getModel(), true); }