org.eclipse.paho.client.mqttv3.util
Class Debug

java.lang.Object
  extended by org.eclipse.paho.client.mqttv3.util.Debug

public class Debug
extends Object

Utility to help debug problems with the Paho MQTT client Once initialised a call to dumpClientDebug will force any memory trace together with pertinent client and system state to the main log facility. No client wide lock is taken when the dump is progress. This means the set of client state may not be consistent as the client can still be processing work while the dump is in progress.


Constructor Summary
Debug(String clientID, ClientComms comms)
          Set the debug facility up for a specific client
 
Method Summary
 void dumpBaseDebug()
          Dump of JVM wide debug info.
 void dumpClientComms()
          Dump interesting variables from ClientComms
 void dumpClientDebug()
          Dump maximum debug info.
 void dumpClientState()
          Dump interesting variables from ClientState
 void dumpConOptions()
          Dump Connection options
protected  void dumpMemoryTrace()
          If memory trace is being used a request is made to push it to the target handler.
static String dumpProperties(Properties props, String name)
          Return a set of properties as a formatted string
 void dumpSystemProperties()
          Dump the current set of system.properties to a log record
protected  void dumpVersion()
          Dump information that show the version of the MQTT client being used.
static String left(String s, int width, char fillChar)
          Left justify a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Debug

public Debug(String clientID,
             ClientComms comms)
Set the debug facility up for a specific client

Parameters:
clientID - the ID of the client being debugged
comms - the ClientComms object of the client being debugged
Method Detail

dumpClientDebug

public void dumpClientDebug()
Dump maximum debug info. This includes state specific to a client as well as debug that is JVM wide like trace and system properties. All state is written as debug log entries.


dumpBaseDebug

public void dumpBaseDebug()
Dump of JVM wide debug info. This includes trace and system properties. Includes trace and system properties


dumpMemoryTrace

protected void dumpMemoryTrace()
If memory trace is being used a request is made to push it to the target handler.


dumpVersion

protected void dumpVersion()
Dump information that show the version of the MQTT client being used.


dumpSystemProperties

public void dumpSystemProperties()
Dump the current set of system.properties to a log record


dumpClientState

public void dumpClientState()
Dump interesting variables from ClientState


dumpClientComms

public void dumpClientComms()
Dump interesting variables from ClientComms


dumpConOptions

public void dumpConOptions()
Dump Connection options


dumpProperties

public static String dumpProperties(Properties props,
                                    String name)
Return a set of properties as a formatted string


left

public static String left(String s,
                          int width,
                          char fillChar)
Left justify a string.

Parameters:
s - the string to justify
width - the field width to justify within
fillChar - the character to fill with
Returns:
the justified string.


Copyright © 2013. All Rights Reserved.