public void onFailure(Throwable value) { // Socket failure, should we try to reconnect? if( !disconnected && tryReconnect() ) { reconnect(this); } else { // nope. cb.onFailure(value); } } }
@Override public void run() { listener.onDisconnected(); reconnect(); } });
public void connectMqtt(String clientId) throws Exception { MQTT client = MqttUtils.configureClient(this.options, clientId, this.keyStoreLoader); this.connection = client.blockingConnection(); this.connection.connect(); } }
public void disconnect() throws Exception { this.next.disconnect().await(); }
public void unsubscribe(final String[] topics) throws Exception { this.next.unsubscribe(topics).await(); }
public FutureConnection futureConnection() { return new FutureConnection(callbackConnection()); } public BlockingConnection blockingConnection() {
public BlockingConnection blockingConnection() { return new BlockingConnection(futureConnection()); }
public void close() { this.connection.disconnect(new DisconnectCallback()); }
@Override public void run() { listener.onDisconnected(); if (onComplete != null) { onComplete.onSuccess(null); } } });
@Override public void run() { if(disconnected) { onConnect.onFailure(createDisconnectedError()); } else { try { createTransport(onConnect); } catch (Exception e) { onConnect.onFailure(e); } } } });
public void onSuccess(T value) { if( next!=null ) { next.onSuccess(value); } }
public void unsubscribe(final UTF8Buffer[] topics) throws Exception { this.next.unsubscribe(topics).await(); }
public void onSuccess(Callback<Void> value) { if (value != null) { value.onSuccess(null); } }