oracle.kv.table

## Class WriteOptions

- java.lang.Object
- - oracle.kv.table.WriteOptions

-     public class WriteOptions
      extends Object

  WriteOptions is passed to store operations that can update the store to specify non-default behavior relating to operation durability and timeouts.

  The default behavior is configured when a store is opened using `KVStoreConfig`.

  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriteOptions(Durability durability, long timeout, TimeUnit timeoutUnit)` Creates a `WriteOptions` with the specified parameters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Durability` | `getDurability()` Gets the durability associated with the operation.
    `long` | `getTimeout()` Gets the timeout, which is an upper bound on the time interval for processing the operation.
    `TimeUnit` | `getTimeoutUnit()` Gets the unit of the timeout parameter, and may be null only if `getTimeout()` returns zero.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WriteOptions

          public WriteOptions(Durability durability,
                      long timeout,
                      TimeUnit timeoutUnit)

      Creates a `WriteOptions` with the specified parameters.

      If `durability` is `null`, the `default durability` is used.

      The `timeout` parameter is an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, the `default request timeout` is used.

      If `timeout` is not 0, the `timeoutUnit` parameter must not be `null`.

      Parameters:
        `durability` - the write durability to use
        `timeout` - the timeout value to use
        `timeoutUnit` - the `TimeUnit` used by the `timeout` parameter
      Throws:
        `IllegalArgumentException` - if timeout is negative
        `IllegalArgumentException` - if timeout is > 0 and timeoutUnit is null

  - ### Method Detail

    - #### getDurability

          public Durability getDurability()

      Gets the durability associated with the operation. If null, the `default durability` is used.
      Returns:
        the durability or null

    - #### getTimeout

          public long getTimeout()

      Gets the timeout, which is an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, the `default request timeout` is used.
      Returns:
        the timeout or zero

    - #### getTimeoutUnit

          public TimeUnit getTimeoutUnit()

      Gets the unit of the timeout parameter, and may be null only if `getTimeout()` returns zero.
      Returns:
        the `TimeUnit` or null

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.