org.fusesource.mqtt.client
Class BlockingConnection

java.lang.Object
  extended by org.fusesource.mqtt.client.BlockingConnection

public class BlockingConnection
extends java.lang.Object

A blocking Connection interface to MQTT.

Author:
Hiram Chirino

Constructor Summary
BlockingConnection(FutureConnection next)
           
 
Method Summary
protected  java.lang.Object clone()
           
 void connect()
           
 void disconnect()
           
 long getReceiveBuffer()
           
 boolean isConnected()
           
 void kill()
           
 void publish(java.lang.String topic, byte[] payload, QoS qos, boolean retain)
           
 void publish(org.fusesource.hawtbuf.UTF8Buffer topic, org.fusesource.hawtbuf.Buffer payload, QoS qos, boolean retain)
           
 Message receive()
           
 Message receive(long amount, java.util.concurrent.TimeUnit unit)
           
 void resume()
           
 void setReceiveBuffer(long receiveBuffer)
           
 byte[] subscribe(Topic[] topics)
           
 void suspend()
           
 void unsubscribe(java.lang.String[] topics)
           
 void unsubscribe(org.fusesource.hawtbuf.UTF8Buffer[] topics)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingConnection

public BlockingConnection(FutureConnection next)
Method Detail

isConnected

public boolean isConnected()

connect

public void connect()
             throws java.lang.Exception
Throws:
java.lang.Exception

disconnect

public void disconnect()
                throws java.lang.Exception
Throws:
java.lang.Exception

kill

public void kill()
          throws java.lang.Exception
Throws:
java.lang.Exception

subscribe

public byte[] subscribe(Topic[] topics)
                 throws java.lang.Exception
Throws:
java.lang.Exception

unsubscribe

public void unsubscribe(java.lang.String[] topics)
                 throws java.lang.Exception
Throws:
java.lang.Exception

unsubscribe

public void unsubscribe(org.fusesource.hawtbuf.UTF8Buffer[] topics)
                 throws java.lang.Exception
Throws:
java.lang.Exception

publish

public void publish(org.fusesource.hawtbuf.UTF8Buffer topic,
                    org.fusesource.hawtbuf.Buffer payload,
                    QoS qos,
                    boolean retain)
             throws java.lang.Exception
Throws:
java.lang.Exception

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

publish

public void publish(java.lang.String topic,
                    byte[] payload,
                    QoS qos,
                    boolean retain)
             throws java.lang.Exception
Throws:
java.lang.Exception

receive

public Message receive()
                throws java.lang.Exception
Throws:
java.lang.Exception

receive

public Message receive(long amount,
                       java.util.concurrent.TimeUnit unit)
                throws java.lang.Exception
Returns:
null if the receive times out.
Throws:
java.lang.Exception

setReceiveBuffer

public void setReceiveBuffer(long receiveBuffer)
                      throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

getReceiveBuffer

public long getReceiveBuffer()
                      throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

resume

public void resume()

suspend

public void suspend()


Copyright © 2010-2019 FuseSource, Corp.. All Rights Reserved.