Class ChangeStreamEvent<T>
java.lang.Object
org.springframework.data.mongodb.core.ChangeStreamEvent<T>
Message implementation specific to MongoDB Change
Streams.- Since:
- 2.1
- Author:
- Christoph Strobl, Mark Paluch, Myroslav Kosinskyi
-
Constructor Summary
ConstructorsConstructorDescriptionChangeStreamEvent(ChangeStreamDocument<Document> raw, Class<T> targetType, MongoConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBody()Get the potentially convertedChangeStreamDocument.getFullDocument().Get the potentially converteddocumentbefore being changed.Get thecluster time.Get the collection name the event was originated at.Get the database name the event was originated at.Get theoperation typefor this event.getRaw()Get the rawChangeStreamDocumentas emitted by the driver.Get theresume tokenfor this event.Get thecluster timeasInstantthe event was emitted at.inthashCode()toString()
-
Constructor Details
-
ChangeStreamEvent
public ChangeStreamEvent(@Nullable ChangeStreamDocument<Document> raw, Class<T> targetType, MongoConverter converter) - Parameters:
raw- can be null.targetType- must not be null.converter- must not be null.
-
-
Method Details
-
getRaw
Get the rawChangeStreamDocumentas emitted by the driver.- Returns:
- can be null.
-
getTimestamp
Get thecluster timeasInstantthe event was emitted at.- Returns:
- can be null.
-
getBsonTimestamp
Get thecluster time.- Returns:
- can be null.
- Since:
- 2.2
-
getResumeToken
Get theresume tokenfor this event.- Returns:
- can be null.
-
getOperationType
Get theoperation typefor this event.- Returns:
- can be null.
-
getDatabaseName
Get the database name the event was originated at.- Returns:
- can be null.
-
getCollectionName
Get the collection name the event was originated at.- Returns:
- can be null.
-
getBody
Get the potentially convertedChangeStreamDocument.getFullDocument().- Returns:
- null when
getRaw()orChangeStreamDocument.getFullDocument()is null.
-
getBodyBeforeChange
Get the potentially converteddocumentbefore being changed.- Returns:
- null when
getRaw()orChangeStreamDocument.getFullDocumentBeforeChange()is null. - Since:
- 4.0
-
toString
-
equals
-
hashCode
public int hashCode()
-