Class NettraceUtil

java.lang.Object
com.isode.dsapi.internal.NettraceUtil

public class NettraceUtil extends Object
Utility class for creating and managing Nettraces in dsapi.
Since:
16.0
Author:
ac
  • Constructor Details

    • NettraceUtil

      public NettraceUtil()
  • Method Details

    • getPresentationAddressForNettraceOn

      public static String getPresentationAddressForNettraceOn(String serverPA) throws BadAddressException
      Sets up and starts a Nettrace listing in to a server.
      Parameters:
      serverPA - A string representation of the Presentation Address of the server. This should not be null.
      Returns:
      The string representation of the Presentation Address to connect to the Nettrace. This may be null if there was an error generating the presentation address.
      Throws:
      BadAddressException - If serverPA is null or not a valid presentation address; of if their is an error generating the presentation address for the Nettrace
    • releaseNettraceForAddress

      public static void releaseNettraceForAddress(String nettracePA)
      Shuts down a given Nettrace.
      Parameters:
      nettracePA - The Presentation Address of the Nettrace to shutdown. This should not be null. If their is no corresponding Nettrace registered at the Presentation Address then nothing will be done.
    • addObserverForNettrace

      public static void addObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA)
      Registers a NettraceObserver with a Nettrace.
      Parameters:
      observer - The NettraceObserver to register. This can be null in which case nothing will be done.
      nettracePA - The presentation address of the Nettrace. This should not be null. If there is no corresponding Nettrace at this address then nothing will be done.
    • removeObserverForNettrace

      public static void removeObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA)
      Unregisters a NettraceObserver with a Nettrace.
      Parameters:
      observer - The NettraceObserver to unregister. This can be null in which case nothing will be done.
      nettracePA - The presentation address of the Nettrace. This should not be null. If there is no corresponding Nettrace at this address then nothing will be done.
    • getLastExceptionForNettrace

      public static Exception getLastExceptionForNettrace(String NettracePA)
      Returns the last Exception of the given Nettrace.
      Parameters:
      NettracePA - The presentation address of the Nettrace. This should not be null. If there is no corresponding Nettrace at this address then the function will return null
      Returns:
      The last Exception thrown by the Nettrace, or null if it has not thrown any exceptions, or no nettrace exists at the given presentation address.