Java com.mongodb WriteConcern fields, constructors, methods, implement or subclass

Example usage for Java com.mongodb WriteConcern fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.mongodb WriteConcern.

The text is from its open source code.

Field

WriteConcernACKNOWLEDGED
Write operations that use this write concern will wait for acknowledgement, using the default write concern configured on the server.
WriteConcernW1
Write operations that use this write concern will wait for acknowledgement from a single member.
WriteConcernW2
Write operations that use this write concern will wait for acknowledgement from two members.
WriteConcernW3
Write operations that use this write concern will wait for acknowledgement from three members.
WriteConcernUNACKNOWLEDGED
Write operations that use this write concern will return as soon as the message is written to the socket.
WriteConcernFSYNCED
Write operations wait for the server to flush the data to disk.
WriteConcernJOURNALED
Write operations wait for the server to group commit to the journal file on disk.
WriteConcernREPLICA_ACKNOWLEDGED
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
WriteConcernNORMAL

Write operations that use this write concern will return as soon as the message is written to the socket.

WriteConcernSAFE

Write operations that use this write concern will wait for acknowledgement from the primary server before returning.

WriteConcernMAJORITY
Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation.
WriteConcernFSYNC_SAFE

Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush the data to disk.

This field has been superseded by WriteConcern.FSYNCED , and may be deprecated in a future release.

WriteConcernJOURNAL_SAFE

Exceptions are raised for network issues, and server errors; the write operation waits for the server to group commit to the journal file on disk.

WriteConcernREPLICAS_SAFE

Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.

This field has been superseded by WriteConcern.REPLICA_ACKNOWLEDGED , and may be deprecated in a future release.

Constructor

WriteConcern(final int w, final int wTimeoutMS, final boolean fsync, final boolean journal)
Constructs an instance with the given integer-based w value, wTimeout in milliseconds, fsync value, and journal value.
WriteConcern(final String w, final int wTimeoutMS, final boolean fsync, final boolean journal)
Constructs an instance with the given String-based w value, wTimeout in milliseconds, fsync value, and journal value.
WriteConcern(@Nullable final Object w, @Nullable final Integer wTimeoutMS, @Nullable final Boolean fsync, @Nullable final Boolean journal)
WriteConcern()
Constructs an instance with all properties initialized to their default values, except for w, which is initialized to 0, making instances constructed this ways equivalent to WriteConcern#UNACKNOWLEDGED
WriteConcern(final int w)
Construct an instance with the given integer-based value for w.
WriteConcern(final String w)
Construct an instance with the given tag set-based value for w.
WriteConcern(final boolean fsync)
Constructs an instance with the given value for fsync.
WriteConcern(final int w, final int wTimeoutMS)
Constructs an instance with the given integer-based value for w and the given value for wTimeoutMS.

Method

booleanequals(final Object o)
booleangetJ()
Gets the journal property.
intgetW()
Gets the w value as an integer.
ObjectgetWObject()
Gets the w value.
StringgetWString()
Gets the w parameter as a String.
intgetWtimeout()
Gets the wTimeout in milliseconds.
WriteConcernvalueOf(final String name)
Gets the WriteConcern constants by name (matching is done case insensitively).
WriteConcernwithJournal(final Boolean journal)
Constructs a new WriteConcern from the current one and the specified journal value
WriteConcernwithW(final int w)
Constructs a new WriteConcern from the current one and the specified integer-based value for w
WriteConcernwithW(final String w)
Constructs a new WriteConcern from the current one and the specified tag-set based value for w
WriteConcernwithWTimeout(final long wTimeout, final TimeUnit timeUnit)
Constructs a new WriteConcern from the current one and the specified wTimeout in the given time unit.