|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.util.CommandTraceUtil
public class CommandTraceUtil
Static utility methods useful when logging commands, used mainly for debugging a client and remote endpoint.
| Constructor Summary | |
|---|---|
CommandTraceUtil()
|
|
| Method Summary | |
|---|---|
static int |
getCommandResponseSize(java.lang.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 java.lang.String |
getCommandResponseString(java.lang.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 java.lang.String |
getCommandString(Command command)
Returns a good string to use to log the command. |
static java.lang.String |
getConfigString(Command command)
Returns the string that represents the command configuration. |
static java.lang.Boolean |
getSettingTraceCommandConfig()
|
static java.lang.Integer |
getSettingTraceCommandResponseResults()
|
static java.lang.Integer |
getSettingTraceCommandResponseSizeThreshold()
|
static java.lang.Integer |
getSettingTraceCommandSizeThreshold()
|
static void |
setSettingTraceCommandConfig(java.lang.Boolean val)
|
static void |
setSettingTraceCommandResponseResults(java.lang.Integer val)
|
static void |
setSettingTraceCommandResponseSizeThreshold(java.lang.Integer val)
|
static void |
setSettingTraceCommandSizeThreshold(java.lang.Integer val)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandTraceUtil()
| Method Detail |
|---|
public static java.lang.Boolean getSettingTraceCommandConfig()
public static void setSettingTraceCommandConfig(java.lang.Boolean val)
public static java.lang.Integer getSettingTraceCommandResponseResults()
public static void setSettingTraceCommandResponseResults(java.lang.Integer val)
public static java.lang.Integer getSettingTraceCommandSizeThreshold()
public static void setSettingTraceCommandSizeThreshold(java.lang.Integer val)
public static java.lang.Integer getSettingTraceCommandResponseSizeThreshold()
public static void setSettingTraceCommandResponseSizeThreshold(java.lang.Integer val)
public static java.lang.String getConfigString(Command command)
command - the command whose configuration is stringified and returned
public static java.lang.String getCommandString(Command command)
command - the command to convert to a string
public static java.lang.String getCommandResponseString(java.lang.Object response)
response - the command response to convert to a string
public static int getCommandSize(Command command)
throws java.io.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 -
java.io.NotSerializableException - if failed to serialize the command
public static int getCommandResponseSize(java.lang.Object response)
throws java.io.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 -
java.io.NotSerializableException - if failed to serialize the response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||