net.sf.xenqtt.mockbroker
Class BrokerEvent

java.lang.Object
  extended by net.sf.xenqtt.mockbroker.BrokerEvent

public final class BrokerEvent
extends Object

An event that hqppened on the broker (message sent, message received, etc)


Method Summary
 Client getClient()
           
 String getClientId()
           
 BrokerEventType getEventType()
           
<T extends MqttMessage>
T
getMessage()
           
 void send(MqttMessage message)
          Sends the message to the client associated with this event
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getClient

public Client getClient()
Returns:
The client associated with this event

getClientId

public String getClientId()
Returns:
The client ID of the client associated with this event. Null if no ConnectMessage has been received.

send

public void send(MqttMessage message)
Sends the message to the client associated with this event


getEventType

public BrokerEventType getEventType()
Returns:
The type of event that occurred

getMessage

public <T extends MqttMessage> T getMessage()
Returns:
The message that triggered the event. Only applicable for BrokerEventType.MESSAGE_RECEIVED and BrokerEventType.MESSAGE_SENT

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.