Class TransformersLogger


  • public class TransformersLogger
    extends Object
    Logger utility class that provides a unified mechanism to log warnings that occur as part of the transformation process.

    All log messages are queued for time of transformation and then written in the log as a single entry for all problems that occurred. This way it is simple to see what potential problems could happen for each host that is of different version than the domain controller

    Sample output would look like this: There were some problems during transformation process for target host: 'host-name' Problems found: Transforming operation %s at resource %s to subsystem '%s' model version '%s' -- attributes %s attributes were rejected Transforming operation %s at resource %s to core model '%s' model version '%s' -- attributes %s attributes were rejected

    Author:
    Tomaz Cerar (c) 2013 Red Hat Inc.
    • Method Detail

      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        String 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.'
        Parameters:
        address - where warning occurred
        attribute - attribute we are warning about
      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        Set<String> attributes)
        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.'
        Parameters:
        address - where warning occurred
        attributes - attributes we are warning about
      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        String message,
                                        String attribute)
        Log warning for the resource at the provided address and single attribute, using the provided detail message.
        Parameters:
        address - where warning occurred
        message - custom error message to append
        attribute - attribute we are warning about
      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        String message,
                                        Set<String> attributes)
        Log a warning for the resource at the provided address and the given attributes, using the provided detail message.
        Parameters:
        address - where warning occurred
        message - custom error message to append
        attributes - attributes we that have problems about
      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        org.jboss.dmr.ModelNode operation,
                                        String message,
                                        String attribute)
        Log a warning for the given operation at the provided address for the given attribute, using the provided detail message.
        Parameters:
        address - where warning occurred
        operation - where which problem occurred
        message - custom error message to append
        attribute - attribute we that has problem
      • logAttributeWarning

        public void logAttributeWarning​(PathAddress address,
                                        org.jboss.dmr.ModelNode operation,
                                        String message,
                                        Set<String> attributes)
        Log a warning for the given operation at the provided address for the given attributes, using the provided detail message.
        Parameters:
        address - where warning occurred
        operation - where which problem occurred
        message - custom error message to append
        attributes - attributes we that have problems about
      • getAttributeWarning

        public String getAttributeWarning​(PathAddress address,
                                          org.jboss.dmr.ModelNode operation,
                                          String message,
                                          Set<String> attributes)
        Get a warning message for the given operation at the provided address for the passed attributes with the given custom message appended. Intended for use in providing a failure description for an operation or an exception message for an OperationFailedException.
        Parameters:
        address - where warning occurred
        operation - where which problem occurred
        message - custom error message to append
        attributes - attributes we that have problems about
      • getAttributeWarning

        public String getAttributeWarning​(PathAddress address,
                                          org.jboss.dmr.ModelNode operation,
                                          String... attributes)
        Get a warning message for the given operation at the provided address for the passed attributes with a default message appended. Intended for use in providing a failure description for an operation or an exception message for an OperationFailedException. The default appended message is 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.'
        Parameters:
        address - where warning occurred
        operation - where which problem occurred
        attributes - attributes we that have problems about
      • getAttributeWarning

        public String getAttributeWarning​(PathAddress address,
                                          org.jboss.dmr.ModelNode operation,
                                          Set<String> attributes)
        Get a warning message for the given operation at the provided address for the passed attributes with a default message appended. This is useful when you need to pass it as result of getFailureMessage() The default appended message is 'Attributes are not understood in the target model version and this resource will need to be ignored on the target host.'
        Parameters:
        address - where warning occurred
        operation - where which problem occurred
        attributes - attributes we that have problems about
      • getRejectedResourceWarning

        public String getRejectedResourceWarning​(PathAddress address,
                                                 org.jboss.dmr.ModelNode operation)
      • logRejectedResourceWarning

        public void logRejectedResourceWarning​(PathAddress address,
                                               org.jboss.dmr.ModelNode operation)
      • logDiscardedResourceWarning

        public void logDiscardedResourceWarning​(PathAddress address,
                                                String host)
      • logWarning

        public void logWarning​(String message)
        Log a free-form warning
        Parameters:
        message - the warning message. Cannot be null