cgl.narada.service.client
Interface EventConsumer

All Known Implementing Classes:
EventConsumerImpl

public interface EventConsumer

The event consumer provides a host of functions for clients to consume events. These include subscription to profiles and also the specification of QoS constraints that an event must satisfy prior to delivery. The consumer also includes several utlity functions among them are the ability to retrieve the number of events received at this consumer.


Method Summary
 boolean canSatisfyQosRequirements(Profile profile)
          Verify if the specify QosConstraints can indeed be satisfied.
 ConsumerConstraints createConsumerConstraints(Profile profile)
          Create consumer constraints associated with a certain profile
 ConsumerConstraints getConsumerConstraints(Profile profile)
          Retrieves the ConsumerConstraints for a given profile
 int getEntityId()
          Retrieve the entity identifier
 Profile[] getListOfManagedProfiles()
          Gets a list of profiles managed by the consumer
 NBEventListener getNBEventListener()
          Gets the event listener for the profiles managed by this consumer
 int getNumberOfEventsReceivedSoFar()
          Retrieves the number of events routed by this event consumer
 long getTimeElapsedSinceLastEvent()
          Retrieves the time elapsed (in milliseconds) since the last event was received on this consumer
 boolean hasConsumerConstraints(Profile profile)
          Checks to see if a consumer constraint has been registered for a given profile
 void initiateReplay(ReplayRequest replayRequest, ReplayServiceListener replayListener)
          Initiate replay based on the created replay request
 long recover(int templateId, NBRecoveryListener recoveryListener)
          This is called by an entity to recover from failures or prolonged disconnects
 void setNBEventListener(NBEventListener nbEventListener)
          Sets the event listener for the profiles managed by this consumer
 void setNBNotificationListener(NBNotificationListener nbNotificationListener)
          Sets the notification listener for the profiles (and the specified Qos constraints) managed by this consumer
 void subscribeTo(Profile profile)
          Subscribe to a profile and register a listener to receive events conforming to the specified constraint
 void subscribeTo(Profile profile, ConsumerConstraints consumerConstraints)
          Subscribe to a profile, but request that the event satisfies some QoS constraints prior to delivery.
 void unSubscribe(Profile profile)
          Unsubscribes a profile.
 

Method Detail

getEntityId

int getEntityId()
Retrieve the entity identifier


getNumberOfEventsReceivedSoFar

int getNumberOfEventsReceivedSoFar()
Retrieves the number of events routed by this event consumer


getTimeElapsedSinceLastEvent

long getTimeElapsedSinceLastEvent()
Retrieves the time elapsed (in milliseconds) since the last event was received on this consumer


hasConsumerConstraints

boolean hasConsumerConstraints(Profile profile)
                               throws ServiceException
Checks to see if a consumer constraint has been registered for a given profile

Throws:
ServiceException

canSatisfyQosRequirements

boolean canSatisfyQosRequirements(Profile profile)
                                  throws ServiceException
Verify if the specify QosConstraints can indeed be satisfied. This method will true if there aare no specified Qos associated with the profile.

Throws:
ServiceException

getConsumerConstraints

ConsumerConstraints getConsumerConstraints(Profile profile)
                                           throws ServiceException
Retrieves the ConsumerConstraints for a given profile

Throws:
ServiceException

createConsumerConstraints

ConsumerConstraints createConsumerConstraints(Profile profile)
                                              throws ServiceException
Create consumer constraints associated with a certain profile

Throws:
ServiceException

getListOfManagedProfiles

Profile[] getListOfManagedProfiles()
Gets a list of profiles managed by the consumer


setNBEventListener

void setNBEventListener(NBEventListener nbEventListener)
                        throws ServiceException
Sets the event listener for the profiles managed by this consumer

Throws:
ServiceException

getNBEventListener

NBEventListener getNBEventListener()
Gets the event listener for the profiles managed by this consumer


setNBNotificationListener

void setNBNotificationListener(NBNotificationListener nbNotificationListener)
                               throws ServiceException
Sets the notification listener for the profiles (and the specified Qos constraints) managed by this consumer

Throws:
ServiceException

subscribeTo

void subscribeTo(Profile profile)
                 throws ServiceException
Subscribe to a profile and register a listener to receive events conforming to the specified constraint

Throws:
ServiceException

unSubscribe

void unSubscribe(Profile profile)
                 throws ServiceException
Unsubscribes a profile. If there is a registered QosEnablerAndSpecifier for this profile, it is also disabled.

Throws:
ServiceException

subscribeTo

void subscribeTo(Profile profile,
                 ConsumerConstraints consumerConstraints)
                 throws ServiceException
Subscribe to a profile, but request that the event satisfies some QoS constraints prior to delivery. This subscription may trigger a discovery request and based upon the responses or lack thereof the subscription propagation may succeed or not. This method requires that a NotificationListener be registered prior to activating the profile.

Throws:
ServiceException

recover

long recover(int templateId,
             NBRecoveryListener recoveryListener)
             throws ServiceException
This is called by an entity to recover from failures or prolonged disconnects

Throws:
ServiceException

initiateReplay

void initiateReplay(ReplayRequest replayRequest,
                    ReplayServiceListener replayListener)
                    throws ServiceException
Initiate replay based on the created replay request

Throws:
ServiceException


For comments and suggestions please send e-mail to The NaradaBrokering Project
For comments and suggestions please send e-mail to The NaradaBrokering Project
HTML>