|
||||||||||
| 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(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)
|
| 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 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 returned
public static String getCommandString(Command command)
command - the command to convert to a string
public static String getCommandResponseString(Object response)
response - the command response to convert to a string
public 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 command
public 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 response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||