@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { // Check the model final Set<String> attributes = checkModel(operation, context); final boolean reject = attributes.size() > 0; final OperationRejectionPolicy rejectPolicy; if (reject) { rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes); } }; } else { rejectPolicy = OperationTransformer.DEFAULT_REJECTION_POLICY; } // Return untransformed return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { // Check the model final Set<String> attributes = checkModel(operation, context); final boolean reject = attributes.size() > 0; final OperationRejectionPolicy rejectPolicy; if (reject) { rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, MESSAGES.attributesDontSupportExpressions(), attributes); } }; } else { rejectPolicy = OperationTransformer.DEFAULT_REJECTION_POLICY; } // Return untransformed return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { // Check the model final Set<String> attributes = checkModel(operation, context); final boolean reject = attributes.size() > 0; final OperationRejectionPolicy rejectPolicy; if (reject) { rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes); } }; } else { rejectPolicy = OperationTransformer.DEFAULT_REJECTION_POLICY; } // Return untransformed return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); }
@Override public TransformedOperation transformOperation(final TransformationContext context, final PathAddress address, final ModelNode operation) throws OperationFailedException { // Check the model final Set<String> attributes = checkModel(operation, context); final boolean reject = attributes.size() > 0; final OperationRejectionPolicy rejectPolicy; if (reject) { rejectPolicy = new OperationRejectionPolicy() { @Override public boolean rejectOperation(ModelNode preparedResult) { // Reject successful operations return true; } @Override public String getFailureDescription() { return context.getLogger().getAttributeWarning(address, operation, MESSAGES.attributesDontSupportExpressions(), attributes); } }; } else { rejectPolicy = OperationTransformer.DEFAULT_REJECTION_POLICY; } // Return untransformed return new TransformedOperation(operation, rejectPolicy, OperationResultTransformer.ORIGINAL_RESULT); }
@Override public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) throws OperationFailedException { // Check the model final ModelNode model = resource.getModel(); final Set<String> attributes = checkModel(model, context); if (attributes.size() > 0) { if (context.getTarget().isIgnoredResourceListAvailableAtRegistration()) { // Slave is 7.2.x or higher and we know this resource is not ignored List<String> msg = Collections.singletonList(context.getLogger().getAttributeWarning(address, null, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes)); final TransformationTarget tgt = context.getTarget(); final String legacyHostName = tgt.getHostName(); final ModelVersion coreVersion = tgt.getVersion(); final String subsystemName = findSubsystemName(address); final ModelVersion usedVersion = subsystemName == null ? coreVersion : tgt.getSubsystemVersion(subsystemName); // Target is 7.2.x or higher so we should throw an error if (subsystemName != null) { throw ControllerLogger.ROOT_LOGGER.rejectAttributesSubsystemModelResourceTransformer(address, legacyHostName, subsystemName, usedVersion, msg); } throw ControllerLogger.ROOT_LOGGER.rejectAttributesCoreModelResourceTransformer(address, legacyHostName, usedVersion, msg); } else { // 7.1.x slave; resource *may* be ignored so we can't fail; just log context.getLogger().logAttributeWarning(address, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes); } } final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource); childContext.processChildren(resource); }
@Override public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) throws OperationFailedException { // Check the model final ModelNode model = resource.getModel(); final Set<String> attributes = checkModel(model, context); if (attributes.size() > 0) { if (context.getTarget().isIgnoredResourceListAvailableAtRegistration()) { // Slave is 7.2.x or higher and we know this resource is not ignored List<String> msg = Collections.singletonList(context.getLogger().getAttributeWarning(address, null, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes)); final TransformationTarget tgt = context.getTarget(); final String legacyHostName = tgt.getHostName(); final ModelVersion coreVersion = tgt.getVersion(); final String subsystemName = findSubsystemName(address); final ModelVersion usedVersion = subsystemName == null ? coreVersion : tgt.getSubsystemVersion(subsystemName); // Target is 7.2.x or higher so we should throw an error if (subsystemName != null) { throw ControllerLogger.ROOT_LOGGER.rejectAttributesSubsystemModelResourceTransformer(address, legacyHostName, subsystemName, usedVersion, msg); } throw ControllerLogger.ROOT_LOGGER.rejectAttributesCoreModelResourceTransformer(address, legacyHostName, usedVersion, msg); } else { // 7.1.x slave; resource *may* be ignored so we can't fail; just log context.getLogger().logAttributeWarning(address, ControllerLogger.ROOT_LOGGER.attributesDontSupportExpressions(), attributes); } } final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource); childContext.processChildren(resource); }
@Override public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) throws OperationFailedException { // Check the model final ModelNode model = resource.getModel(); final Set<String> attributes = checkModel(model, context); if (attributes.size() > 0) { if (context.getTarget().isIgnoredResourceListAvailableAtRegistration()) { // Slave is 7.2.x or higher and we know this resource is not ignored List<String> msg = Collections.singletonList(context.getLogger().getAttributeWarning(address, null, MESSAGES.attributesDontSupportExpressions(), attributes)); final TransformationTarget tgt = context.getTarget(); final String legacyHostName = tgt.getHostName(); final ModelVersion coreVersion = tgt.getVersion(); final String subsystemName = findSubsystemName(address); final ModelVersion usedVersion = subsystemName == null ? coreVersion : tgt.getSubsystemVersion(subsystemName); // Target is 7.2.x or higher so we should throw an error if (subsystemName != null) { throw ControllerMessages.MESSAGES.rejectAttributesSubsystemModelResourceTransformer(address, legacyHostName, subsystemName, usedVersion, msg); } throw ControllerMessages.MESSAGES.rejectAttributesCoreModelResourceTransformer(address, legacyHostName, usedVersion, msg); } else { // 7.1.x slave; resource *may* be ignored so we can't fail; just log context.getLogger().logAttributeWarning(address, MESSAGES.attributesDontSupportExpressions(), attributes); } } final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource); childContext.processChildren(resource); }
@Override public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) throws OperationFailedException { // Check the model final ModelNode model = resource.getModel(); final Set<String> attributes = checkModel(model, context); if (attributes.size() > 0) { if (context.getTarget().isIgnoredResourceListAvailableAtRegistration()) { // Slave is 7.2.x or higher and we know this resource is not ignored List<String> msg = Collections.singletonList(context.getLogger().getAttributeWarning(address, null, MESSAGES.attributesDontSupportExpressions(), attributes)); final TransformationTarget tgt = context.getTarget(); final String legacyHostName = tgt.getHostName(); final ModelVersion coreVersion = tgt.getVersion(); final String subsystemName = findSubsystemName(address); final ModelVersion usedVersion = subsystemName == null ? coreVersion : tgt.getSubsystemVersion(subsystemName); // Target is 7.2.x or higher so we should throw an error if (subsystemName != null) { throw ControllerMessages.MESSAGES.rejectAttributesSubsystemModelResourceTransformer(address, legacyHostName, subsystemName, usedVersion, msg); } throw ControllerMessages.MESSAGES.rejectAttributesCoreModelResourceTransformer(address, legacyHostName, usedVersion, msg); } else { // 7.1.x slave; resource *may* be ignored so we can't fail; just log context.getLogger().logAttributeWarning(address, MESSAGES.attributesDontSupportExpressions(), attributes); } } final ResourceTransformationContext childContext = context.addTransformedResource(PathAddress.EMPTY_ADDRESS, resource); childContext.processChildren(resource); }