Enum Class MongoDriverSettings.FlushMode

java.lang.Object
java.lang.Enum<MongoDriverSettings.FlushMode>
io.vena.bosk.drivers.mongo.MongoDriverSettings.FlushMode
All Implemented Interfaces:
Serializable, Comparable<MongoDriverSettings.FlushMode>, Constable
Enclosing class:
MongoDriverSettings

public static enum MongoDriverSettings.FlushMode extends Enum<MongoDriverSettings.FlushMode>
  • Enum Constant Details

    • ECHO

      public static final MongoDriverSettings.FlushMode ECHO
      The canonical implementation of BoskDriver.flush(): performs a dummy write to the database, and waits for the corresponding event to arrive in the MongoDB change stream, thereby ensuring that all prior events have already been processed.

      Since this mode performs a write, it needs write permissions to the database, and causes change stream activity even when the bosk state is not changing.

    • REVISION_FIELD_ONLY

      public static final MongoDriverSettings.FlushMode REVISION_FIELD_ONLY
      Experimental

      Reads the revision field in the database; if we have not yet processed that revision, wait until we have.

      This implementation is more complex and subtle than ECHO, but doesn't perform any writes. When the bosk is not changing, this doesn't need to wait for any change stream events, and runs as quickly as a single database read.

  • Method Details

    • values

      public static MongoDriverSettings.FlushMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MongoDriverSettings.FlushMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null