Class SubscriptionMatcher
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.events.SubscriptionMatcher
-
public class SubscriptionMatcher extends java.lang.Object
Matcher is responsible for holding all subscriptions and match them to incoming events. Matching process is based on subscription id which is represented by 4 subscription types: <receiver>.<component>.<operation_id>.<unique_id> <receiver> - Uniquely identifies host from which event arrived <component> - Logical component like: Storage, Virt etc <operation_id> - Operation identifier like Image.create <unique_id> - Identifier of a specific operation User can subscribe to all events by defining '*' for each subscription type. Registration for all possible events like '*|*|*|*' is not allowed. User can register for specific component operation using '*|storage|*|*' which means that all events triggered by storage component are delivered to a subscriber.
-
-
Constructor Summary
Constructors Constructor Description SubscriptionMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SubscriptionHolder holder)
Adds aSubscriptionHolder
which will be used for event matchingjava.util.List<SubscriptionHolder>
getAllSubscriptions()
java.util.Set<SubscriptionHolder>
match(JsonRpcEvent event)
Matches current subscriptions to an event and returns aSet
containing all subscriptions that match for this event processing.void
remove(SubscriptionHolder holder)
Used during removal of a subscription.
-
-
-
Method Detail
-
add
public void add(SubscriptionHolder holder)
Adds aSubscriptionHolder
which will be used for event matching- Parameters:
holder
- Instance holding subscription information.
-
match
public java.util.Set<SubscriptionHolder> match(JsonRpcEvent event)
Matches current subscriptions to an event and returns aSet
containing all subscriptions that match for this event processing.- Parameters:
event
- Incoming event used to match subscribers.- Returns:
- A
Set
with matched subscriptions.
-
remove
public void remove(SubscriptionHolder holder)
Used during removal of a subscription.- Parameters:
holder
- Object holding information about subscription being removed.
-
getAllSubscriptions
public java.util.List<SubscriptionHolder> getAllSubscriptions()
-
-