com.elastisys.scale.commons.openstack

## Class ApiAccessConfig

- java.lang.Object
- - com.elastisys.scale.commons.openstack.ApiAccessConfig

    public class ApiAccessConfig
    extends Object

Configuration object for an `OSClientFactory`, which declares how to authenticate and what OpenStack region to operate against.

The `OSClientFactory` can be configured to use either use version 2 or version 3 of the identity HTTP API.

### Field Summary

Fields
`static int` `DEFAULT_CONNECTION_TIMEOUT` The default timeout in milliseconds until a connection is established.
`static int` `DEFAULT_SOCKET_TIMEOUT` The default socket timeout (`SO_TIMEOUT`) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).

### Constructor Summary

Constructors
Constructor and Description
`ApiAccessConfig(AuthConfig auth, String region)` Creates a new `ApiAccessConfig`.
`ApiAccessConfig(AuthConfig auth, String region, Integer connectionTimeout, Integer socketTimeout)` Creates a new `ApiAccessConfig`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`AuthConfig` `getAuth()` Returns a description of how to authenticate with the OpenStack identity service (Keystone).
`Integer` `getConnectionTimeout()` The timeout in milliseconds until a connection is established.
`String` `getRegion()` Returns the particular OpenStack region (out of the ones available in Keystone's service catalog) to connect to.
`Integer` `getSocketTimeout()` The socket timeout (`SO_TIMEOUT`) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.
`int` `hashCode()`
`void` `validate()` Performs basic validation of this configuration.

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

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

### Field Detail

#### DEFAULT_CONNECTION_TIMEOUT

    public static final int DEFAULT_CONNECTION_TIMEOUT

The default timeout in milliseconds until a connection is established.

See Also:
  Constant Field Values

#### DEFAULT_SOCKET_TIMEOUT

    public static final int DEFAULT_SOCKET_TIMEOUT

The default socket timeout (`SO_TIMEOUT`) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).

See Also:
  Constant Field Values

### Constructor Detail

#### ApiAccessConfig

    public ApiAccessConfig(AuthConfig auth,
                           String region)

Creates a new `ApiAccessConfig`.

Parameters:
  `auth` - Declares how to authenticate with the OpenStack identity service (Keystone).
  `region` - The particular OpenStack region (out of the ones available in Keystone's service catalog) to connect to. For example, `RegionOne`.

#### ApiAccessConfig

    public ApiAccessConfig(AuthConfig auth,
                           String region,
                           Integer connectionTimeout,
                           Integer socketTimeout)

Creates a new `ApiAccessConfig`.

Parameters:
  `auth` - Declares how to authenticate with the OpenStack identity service (Keystone).
  `region` - The particular OpenStack region (out of the ones available in Keystone's service catalog) to connect to. For example, `RegionOne`.
  `connectionTimeout` - The timeout in milliseconds until a connection is established. May be `null`. Default: 10000 ms.
  `socketTimeout` - The socket timeout (`SO_TIMEOUT`) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets. May be `null`. Default: 10000 ms.

### Method Detail

#### getAuth

    public AuthConfig getAuth()

Returns a description of how to authenticate with the OpenStack identity service (Keystone).

Returns:

#### getRegion

    public String getRegion()

Returns the particular OpenStack region (out of the ones available in Keystone's service catalog) to connect to. For example, `RegionOne` .

Returns:

#### getConnectionTimeout

    public Integer getConnectionTimeout()

The timeout in milliseconds until a connection is established.

Returns:

#### getSocketTimeout

    public Integer getSocketTimeout()

The socket timeout (`SO_TIMEOUT`) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.

Returns:

#### validate

    public void validate()
                  throws IllegalArgumentException

Performs basic validation of this configuration. Throws an `IllegalArgumentException` on failure to validate the configuration.

Throws:
  `IllegalArgumentException`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`