public class LightblueDocumentEventRepository extends Object implements DocumentEventRepository
DocumentEventEntity, which must be configured as an entity in lightblue.| Constructor and Description |
|---|
LightblueDocumentEventRepository(com.redhat.lightblue.client.LightblueClient lightblue,
LockStrategy lockStrategy,
LightblueDocumentEventRepositoryConfig config,
Map<String,? extends DocumentEventFactory> documentEventFactoriesByType,
java.time.Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNewDocumentEvents(Collection<? extends DocumentEvent> documentEvents) |
void |
ensureTransactionActive(DocumentEvent event) |
void |
markDocumentEventsPublishedOrFailed(Collection<? extends DocumentEvent> documentEvents,
Collection<FailedDocumentEvent> failures) |
List<LightblueDocumentEvent> |
retrievePriorityDocumentEventsUpTo(int maxEvents) |
public LightblueDocumentEventRepository(com.redhat.lightblue.client.LightblueClient lightblue,
LockStrategy lockStrategy,
LightblueDocumentEventRepositoryConfig config,
Map<String,? extends DocumentEventFactory> documentEventFactoriesByType,
java.time.Clock clock)
public void addNewDocumentEvents(Collection<? extends DocumentEvent> documentEvents) throws com.redhat.lightblue.client.LightblueException
addNewDocumentEvents in interface DocumentEventRepositorycom.redhat.lightblue.client.LightblueExceptionpublic List<LightblueDocumentEvent> retrievePriorityDocumentEventsUpTo(int maxEvents) throws Exception
retrievePriorityDocumentEventsUpTo in interface DocumentEventRepositoryExceptionpublic void ensureTransactionActive(DocumentEvent event) throws Exception
N.B. This implementation currently works by simply checking if the known in memory timeouts of provided event falls within some threshold. It could be updated to also timestamp the persisted event again, but to be safe we would probably want to also lock them to do this update. For now, that complexity is probably not worth it.
ensureTransactionActive in interface DocumentEventRepositoryExceptionpublic void markDocumentEventsPublishedOrFailed(Collection<? extends DocumentEvent> documentEvents, Collection<FailedDocumentEvent> failures) throws com.redhat.lightblue.client.LightblueException
markDocumentEventsPublishedOrFailed in interface DocumentEventRepositorycom.redhat.lightblue.client.LightblueExceptionCopyright © 2017. All rights reserved.