Package com.isode.dsapi.internal
Class NettraceUtil
java.lang.Object
com.isode.dsapi.internal.NettraceUtil
Utility class for creating and managing
Nettraces in dsapi.- Since:
- 16.0
- Author:
- ac
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA) Registers aNettraceObserverwith aNettrace.static ExceptiongetLastExceptionForNettrace(String NettracePA) Returns the lastExceptionof the givenNettrace.static StringgetPresentationAddressForNettraceOn(String serverPA) Sets up and starts a Nettrace listing in to a server.static voidreleaseNettraceForAddress(String nettracePA) Shuts down a givenNettrace.static voidremoveObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA) Unregisters aNettraceObserverwith aNettrace.
-
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 benullif there was an error generating the presentation address. - Throws:
BadAddressException- IfserverPAis null or not a valid presentation address; of if their is an error generating the presentation address for theNettrace
-
releaseNettraceForAddress
Shuts down a givenNettrace.- Parameters:
nettracePA- The Presentation Address of theNettraceto shutdown. This should not benull. If their is no correspondingNettraceregistered at the Presentation Address then nothing will be done.
-
addObserverForNettrace
public static void addObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA) Registers aNettraceObserverwith aNettrace.- Parameters:
observer- TheNettraceObserverto register. This can benullin which case nothing will be done.nettracePA- The presentation address of theNettrace. This should not benull. If there is no correspondingNettraceat this address then nothing will be done.
-
removeObserverForNettrace
public static void removeObserverForNettrace(com.isode.nettrace.observers.NettraceObserver observer, String nettracePA) Unregisters aNettraceObserverwith aNettrace.- Parameters:
observer- TheNettraceObserverto unregister. This can benullin which case nothing will be done.nettracePA- The presentation address of theNettrace. This should not be null. If there is no correspondingNettraceat this address then nothing will be done.
-
getLastExceptionForNettrace
Returns the lastExceptionof the givenNettrace.- Parameters:
NettracePA- The presentation address of theNettrace. This should not be null. If there is no correspondingNettraceat this address then the function will returnnull- Returns:
- The last
Exceptionthrown by theNettrace, ornullif it has not thrown any exceptions, or no nettrace exists at the given presentation address.
-