@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { String name = Operations.getName(operation); OperationTransformer transformer = this.transformers.get(name); return (transformer != null) ? transformer.transformOperation(context, address, operation) : new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
ModelNode operation = originalOperation; for (OperationTransformer transformer: this.transformers) { operation = transformer.transformOperation(context, address, operation).getTransformedOperation();
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { if (attributeNames.contains(operation.get(NAME).asString()) && discardApprover.isOperationDiscardAllowed(context, address, operation)) { return OperationTransformer.DISCARD.transformOperation(context, address, operation); } return OperationTransformer.DEFAULT.transformOperation(context, address, operation); } }
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { if (attributeNames.contains(operation.get(NAME).asString()) && discardApprover.isOperationDiscardAllowed(context, address, operation)) { return OperationTransformer.DISCARD.transformOperation(context, address, operation); } return OperationTransformer.DEFAULT.transformOperation(context, address, operation); } }
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { if (attributeNames.contains(operation.get(NAME).asString()) && discardApprover.isOperationDiscardAllowed(context, address, operation)) { return OperationTransformer.DISCARD.transformOperation(context, address, operation); } return OperationTransformer.DEFAULT.transformOperation(context, address, operation); } }
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { if (attributeNames.contains(operation.get(NAME).asString()) && discardApprover.isOperationDiscardAllowed(context, address, operation)) { return OperationTransformer.DISCARD.transformOperation(context, address, operation); } return OperationTransformer.DEFAULT.transformOperation(context, address, operation); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); if (attributeNames.contains(attribute)) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); if (attributeNames.contains(attribute)) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); if (attributeNames.contains(attribute)) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); if (attributeNames.contains(attribute)) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { String attributeName = operation.require(NAME).asString(); if (!SLOT_ATTRIBUTE_NAME.equals(attributeName)) { return DEFAULT.transformOperation(context, address, operation); } else { context.getLogger().logAttributeWarning(address, ControllerMessages.MESSAGES.attributesAreNotUnderstoodAndMustBeIgnored(), attributeName); return DISCARD.transformOperation(context, address, operation); } } });
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { String name = Operations.getName(operation); OperationTransformer transformer = this.transformers.get(name); return (transformer != null) ? transformer.transformOperation(context, address, operation) : new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException { if (operation.require(ModelDescriptionConstants.NAME).asString().equals(JmxAuditLoggerResourceDefinition.ENABLED.getName())){ OperationRejectionPolicy rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return JmxMessages.MESSAGES.auditLogEnabledMustBeFalse(); } }; return new TransformedOperation(null, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); } return OperationTransformer.DISCARD.transformOperation(context, address, operation); } });
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode original) throws OperationFailedException{ final ModelNode operation = original.clone(); final PathAddress transformedAddress = transformer.transformAddress(address); operation.get(ModelDescriptionConstants.OP_ADDR).set(transformedAddress.toModelNode()); // Hand-off to a local operation transformer at the right address final String operationName = operation.get(ModelDescriptionConstants.OP).asString(); final OperationTransformer aliasTransformer = context.getTarget().resolveTransformer(context, transformedAddress, operationName); if(aliasTransformer != null) { return aliasTransformer.transformOperation(context, transformedAddress, operation); } else { return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode original) throws OperationFailedException{ final ModelNode operation = original.clone(); final PathAddress transformedAddress = transformer.transformAddress(address); operation.get(ModelDescriptionConstants.OP_ADDR).set(transformedAddress.toModelNode()); // Hand-off to a local operation transformer at the right address final String operationName = operation.get(ModelDescriptionConstants.OP).asString(); final OperationTransformer aliasTransformer = context.getTarget().resolveTransformer(transformedAddress, operationName); if(aliasTransformer != null) { return aliasTransformer.transformOperation(context, transformedAddress, operation); } else { return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode original) throws OperationFailedException{ final ModelNode operation = original.clone(); final PathAddress transformedAddress = transformer.transformAddress(address); operation.get(ModelDescriptionConstants.OP_ADDR).set(transformedAddress.toModelNode()); // Hand-off to a local operation transformer at the right address final String operationName = operation.get(ModelDescriptionConstants.OP).asString(); final OperationTransformer aliasTransformer = context.getTarget().resolveTransformer(context, transformedAddress, operationName); if(aliasTransformer != null) { return aliasTransformer.transformOperation(context, transformedAddress, operation); } else { return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode original) throws OperationFailedException{ final ModelNode operation = original.clone(); final PathAddress transformedAddress = transformer.transformAddress(address); operation.get(ModelDescriptionConstants.OP_ADDR).set(transformedAddress.toModelNode()); // Hand-off to a local operation transformer at the right address final String operationName = operation.get(ModelDescriptionConstants.OP).asString(); final OperationTransformer aliasTransformer = context.getTarget().resolveTransformer(context, transformedAddress, operationName); if(aliasTransformer != null) { return aliasTransformer.transformOperation(context, transformedAddress, operation); } else { return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); boolean ourAttribute = attributeNames.contains(attribute); final boolean rejectResult = ourAttribute && operation.hasDefined(VALUE); if (rejectResult) { // Create the rejection policy final OperationRejectionPolicy rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, attribute); } }; return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); } else if (ourAttribute) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { final String attribute = operation.require(NAME).asString(); boolean ourAttribute = attributeNames.contains(attribute); final boolean rejectResult = ourAttribute && operation.hasDefined(VALUE); if (rejectResult) { // Create the rejection policy final OperationRejectionPolicy rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, attribute); } }; return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); } else if (ourAttribute) { // It's an attribute the slave doesn't understand, but the new value is "undefined" // Just discard this operation return OperationTransformer.DISCARD.transformOperation(context, address, operation); } // Not relevant to us return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { if (context.getTarget().isIgnoreUnaffectedConfig()) { //Since the cloned profile is a new one it will definitely be ignored on the host with this setting, //so we can just discard it return OperationTransformer.DISCARD.transformOperation(context, address, operation); } return new TransformedOperation(operation, new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { return true; } @Override public String getFailureDescription() { return DomainControllerLogger.ROOT_LOGGER.cloneOperationNotSupportedOnHost(context.getTarget().getHostName()); } }, OperationResultTransformer.ORIGINAL_RESULT); } }