Package com.adobe.aio.event.journal
Class JournalServiceTester
- java.lang.Object
-
- com.adobe.aio.event.journal.JournalServiceTester
-
public class JournalServiceTester extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static BiPredicate<Event,String>isEventIdInTheCloudEventDatastatic BiPredicate<Event,String>isEventIdTheCloudEventIdprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description JournalServiceTester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JournalEntrygetLatestEntry(String journalUrl)booleanpollJournalForEvent(String journalUrl, JournalEntry fromEntry, String eventId, BiPredicate<Event,String> isEventIdInEvent)booleanpollJournalForEvent(String journalUrl, String eventId, BiPredicate<Event,String> isEventIdInEvent)booleanpollJournalForEvents(String journalUrl, Set<String> eventIds, BiPredicate<Event,String> isEventIdInEvent)Polls the journal for the given eventIds.booleanpollJournalForEvents(String journalUrl, Set<String> eventIds, BiPredicate<Event,String> isEventIdInEvent, long timeoutInMilliseconds)Polls the journal for the given eventIds.
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
isEventIdInTheCloudEventData
public static final BiPredicate<Event,String> isEventIdInTheCloudEventData
-
isEventIdTheCloudEventId
public static final BiPredicate<Event,String> isEventIdTheCloudEventId
-
-
Method Detail
-
getLatestEntry
public JournalEntry getLatestEntry(String journalUrl)
- Parameters:
journalUrl-- Returns:
- the latest journal entry, we do retry the journaling API, up to pollingTimeOutInMs, if it fails (due to temporary failure, or cache propagation latencies).
-
pollJournalForEvent
public boolean pollJournalForEvent(String journalUrl, String eventId, BiPredicate<Event,String> isEventIdInEvent) throws InterruptedException
- Throws:
InterruptedException
-
pollJournalForEvent
public boolean pollJournalForEvent(String journalUrl, JournalEntry fromEntry, String eventId, BiPredicate<Event,String> isEventIdInEvent) throws InterruptedException
- Throws:
InterruptedException
-
pollJournalForEvents
public boolean pollJournalForEvents(String journalUrl, Set<String> eventIds, BiPredicate<Event,String> isEventIdInEvent)
Polls the journal for the given eventIds. The journal is polled until all eventIds are found. The timeout is set to 2 minutes.- Parameters:
journalUrl- The journal urleventIds- The eventIds to find (the set is not modified)isEventIdInEvent- The predicate to use to find the eventIds in the journal- Returns:
- true if all eventIds are found, false otherwise (if timeout is reached).
-
pollJournalForEvents
public boolean pollJournalForEvents(String journalUrl, Set<String> eventIds, BiPredicate<Event,String> isEventIdInEvent, long timeoutInMilliseconds)
Polls the journal for the given eventIds. The journal is polled until all eventIds are found.- Parameters:
journalUrl- The journal urleventIds- The eventIds to find (the set is not modified)isEventIdInEvent- The predicate to use to find the eventIds in the journaltimeoutInMilliseconds- The timeout in milliseconds- Returns:
- true if all eventIds are found, false otherwise (if timeout is reached).
-
-