Defining a Callback Object
You use the BrokerConnectionCallbackinterface to derive your own callback object. Your implementation must provide an implementation of the handleConnectionChange callback method. You can implement this method to recreate any needed client state that have been lost or to provide other methods, such as logging of error messages.