public class EventPoller
extends org.apache.sling.testing.clients.util.poller.Polling
Constructor and Description |
---|
EventPoller(org.apache.sling.testing.clients.SlingClient client,
String topic,
String path,
long since)
Instantiate a new EventPoller
|
Modifier and Type | Method and Description |
---|---|
Boolean |
call() |
static boolean |
checkEventOccurrence(org.apache.sling.testing.clients.SlingClient client,
String topic,
String path,
long since)
Asynchronously checks for the occurrence of a given event in the OSGi
event log.
|
static boolean |
containsEvent(org.codehaus.jackson.JsonNode events,
String topic,
String path)
Checks if a given array of events contains an event with a given topic at a given path
|
static org.codehaus.jackson.JsonNode |
getEventsSince(org.apache.sling.testing.clients.SlingClient client,
long timestamp)
Returns all OSGi event since a given time.
|
static long |
getLatestEventTimestamp(org.apache.sling.testing.clients.SlingClient client)
Returns a timestamp of the latest recorded OSGi event.
|
public EventPoller(org.apache.sling.testing.clients.SlingClient client, String topic, String path, long since)
client
- required to read from the event logtopic
- the topic that should be looked forpath
- the path the event should occursince
- the time from which on events are consideredpublic Boolean call() throws org.apache.sling.testing.clients.ClientException
public static long getLatestEventTimestamp(org.apache.sling.testing.clients.SlingClient client) throws org.apache.sling.testing.clients.ClientException
client
- required to read from the event logorg.apache.sling.testing.clients.ClientException
- if request to OSGi event log could not be madepublic static org.codehaus.jackson.JsonNode getEventsSince(org.apache.sling.testing.clients.SlingClient client, long timestamp) throws org.apache.sling.testing.clients.ClientException
client
- required to read from the event logtimestamp
- the time from which on events are consideredorg.apache.sling.testing.clients.ClientException
- if request to OSGi event log could not be madepublic static boolean containsEvent(org.codehaus.jackson.JsonNode events, String topic, String path)
events
- array of events that should be searchedtopic
- the topic that should be looked forpath
- the path the event should occurpublic static boolean checkEventOccurrence(org.apache.sling.testing.clients.SlingClient client, String topic, String path, long since) throws InterruptedException
client
- required to read from the event logtopic
- the topic that should be looked forpath
- the path the event should occursince
- the time from which on events are consideredInterruptedException
- to mark this method as waitingCopyright © 2018. All rights reserved.