Class NosqlDbConfig

java.lang.Object
com.oracle.nosql.spring.data.config.NosqlDbConfig

public class NosqlDbConfig extends Object
  • Constructor Details

  • Method Details

    • createCloudConfig

      public static NosqlDbConfig createCloudConfig(String endpoint, String configFile) throws IOException
      Creates a NosqlDbConfig object based on endpoint and config file path. Note: Will use the DEFAULT profile from config file. Note: For use with NoSQL DB Cloud Service only.
      Parameters:
      endpoint - Endpoint of service. Example: Region.endpoint()
      configFile - Path to config file. Example: "~/.oci/config"
      Returns:
      returns the NosqlDbConfig object.
      Throws:
      IOException - if config file cannot be accessed.
    • createCloudConfig

      public static NosqlDbConfig createCloudConfig(String endpoint, String configFile, String profileName) throws IOException
      Creates a NosqlDbConfig object based on endpoint, config file path and profile name. Note: For use with NoSQL DB Cloud Service only.
      Parameters:
      endpoint - Endpoint of service. Example: Region.endpoint()
      configFile - Path to config file. Example: "~/.oci/config"
      profileName - The name of the profile defined in config file. Example: "DEFAULT".
      Returns:
      returns the NosqlDbConfig object.
      Throws:
      IOException - if config file cannot be accessed.
    • createCloudSimConfig

      public static NosqlDbConfig createCloudSimConfig(String endpoint)
      Creates a NosqlDbConfig object for a CloudSim server.
      Parameters:
      endpoint - Endpoint of service. Example: "http://localhost:8080"
      Returns:
      returns the NosqlDbConfig object.
    • createProxyConfig

      public static NosqlDbConfig createProxyConfig(String endpoint)
      Creates a NosqlDbConfig object for an on-prem server using an httproxy server.
      Parameters:
      endpoint - Endpoint of service. Example: "http://localhost:8080"
      Returns:
      returns the NosqlDbConfig object.
    • createProxyConfig

      public static NosqlDbConfig createProxyConfig(String endpoint, String username, char[] password)
      Creates a NosqlDbConfig object for an on-prem server using a secured httproxy server.
      Parameters:
      endpoint - Endpoint of service. Example: "https://localhost:8080"
      username - User name
      password - User password
      Returns:
      returns the NosqlDbConfig object.
    • getNosqlHandleConfig

      public NoSQLHandleConfig getNosqlHandleConfig()
    • getQueryCacheCapacity

      public int getQueryCacheCapacity()
      Returns the capacity of the prepared query cache. By default this is set to Constants.DEFAULT_QUERY_CACHE_CAPACITY.
    • getQueryCacheLifetime

      public int getQueryCacheLifetime()
      Returns the lifetime of the prepared query cache in milliseconds. By default this is set to Constants.DEFAULT_QUERY_CACHE_LIFETIME_MS.
    • getTableReqTimeout

      public int getTableReqTimeout()
      Returns the table request timeout in milliseconds. By default this is set to Constants.DEFAULT_TABLE_REQ_TIMEOUT_MS
    • setTableReqTimeout

      public NosqlDbConfig setTableReqTimeout(int tableReqTimeout)
      Sets the table request timeout in milliseconds. By default this is set to Constants.DEFAULT_TABLE_REQ_TIMEOUT_MS
    • getTableReqPollInterval

      public int getTableReqPollInterval()
      Returns the table request poll interval in milliseconds. By default this is set to Constants.DEFAULT_TABLE_RED_POLL_INTERVAL_MS
    • setTableReqPollInterval

      public NosqlDbConfig setTableReqPollInterval(int pollInterval)
      Sets the table request poll interval in milliseconds. By default this is set to Constants.DEFAULT_TABLE_RED_POLL_INTERVAL_MS
    • getTimestampPrecision

      public int getTimestampPrecision()
      Returns the precision of the Timestamp NoSQL DB type when creating a new table. By default this is set to Constants.DEFAULT_TIMESTAMP_PRECISION.

      Timestamp values have a precision (0 - 9) which represents the fractional seconds to be held by the timestamp. A value of 0 means that no fractional seconds are stored, 3 means that the timestamp stores milliseconds, and 9 means a precision of nanoseconds.

      In the context of a CREATE TABLE statement, a precision must be explicitly specified. This restriction is to prevent users from inadvertently creating TIMESTAMP values with precision 9 (which takes more space) when in reality they don't need that high precision.

      See Timestamp documentation for more details.

    • setTimestampPrecision

      public NosqlDbConfig setTimestampPrecision(int precision)
      Sets the precision of the Timestamp NoSQL DB type when creating a new table. By default this is set to Constants.DEFAULT_TIMESTAMP_PRECISION.
      Timestamp values have a precision (0 - 9) which represents the fractional seconds to be held by the timestamp. A value of 0 means that no fractional seconds are stored, 3 means that the timestamp stores milliseconds, and 9 means a precision of nanoseconds.
      In the context of a CREATE TABLE statement, a precision must be explicitly specified. This restriction is to prevent users from inadvertently creating TIMESTAMP values with precision 9 (which takes more space) when in reality they don't need that high precision.
      See Timestamp documentation for more details.
    • setDefaultStorageGB

      public NosqlDbConfig setDefaultStorageGB(int defaultStorageGB)
      Sets the default storageGB when table is created if NosqlTable annotation is not present or it doesn't specify a storageGB value. Valid values are only values greater than 0. This applies only in cloud or cloud sim scenarios.

      If not set the default value is 25GB.

      For TableLimits to be set one of the following two conditions must be met:

      • capacityMode is set to PROVISIONED and all three: readUnits, writeUnits and storageGB must be greater than 0,
      • or capacityMode is set to ON_DEMAND and storageGB must be greater than 0.

      Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.

    • getDefaultStorageGB

      public int getDefaultStorageGB()
      Returns the value that was set for default storageGB or 25 otherwise.
    • setDefaultCapacityMode

      public NosqlDbConfig setDefaultCapacityMode(NosqlCapacityMode defaultCapacityMode)
      Sets the default capacity mode when table is created if NosqlTable annotation is not present. This applies only in cloud or cloud sim scenarios.

      If not set the default value is TableLimits.CapacityMode.PROVISIONED.

      Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.

    • getDefaultCapacityMode

      public NosqlCapacityMode getDefaultCapacityMode()
      Returns the default capacity mode set. If not set the returned value is TableLimits.CapacityMode.PROVISIONED.
    • setDefaultReadUnits

      public NosqlDbConfig setDefaultReadUnits(int defaultReadUnits)
      Sets the default read units when table is created if NosqlTable annotation is not present or it doesn't specify a readUnits value. Valid values are only values greater than 0. This applies only in cloud or cloud sim scenarios. When in PROVISIONED mode all three: storageGB, readUnits and writeUnits must be greater than 0 to be valid. TableLimits.

      If not set the default value is 50.

      Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.

    • getDefaultReadUnits

      public int getDefaultReadUnits()
      Returns the value that was set for default read units or 50 otherwise.
    • setDefaultWriteUnits

      public NosqlDbConfig setDefaultWriteUnits(int defaultWriteUnits)
      Sets the default write units when table is created if NosqlTable annotation is not present or it doesn't specify a writeUnits value. Valid values are only values greater than 0. This applies only in cloud or cloud sim scenarios. When in PROVISIONED mode all three: storageGB, readUnits and writeUnits must be greater than 0 to be valid. TableLimits.

      If not set the default value is 50.

      Note: StorageBG, capacity mode and read/write units can later be configured from the OCI console or using the API.

    • getDefaultWriteUnits

      public int getDefaultWriteUnits()
      Returns the value that was set for default write units or 50 otherwise.