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(@Nullable com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> raw, Class<T> targetType, MongoConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable TgetBody()Get the potentially convertedChangeStreamDocument.getFullDocument().@Nullable TGet the potentially converteddocumentbefore being changed.@Nullable org.bson.BsonTimestampGet thecluster time.@Nullable StringGet the collection name the event was originated at.@Nullable StringGet the database name the event was originated at.@Nullable com.mongodb.client.model.changestream.OperationTypeGet theoperation typefor this event.@Nullable com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> getRaw()Get the rawChangeStreamDocumentas emitted by the driver.@Nullable org.bson.BsonValueGet theresume tokenfor this event.@Nullable InstantGet 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
public @Nullable com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> getRaw()Get the rawChangeStreamDocumentas emitted by the driver.- Returns:
- can be null.
-
getTimestamp
-
getBsonTimestamp
public @Nullable org.bson.BsonTimestamp getBsonTimestamp()Get thecluster time.- Returns:
- can be null.
- Since:
- 2.2
-
getResumeToken
public @Nullable org.bson.BsonValue getResumeToken()Get theresume tokenfor this event.- Returns:
- can be null.
-
getOperationType
public @Nullable com.mongodb.client.model.changestream.OperationType 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
-
getBodyBeforeChange
-
toString
-
equals
-
hashCode
-