public class SubscriptionHolder extends Object
EventSubscriber
. When events are not
processed immediately they are queued in here. This holder contains instance of subscription itself.Constructor and Description |
---|
SubscriptionHolder(EventSubscriber subscriber,
AtomicInteger count)
Creates a holder which subscriber instance and count and it prepares subscription id representation for event
matching.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canProcess() |
JsonRpcEvent |
canProcessMore() |
void |
clean()
Clean event queue.
|
List<String> |
getFilteredId() |
String |
getId() |
int |
getNumberOfEvents() |
String[] |
getParsedId() |
EventSubscriber |
getSubscriber() |
void |
purgeOldEventsIfNotConsumed(int eventTimeoutInHours)
Purge old events if they have not been consumed in a specified amount of time.
|
void |
putEvent(JsonRpcEvent event)
Queues not processed event for later processing.
|
public SubscriptionHolder(EventSubscriber subscriber, AtomicInteger count)
subscriber
- Instance of @link EventSubscriber
.count
- Represent current number of events requested by subscriber.public String getId()
public String[] getParsedId()
public List<String> getFilteredId()
public boolean canProcess()
public JsonRpcEvent canProcessMore()
public void putEvent(JsonRpcEvent event)
event
- An event to be queued.public int getNumberOfEvents()
public void purgeOldEventsIfNotConsumed(int eventTimeoutInHours)
eventTimeoutInHours
- the timeout after which the events are purged from the queue.public EventSubscriber getSubscriber()
public void clean()
Copyright © 2019. All Rights Reserved.