|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEsfMqttClient
Field Summary | |
---|---|
static java.lang.String |
SERVICE_NAME
Reports the class name representing this interface. |
Method Summary | |
---|---|
void |
connect()
Connects to the MQtt broker. |
void |
disconnect()
Disconnects from the MQtt broker. |
java.lang.String |
getClientId()
Returns the last unique ID given to the MQtt agent. |
java.lang.String |
getPassword()
Returns the client's password. |
EsfMqttSubscription[] |
getSubscriptions()
Returns an array of EsfMqttSubscriptions objects representing the current subscriptions of the client. |
java.lang.String |
getUsername()
Returns the client's username. |
boolean |
isConnected()
Returns an indication of whether the MQtt connection to the broker is established. |
int |
publish(java.lang.String topic,
byte[] payload,
int qos)
Publishes a message to the MQtt broker. |
void |
registerCallback(IEsfMqttCallback handler)
Register an IEsfMqttCallback with the IEsfMqttClient. |
void |
setBrokerAddress(java.lang.String address)
The TCP/IP address or domain name of the MQtt broker. |
void |
setBrokerPort(int port)
The TCP/IP port number of the MQtt broker. |
void |
setCleanStart(boolean cs)
The clean start flag for the MQtt client. |
void |
setClientId(java.lang.String id)
The MQtt user ID sent to the broker when a new connection is established. |
void |
setKeepAlive(short seconds)
Set the service MQtt ping interval. |
void |
setPassword(java.lang.String password)
Returns the client's password. |
void |
setUsername(java.lang.String username)
Sets the client's username. |
int |
subscribe(EsfMqttSubscription subscription)
Subscribes to a topic with the MQtt broker. |
int |
subscribe(EsfMqttSubscription[] subscriptions)
Subscribes to one or more topics with the MQtt broker. |
int |
subscribe(java.lang.String topic,
int qos)
Subscribes to a topic with the MQtt broker. |
int |
unsubscribe(EsfMqttSubscription subscription)
Unsubscribes from a topic with the MQtt broker. |
int |
unsubscribe(java.lang.String topic)
Unsubscribes from a topic with the MQtt broker. |
Field Detail |
---|
static final java.lang.String SERVICE_NAME
Method Detail |
---|
void setKeepAlive(short seconds)
seconds
- Ping interval, in units of seconds.int unsubscribe(EsfMqttSubscription subscription) throws EsfMqttException
subscription
- A EsfMqttSubscription object containing the topic.
EsfMqttException
int unsubscribe(java.lang.String topic) throws EsfMqttException
topic
- A String object containing the topic.
EsfMqttException
int subscribe(EsfMqttSubscription[] subscriptions) throws EsfMqttException
subscriptions
- An array of EsfMqttSubscription objects.
EsfMqttException
int subscribe(EsfMqttSubscription subscription) throws EsfMqttException
subscription
- An EsfMqttSubscription object.
EsfMqttException
int subscribe(java.lang.String topic, int qos) throws EsfMqttException
topic
- A String object containing the topic.qos
- An int containing the Quality of Service.
EsfMqttException
EsfMqttSubscription[] getSubscriptions()
void setUsername(java.lang.String username)
username
- A String object specifying the username.java.lang.String getUsername()
void setPassword(java.lang.String password)
password
- A String object specifying the password.java.lang.String getPassword()
void setClientId(java.lang.String id)
id
- A String representing the Client's ID.java.lang.String getClientId()
boolean isConnected()
void registerCallback(IEsfMqttCallback handler)
handler
- An implementation of the IEsfMqttCallback interface.void setBrokerAddress(java.lang.String address)
address
- A String representing the broker addressvoid setBrokerPort(int port)
port
- TCP/IP port number of broker.void setCleanStart(boolean cs)
cs
- The clean start flag.void connect() throws EsfMqttException
EsfMqttException
void disconnect() throws EsfMqttException
EsfMqttException
int publish(java.lang.String topic, byte[] payload, int qos) throws EsfMqttException
topic
- A String specifying the topic the message was published on.payload
- An array of bytes containing the payload of the message.qos
- An integer specifying the quality of service the message was published on.
EsfMqttException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |