Class TransformersLogger
- java.lang.Object
-
- org.jboss.as.controller.transform.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.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.static TransformersLogger
getLogger(TransformationTarget target)
String
getRejectedResourceWarning(PathAddress address, org.jboss.dmr.ModelNode operation)
void
logAttributeWarning(PathAddress address, String attribute)
Log a warning for the resource at the provided address and a single attribute.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.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.void
logAttributeWarning(PathAddress address, Set<String> attributes)
Log a warning for the resource at the provided address and the given attributes.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.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.void
logDiscardedResourceWarning(PathAddress address, String host)
void
logRejectedResourceWarning(PathAddress address, org.jboss.dmr.ModelNode operation)
void
logWarning(String message)
Log a free-form warning
-
-
-
Method Detail
-
getLogger
public static TransformersLogger getLogger(TransformationTarget target)
-
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 occurredattribute
- 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 occurredattributes
- 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 occurredmessage
- custom error message to appendattribute
- 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 occurredmessage
- custom error message to appendattributes
- 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 occurredoperation
- where which problem occurredmessage
- custom error message to appendattribute
- 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 occurredoperation
- where which problem occurredmessage
- custom error message to appendattributes
- 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 anOperationFailedException
.- Parameters:
address
- where warning occurredoperation
- where which problem occurredmessage
- custom error message to appendattributes
- 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 anOperationFailedException
. 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 occurredoperation
- where which problem occurredattributes
- 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 occurredoperation
- where which problem occurredattributes
- 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 benull
-
-