@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); } }
@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); } }
public TransformedOperation transformOperation(ModelVersion modelVersion, ModelNode operation, TransformerOperationAttachment attachment) throws OperationFailedException { checkIsMainController(); TransformerRegistry transformerRegistry = extensionRegistry.getTransformerRegistry(); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); Map<PathAddress, ModelVersion> subsystemVersions = Collections.<PathAddress, ModelVersion>emptyMap(); OperationTransformerRegistry registry = transformerRegistry.resolveHost(modelVersion, subsystemVersions); TransformationTarget target = TransformationTargetImpl.create(null, extensionRegistry.getTransformerRegistry(), modelVersion, subsystemVersions, TransformationTarget.TransformationTargetType.DOMAIN); TransformationContext transformationContext = createTransformationContext(target, attachment); OperationTransformer operationTransformer = registry.resolveOperationTransformer(address, operation.get(OP).asString(), null).getTransformer(); if (operationTransformer != null) { return operationTransformer.transformOperation(transformationContext, address, operation); } return new OperationTransformer.TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); }
public TransformedOperation transformOperation(ModelVersion modelVersion, ModelNode operation, TransformerOperationAttachment attachment) throws OperationFailedException { checkIsMainController(); TransformerRegistry transformerRegistry = extensionRegistry.getTransformerRegistry(); PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); Map<PathAddress, ModelVersion> subsystemVersions = Collections.<PathAddress, ModelVersion>emptyMap(); OperationTransformerRegistry registry = transformerRegistry.resolveHost(modelVersion, subsystemVersions); TransformationTarget target = TransformationTargetImpl.create(null, extensionRegistry.getTransformerRegistry(), modelVersion, subsystemVersions, TransformationTarget.TransformationTargetType.DOMAIN); TransformationContext transformationContext = createTransformationContext(target, attachment); OperationTransformer operationTransformer = registry.resolveOperationTransformer(address, operation.get(OP).asString(), null).getTransformer(); if (operationTransformer != null) { return operationTransformer.transformOperation(transformationContext, address, operation); } return new OperationTransformer.TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); }
@Override public OperationTransformer.TransformedOperation transformOperation(final TransformationContext context, final ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String operationName = operation.require(OP).asString(); TransformationContext opCtx = ResourceTransformationContextImpl.wrapForOperation(context, operation); final OperationTransformer transformer = target.resolveTransformer(opCtx, address, operationName); if (transformer == null) { ControllerLogger.ROOT_LOGGER.tracef("operation %s does not need transformation", operation); return new OperationTransformer.TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } // Transform the path address final PathAddress transformed = transformAddress(address, target); // Update the operation using the new path address operation.get(OP_ADDR).set(transformed.toModelNode()); // TODO should this happen by default? OperationTransformer.TransformedOperation res = transformer.transformOperation(opCtx, transformed, operation); context.getLogger().flushLogQueue(); return res; }
@Override public OperationTransformer.TransformedOperation transformOperation(final OperationContext operationContext, final ModelNode operation) throws OperationFailedException { final PathAddress original = PathAddress.pathAddress(operation.require(OP_ADDR)); final String operationName = operation.require(OP).asString(); // Transform the path address final PathAddress transformed = transformAddress(original, target); // Update the operation using the new path address operation.get(OP_ADDR).set(transformed.toModelNode()); // TODO should this happen by default? final TransformationContext context = ResourceTransformationContextImpl.create(operationContext, target, transformed, original, false); final OperationTransformer transformer = target.resolveTransformer(context, original, operationName); if (transformer == null) { ControllerLogger.ROOT_LOGGER.tracef("operation %s does not need transformation", operation); return new OperationTransformer.TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT); } final OperationTransformer.TransformedOperation op = transformer.transformOperation(context, transformed, operation); context.getLogger().flushLogQueue(); return op; }