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

 
Constructor Summary
SubscriptionTracker(SubscriptionContext subscriptionContext)

 
Method Summary
java.util.Collection getAllSubscriptions()

@return an ordered list of all subscription handles

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

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

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

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

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

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

boolean unsubscribe(Entity producer)

Unsubscribes the given 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


 
Constructor Detail

SubscriptionTracker

public SubscriptionTracker(SubscriptionContext subscriptionContext)


 
Method Detail

getAllSubscriptions

public java.util.Collection getAllSubscriptions()
Returns:
an ordered list of all subscription handles


subscribe

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


subscribeToChildren

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


subscribeToMembers

public SubscriptionHandle subscribeToMembers(Group parent, Sensor sensor, SensorEventListener listener)
See Also:
SubscriptionContext#subscribeToMembers(Entity, Sensor, SensorEventListener)#subscribeToMembers(Entity, Sensor, SensorEventListener)


unsubscribe

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


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.