com.mongodb
Enum DB.WriteConcern

java.lang.Object
  extended by java.lang.Enum<DB.WriteConcern>
      extended by com.mongodb.DB.WriteConcern
All Implemented Interfaces:
Serializable, Comparable<DB.WriteConcern>
Enclosing class:
DB

public static enum DB.WriteConcern
extends Enum<DB.WriteConcern>

Settings for strictness of error checking on writes (inserts, updates, and removes).


Enum Constant Summary
NONE
          Don't check for or report any errors on writes.
NORMAL
          Use the default level of error checking on writes.
STRICT
          Send a getLastError command following all writes.
 
Method Summary
static DB.WriteConcern valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DB.WriteConcern[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final DB.WriteConcern NONE
Don't check for or report any errors on writes.


NORMAL

public static final DB.WriteConcern NORMAL
Use the default level of error checking on writes. Don't send a getLastError command or wait for a response, but do raise an exception on socket errors.


STRICT

public static final DB.WriteConcern STRICT
Send a getLastError command following all writes. The write will wait for a response from the server and raise an exception on any error. Equivalent to the "safe mode" that is present in some other MongoDB drivers.

Method Detail

values

public static DB.WriteConcern[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DB.WriteConcern c : DB.WriteConcern.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DB.WriteConcern valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null