Package oracle.nosql.driver.ops

## Class SystemRequest

- java.lang.Object
- - oracle.nosql.driver.ops.Request
  - - oracle.nosql.driver.ops.SystemRequest

-     public class SystemRequest
      extends Request

  On-premise only.

  SystemRequest is an on-premise-only request used to perform any table-independent administrative operation such as create/drop of namespaces and security-relevant operations (create/drop users and roles). These operations are asynchronous and completion needs to be checked.

  Examples of statements used in this object include:

  - CREATE NAMESPACE mynamespace
  - CREATE USER some_user IDENTIFIED BY password
  - CREATE ROLE some_role
  - GRANT ROLE some_role TO USER some_user

  Execution of operations specified by this request is implicitly asynchronous. These are potentially long-running operations. `NoSQLHandle.systemRequest(oracle.nosql.driver.ops.SystemRequest)` returns a `SystemResult` instance that can be used to poll until the operation succeeds or fails.

  The statements are passed as char[] because some statements will include passwords and using an array allows the memory to be cleared to avoid keeping sensitive information in memory.

  See Also:
    `NoSQLHandle.systemRequest(oracle.nosql.driver.ops.SystemRequest)`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SystemRequest()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `char[]` | `getStatement()` | Returns the statement, or null if not set
    `String` | `getTypeName()` | Returns the type name of the request.
    `SystemRequest` | `setDefaults​(NoSQLHandleConfig config)` |
    `SystemRequest` | `setStatement​(char[] statement)` | Sets the statement to use for the operation.
    `SystemRequest` | `setTimeout​(int timeoutMs)` | Sets the request timeout value, in milliseconds.
    `String` | `toString()` |
    `void` | `validate()` |

    - ### Methods inherited from class oracle.nosql.driver.ops.Request

      `getCompartment, getRateLimitDelayedMs, getReadRateLimiter, getRetryStats, getTableName, getWriteRateLimiter, setRateLimitDelayedMs, setReadRateLimiter, setWriteRateLimiter`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SystemRequest

          public SystemRequest()

  - ### Method Detail

    - #### getStatement

          public char[] getStatement()

      Returns the statement, or null if not set
      Returns:
        the statement

    - #### setStatement

          public SystemRequest setStatement​(char[] statement)

      Sets the statement to use for the operation. This parameter is required.
      Parameters:
        `statement` - the statement
      Returns:
        this

    - #### setTimeout

          public SystemRequest setTimeout​(int timeoutMs)

      Sets the request timeout value, in milliseconds. This overrides any default value set in `NoSQLHandleConfig`. The value must be positive.
      Parameters:
        `timeoutMs` - the timeout value, in milliseconds
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the timeout value is less than or equal to 0

    - #### setDefaults

          public SystemRequest setDefaults​(NoSQLHandleConfig config)

    - #### validate

          public void validate()

    - #### getTypeName

          public String getTypeName()

      Description copied from class: `Request`
      Returns the type name of the request. This is used for stats.
      Specified by:
        `getTypeName` in class `Request`
      Returns:
        the type name of the request

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`