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(com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> raw, Class<T> targetType, MongoConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBody()Get the potentially convertedChangeStreamDocument.getFullDocument().Get the potentially converteddocumentbefore being changed.org.bson.BsonTimestampGet thecluster time.Get the collection name the event was originated at.Get the database name the event was originated at.com.mongodb.client.model.changestream.OperationTypeGet theoperation typefor this event.com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>getRaw()Get the rawChangeStreamDocumentas emitted by the driver.org.bson.BsonValueGet theresume tokenfor this event.Get thecluster timeasInstantthe event was emitted at.inthashCode()toString()
-
Constructor Details
-
ChangeStreamEvent
public ChangeStreamEvent(@Nullable com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.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
@Nullable public com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> 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()
-