Brooklyn

brooklyn.management.internal
[Java] Class SubscriptionTracker

java.lang.Object
  brooklyn.management.internal.SubscriptionTracker

public class SubscriptionTracker

Tracks subscriptions associated that are registered with particular entities. Gives utilities for unsubscribing from all subscriptions on a given entity, etc.


Field Summary
protected SubscriptionContext context

@see SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)

 
Constructor Summary
SubscriptionTracker(SubscriptionContext subscriptionContext)

 
Method Summary
java.util.Collection getAllSubscriptions()

SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)

@see SubscriptionContext#subscribeToChildren(Entity, Sensor, SensorEventListener)

SubscriptionHandle subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)

SubscriptionHandle subscribeToMembers(Group parent, Sensor sensor, SensorEventListener listener)

boolean unsubscribe(Entity producer)

boolean unsubscribe(Entity producer, SubscriptionHandle handle)

Unsubscribes the given producer.

void unsubscribeAll()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

context

protected SubscriptionContext context
See Also:
SubscriptionContext#subscribe(Entity, Sensor, SensorEventListener)#subscribe(Entity, Sensor, SensorEventListener)


 
Constructor Detail

SubscriptionTracker

public SubscriptionTracker(SubscriptionContext subscriptionContext)


 
Method Detail

getAllSubscriptions

public java.util.Collection getAllSubscriptions()


subscribe

public SubscriptionHandle subscribe(Entity producer, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionContext#subscribeToChildren(Entity, Sensor, SensorEventListener)#subscribeToChildren(Entity, Sensor, SensorEventListener)


subscribeToChildren

public SubscriptionHandle subscribeToChildren(Entity parent, Sensor sensor, SensorEventListener listener)


subscribeToMembers

public SubscriptionHandle subscribeToMembers(Group parent, Sensor sensor, SensorEventListener listener)


unsubscribe

public boolean unsubscribe(Entity producer)


unsubscribe

public boolean unsubscribe(Entity producer, SubscriptionHandle handle)
Unsubscribes the given producer.
See Also:
SubscriptionContext#unsubscribe(SubscriptionHandle)#unsubscribe(SubscriptionHandle)


unsubscribeAll

public void unsubscribeAll()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.