public void disconnect(){
  connected=false;
synchronized (connLostWait) {
    connLostWait.notify();
  }
  if (mqtt != null) {
    try {
      mqtt.disconnect();
    }
 catch (    Exception ex) {
      setTitleText("MQTT disconnect error !");
      ex.printStackTrace();
      System.exit(1);
    }
  }
  if (led.isFlashing()) {
    led.setFlash();
  }
  led.setRed();
  setConnected(false);
synchronized (this) {
    writeLogln("WebSphere MQ Telemetry transport disconnected");
  }
}

public void disconnect ( ) { connected = false ; synchronized ( connLostWait ) { connLostWait . notify ( ) ; } if ( mqtt != null ) { try { mqtt . disconnect ( ) ; } catch ( Exception ex ) { setTitleText ( "MQTT disconnect error !" ) ; ex . printStackTrace ( ) ; System . exit ( 1 ) ; } } if ( led . isFlashing ( ) ) { led . setFlash ( ) ; } led . setRed ( ) ; setConnected ( false ) ; synchronized ( this ) { writeLogln ( "WebSphere MQ Telemetry transport disconnected" ) ; } }
a wrapper for the mqtt disconnect method . as well as disconnecting the protocol this method enables / disables buttons as appropriate when in disconnected state . it also sets the correct colour of the indicator led .
