cgl.imr.base
Interface PubSubService

All Known Implementing Classes:
NBPubSubService

public interface PubSubService

Captures the behaviors expected from a pub-sub service. Any implementation of this interface would be usable by i-MapRedcue framework.


Method Summary
 void close()
          Close the PubSubService connections.
 void send(String topic, byte[] message)
          Publish a byte[] message to a given topic.
 void send(String topic, String message)
          Publish a String message to a given topic.
 void setSubscriber(Subscribable callback)
          Sets the subscribable object for this PubSubService.
 void subscribe(String topic)
          Subscribe to a topic.
 void unsubscribe(String topic)
          Unsubscribe from a topic for which we have subscribed previously.
 

Method Detail

close

void close()
           throws PubSubException
Close the PubSubService connections.

Throws:
PubSubException

send

void send(String topic,
          byte[] message)
          throws PubSubException
Publish a byte[] message to a given topic.

Parameters:
topic - - Topic to send the message.
message - - Message to be sent as a byte[] array.
Throws:
PubSubException

send

void send(String topic,
          String message)
          throws PubSubException
Publish a String message to a given topic.

Parameters:
topic - - Topic to send the message.
message - - Message to be sent.
Throws:
PubSubException

setSubscriber

void setSubscriber(Subscribable callback)
                   throws PubSubException
Sets the subscribable object for this PubSubService. This supports one subscribable object per connection. The specific messages are filtered using the information in the message.

Parameters:
callback - - Subscribable object.
Throws:
PubSubException

subscribe

void subscribe(String topic)
               throws PubSubException
Subscribe to a topic.

Parameters:
topic - - Topic to be subscribed to.
Throws:
PubSubException

unsubscribe

void unsubscribe(String topic)
                 throws PubSubException
Unsubscribe from a topic for which we have subscribed previously.

Parameters:
topic - - Topic to to be unsubscribed.
Throws:
PubSubException


For comments and suggestions please send e-mail to