public class CommandTraceUtil extends Object
| Constructor and Description |
|---|
CommandTraceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getCommandResponseSize(Object response)
Returns the actual size, in bytes, of the given response but only if it
exceeds the given configured threshold (-1 is returned otherwise).
|
static String |
getCommandResponseString(Object response)
Returns a good string to use to log the command response.
|
static int |
getCommandSize(Command command)
Returns the actual size, in bytes, of the given command but only if it
exceeds the given configured threshold (-1 is returned otherwise).
|
static String |
getCommandString(Command command)
Returns a good string to use to log the command.
|
static String |
getConfigString(Command command)
Returns the string that represents the command configuration.
|
static Boolean |
getSettingTraceCommandConfig() |
static Integer |
getSettingTraceCommandResponseResults() |
static Integer |
getSettingTraceCommandResponseSizeThreshold() |
static Integer |
getSettingTraceCommandSizeThreshold() |
static void |
setSettingTraceCommandConfig(Boolean val) |
static void |
setSettingTraceCommandResponseResults(Integer val) |
static void |
setSettingTraceCommandResponseSizeThreshold(Integer val) |
static void |
setSettingTraceCommandSizeThreshold(Integer val) |
public static Boolean getSettingTraceCommandConfig()
public static void setSettingTraceCommandConfig(Boolean val)
public static Integer getSettingTraceCommandResponseResults()
public static void setSettingTraceCommandResponseResults(Integer val)
public static Integer getSettingTraceCommandSizeThreshold()
public static void setSettingTraceCommandSizeThreshold(Integer val)
public static Integer getSettingTraceCommandResponseSizeThreshold()
public static void setSettingTraceCommandResponseSizeThreshold(Integer val)
public static String getConfigString(Command command)
command - the command whose configuration is stringified and returnedpublic static String getCommandString(Command command)
command - the command to convert to a stringpublic static String getCommandResponseString(Object response)
response - the command response to convert to a stringpublic static int getCommandSize(Command command) throws NotSerializableException
SYSPROP_TRACE_COMMAND_SIZE_THRESHOLD defines this threshold).
Note that if the command is not serializable, an exception is thrown.
All commands must be serializable; therefore, if we trace a command that is
not, it is appropriate for us to draw attention to it by throwing an
exception from this method.command - NotSerializableException - if failed to serialize the commandpublic static int getCommandResponseSize(Object response) throws NotSerializableException
SYSPROP_TRACE_COMMAND_RESPONSE_SIZE_THRESHOLD defines this threshold).
Note that if the response is not serializable, a runtime exception is thrown.
All responses must be serializable; therefore, if we trace a response that is
not, it is appropriate for us to draw attention to it by throwing an
exception from this method.response - NotSerializableException - if failed to serialize the responseCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.