com.elastisys.scale.commons.openstack

## Class AuthConfig

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

    public class AuthConfig
    extends Object

A configuration that declares how to authenticate the user to OpenStack's identity service (Keystone).

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

See Also:
  `ApiAccessConfig`

### Constructor Summary

Constructors
Constructor and Description
`AuthConfig(String keystoneUrl, AuthV2Credentials v2Credentials, AuthV3Credentials v3Credentials)` Creates a new `AuthConfig`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object obj)`
`String` `getKeystoneUrl()`
`AuthV2Credentials` `getV2Credentials()`
`AuthV3Credentials` `getV3Credentials()`
`int` `hashCode()`
`boolean` `isV2Auth()` Returns `true` if version 2 type authentication credentials are used.
`boolean` `isV3Auth()` Returns `true` if version 3 type authentication credentials are used.
`void` `validate()` Validates the configuration.

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

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

### Constructor Detail

#### AuthConfig

    public AuthConfig(String keystoneUrl,
                      AuthV2Credentials v2Credentials,
                      AuthV3Credentials v3Credentials)

Creates a new `AuthConfig`. Either `AuthV2Credentials` or `AuthV3Credentials` need to be specified, but not both.

Parameters:
  `keystoneUrl` - Endpoint URL of the OpenStack authentication service (Keystone).
  `v2Credentials` - Version 2 type authentication credentials. May be `null` if version 3 credentials are given.
  `v3Credentials` - Version 3 type authentication credentials. May be `null` if version 2 credentials are given.

### Method Detail

#### getKeystoneUrl

    public String getKeystoneUrl()

Returns:
  the `keystoneUrl`

#### getV2Credentials

    public AuthV2Credentials getV2Credentials()

Returns:
  the `v2Credentials`

#### getV3Credentials

    public AuthV3Credentials getV3Credentials()

Returns:
  the `v3Credentials`

#### isV2Auth

    public boolean isV2Auth()

Returns `true` if version 2 type authentication credentials are used.

Returns:

#### isV3Auth

    public boolean isV3Auth()

Returns `true` if version 3 type authentication credentials are used.

Returns:

#### validate

    public void validate()
                  throws IllegalArgumentException

Validates the configuration. On illegal value combination(s), an `IllegalArgumentException` is thrown.

Throws:
  `IllegalArgumentException`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`