public class LocalSubscriptionManager extends AbstractSubscriptionManager
SubscriptionManager
that stores subscription details locally.AbstractSubscriptionManager.EntitySensorToken
Constructor and Description |
---|
LocalSubscriptionManager(ExecutionManager m) |
Modifier and Type | Method and Description |
---|---|
long |
getNumSubscriptions() |
java.util.Set<SubscriptionHandle> |
getSubscriptionsForEntitySensor(Entity source,
Sensor<?> sensor)
Return the subscriptions on a given source-sensor pair
|
java.util.Set<SubscriptionHandle> |
getSubscriptionsForSubscriber(java.lang.Object subscriber)
Return the subscriptions requested by a given subscriber
|
long |
getTotalEventsDelivered() |
long |
getTotalEventsPublished() |
<T> void |
publish(SensorEvent<T> event)
performs the actual publishing -- ie distribution to subscriptions
|
java.lang.String |
toString() |
boolean |
unsubscribe(SubscriptionHandle sh)
Unsubscribe the given subscription id.
|
subscribe, subscribe, subscribeToChildren, subscribeToChildren, subscribeToMembers, subscribeToMembers
public LocalSubscriptionManager(ExecutionManager m)
public long getNumSubscriptions()
public long getTotalEventsPublished()
public long getTotalEventsDelivered()
public java.util.Set<SubscriptionHandle> getSubscriptionsForSubscriber(java.lang.Object subscriber)
SubscriptionManager
public java.util.Set<SubscriptionHandle> getSubscriptionsForEntitySensor(Entity source, Sensor<?> sensor)
SubscriptionManager
public boolean unsubscribe(SubscriptionHandle sh)
AbstractSubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
public <T> void publish(SensorEvent<T> event)
AbstractSubscriptionManager
publish
in interface SubscriptionManager
publish
in class AbstractSubscriptionManager
public java.lang.String toString()
toString
in class java.lang.Object