com.holonplatform.datastore.mongo.core.enumerations

## Enum MongoWriteConcern

- java.lang.Object
- - java.lang.Enum<MongoWriteConcern>
  - - com.holonplatform.datastore.mongo.core.enumerations.MongoWriteConcern

- All Implemented Interfaces:
    Serializable, Comparable<MongoWriteConcern>

      public enum MongoWriteConcern
      extends Enum<MongoWriteConcern>

  MongoDB `WriteConcern` enumeration.
  Since:
    5.2.0

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ACKNOWLEDGED` Write operations that use this write concern will wait for acknowledgement, using the default write concern configured on the server.
    `DEFAULT` Default write concern.
    `JOURNALED` Write operations wait 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.
    `UNACKNOWLEDGED` Write operations that use this write concern will return as soon as the message is written to the socket.
    `W1` Write operations that use this write concern will wait for acknowledgement from a single member.
    `W2` Write operations that use this write concern will wait for acknowledgement from two members.
    `W3` Write operations that use this write concern will wait for acknowledgement from three members.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<com.mongodb.WriteConcern>` | `getWriteConcern()` Get the actual `WriteConcern` implementation, if available.
    `static MongoWriteConcern` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static MongoWriteConcern[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### DEFAULT

          public static final MongoWriteConcern DEFAULT

      Default write concern.

    - #### UNACKNOWLEDGED

          public static final MongoWriteConcern UNACKNOWLEDGED

      Write operations that use this write concern will return as soon as the message is written to the socket. Exceptions are raised for network issues, but not server errors.

    - #### ACKNOWLEDGED

          public static final MongoWriteConcern ACKNOWLEDGED

      Write operations that use this write concern will wait for acknowledgement, using the default write concern configured on the server.

    - #### W1

          public static final MongoWriteConcern W1

      Write operations that use this write concern will wait for acknowledgement from a single member.

    - #### W2

          public static final MongoWriteConcern W2

      Write operations that use this write concern will wait for acknowledgement from two members.

    - #### W3

          public static final MongoWriteConcern W3

      Write operations that use this write concern will wait for acknowledgement from three members.

    - #### JOURNALED

          public static final MongoWriteConcern JOURNALED

      Write operations wait for the server to group commit to the journal file on disk.

    - #### MAJORITY

          public static final MongoWriteConcern MAJORITY

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

  - ### Method Detail

    - #### values

          public static MongoWriteConcern[] 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 (MongoWriteConcern c : MongoWriteConcern.values())
              System.out.println(c);

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

    - #### valueOf

          public static MongoWriteConcern 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

    - #### getWriteConcern

          public Optional<com.mongodb.WriteConcern> getWriteConcern()

      Get the actual `WriteConcern` implementation, if available.
      Returns:
        the write concern implementation, or an empty Optional if `DEFAULT`

Copyright © 2019 The Holon Platform. All rights reserved.