public enum WriteConcernType extends Enum<WriteConcernType>
WriteConcern.| Enum Constant and Description |
|---|
ACKNOWLEDGED
Write operations that use this write concern will wait for acknowledgement from the primary server before
returning.
|
CUSTOM
A custom
WriteConcern implementation is specified. |
ERRORS_IGNORED
Deprecated.
This WriteConcern is no longer supported by MongoDB
|
FSYNCED
Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush
the data to disk.
|
JOURNALED
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.
|
MAJORITY
Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write
operation.
|
REPLICA_ACKNOWLEDGED
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write
operation.
|
UNACKNOWLEDGED
Write operations that use this write concern will return as soon as the message is written to the socket.
|
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.WriteConcern |
getWriteConcern()
Get the write concern
|
static WriteConcernType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WriteConcernType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Deprecated public static final WriteConcernType ERRORS_IGNORED
UNACKNOWLEDGED, then catch and ignore any exceptions of type MongoSocketException.public static final WriteConcernType ACKNOWLEDGED
public static final WriteConcernType UNACKNOWLEDGED
public static final WriteConcernType FSYNCED
public static final WriteConcernType JOURNALED
public static final WriteConcernType REPLICA_ACKNOWLEDGED
public static final WriteConcernType MAJORITY
public static final WriteConcernType CUSTOM
WriteConcern implementation is specified.public static WriteConcernType[] values()
for (WriteConcernType c : WriteConcernType.values()) System.out.println(c);
public static WriteConcernType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic com.mongodb.WriteConcern getWriteConcern()
WriteConcern associated with this enum value; null in the case of CUSTOM.Copyright © 2010-2015 Hibernate. All Rights Reserved.