/** * Log a warning for the resource at the provided address and the given attributes. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attributes attributes we are warning about */ public void logAttributeWarning(PathAddress address, Set<String> attributes) { logAttributeWarning(address, null, null, attributes); }
/** * Log warning for the resource at the provided address and single attribute, using the provided detail * message. * * @param address where warning occurred * @param message custom error message to append * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String message, String attribute) { logAttributeWarning(address, null, message, attribute); }
/** * Log warning for the resource at the provided address and single attribute, using the provided detail * message. * * @param address where warning occurred * @param message custom error message to append * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String message, String attribute) { logAttributeWarning(address, null, message, attribute); }
/** * Log a warning for the resource at the provided address and a single attribute. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String attribute) { logAttributeWarning(address, null, null, attribute); }
/** * Log warning for the resource at the provided address and single attribute, using the provided detail * message. * * @param address where warning occurred * @param message custom error message to append * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String message, String attribute) { logAttributeWarning(address, null, message, attribute); }
/** * Log a warning for the resource at the provided address and a single attribute. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String attribute) { logAttributeWarning(address, null, null, attribute); }
/** * Log warning for the resource at the provided address and single attribute, using the provided detail * message. * * @param address where warning occurred * @param message custom error message to append * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String message, String attribute) { logAttributeWarning(address, null, message, attribute); }
/** * Log a warning for the resource at the provided address and the given attributes. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attributes attributes we are warning about */ public void logAttributeWarning(PathAddress address, Set<String> attributes) { logAttributeWarning(address, null, null, attributes); }
/** * Log a warning for the resource at the provided address and a single attribute. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String attribute) { logAttributeWarning(address, null, null, attribute); }
/** * Log a warning for the resource at the provided address and the given attributes. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attributes attributes we are warning about */ public void logAttributeWarning(PathAddress address, Set<String> attributes) { logAttributeWarning(address, null, null, attributes); }
/** * Log a warning for the resource at the provided address and a single attribute. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attribute attribute we are warning about */ public void logAttributeWarning(PathAddress address, String attribute) { logAttributeWarning(address, null, null, attribute); }
/** * Log a warning for the resource at the provided address and the given attributes. The detail message is a default * 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.' * * @param address where warning occurred * @param attributes attributes we are warning about */ public void logAttributeWarning(PathAddress address, Set<String> attributes) { logAttributeWarning(address, null, null, attributes); }
@Override public void transformResource(ResourceTransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { ModelNode model = resource.getModel(); if (model.hasDefined(SLOT_ATTRIBUTE_NAME)) { ModelNode slot = model.get(SLOT_ATTRIBUTE_NAME); if (!SLOT_DEFAULT_VALUE.equals(slot.asString())) { context.getLogger().logAttributeWarning(address, MESSAGES.invalidJSFSlotValue(slot.asString()), SLOT_ATTRIBUTE_NAME); } } Set<String> attributes = new HashSet<String>(); for (Property prop : resource.getModel().asPropertyList()) { attributes.add(prop.getName()); } attributes.remove(SLOT_ATTRIBUTE_NAME); if (!attributes.isEmpty()) { context.getLogger().logAttributeWarning(address, ControllerMessages.MESSAGES.attributesAreNotUnderstoodAndMustBeIgnored(), attributes); } } });
@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); } } });
private void transformResourceInt(TransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { Set<String> problems = checkModelNode(resource.getModel()); if (problems != null) { 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, problems)); 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, problems); } } }
private void transformResourceInt(TransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { Set<String> problems = checkModelNode(resource.getModel()); if (problems != null) { 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, problems)); 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, problems); } } }
@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); }
private void transformResourceInt(TransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { Set<String> problems = checkModelNode(resource.getModel()); if (problems != null) { 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, problems)); 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, problems); } } }
private void transformResourceInt(TransformationContext context, PathAddress address, Resource resource) throws OperationFailedException { Set<String> problems = checkModelNode(resource.getModel()); if (problems != null) { 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, problems)); 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, problems); } } }
@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); }