com.streamhub.api
Interface PublishListener


public interface PublishListener

This interface is used to receive messages published by clients. Add your class as a PublishListener by using SubscriptionManager.addPublishListener(PublishListener). It is possible to get the SubscriptionManager using NIOServer.getSubscriptionManager().


Method Summary
 void onMessageReceived(Client client, String topic, Payload payload)
          This method will be called everytime a message is published by a client to the server.
 

Method Detail

onMessageReceived

void onMessageReceived(Client client,
                       String topic,
                       Payload payload)
This method will be called everytime a message is published by a client to the server.

Parameters:
client - The client who published the message
topic - The topic the message was published on
payload - The data that was published
See Also:
Client, Payload


Copyright © 2009 StreamHub. Tutorials, news and guides can be found on the StreamHub Comet Blog.