Package com.complexible.stardog.api

# Interface LoginConnectionConfiguration<T>

All Known Implementing Classes:
  `AbstractConnectionConfiguration`, `AdminConnectionConfiguration`, `ConnectionConfiguration`

public interface LoginConnectionConfiguration<T>

Interface representing connection options such as authentication credentials and the server to connect to.

Since:
  0.1
Version:
  3.0
Author:
  Hector Perez-Urbina, Michael Grove

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `BEARER`
  Special username that will be used when an `API token` is used
  `static final Option<ConnectionCredentials>`
  `CREDENTIALS`
  Option for the credentials associated with a connection
  `static final Option<Supplier<ConnectionCredentials>>`
  `CREDENTIALS_SUPPLIER`
  Option to set the Supplier which will be called at the time connection credentials are needed
  `static final Option<Boolean>`
  `IS_TOKEN`
  Option for the token property
  `static final Option<Boolean>`
  `KRB5_REVERSE_DNS`
  Set a specific credential object instead of an implied on with username/password.
  `static final Option<String>`
  `PASSWORD`
  Option for the password property
  `static final Option<String>`
  `SERVER`
  Option for the server URL property
  `static final Option<String>`
  `USERNAME`
  Option for the username property

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `connect()`
  Open the connection to the database as described by this configuration.
  `LoginConnectionConfiguration<T>`
  `credentials(ConnectionCredentials theConnectionCredentials)`
  Specify the credentials that should be used to authenticate to the database.
  `LoginConnectionConfiguration<T>`
  `credentials(String theAPIToken)`
  Specify the API token that should be used to authenticate to the database.
  `LoginConnectionConfiguration<T>`
  `credentials(String theUsername, String thePassword)`
  Specify the username and password that should be used to authenticate to the database.
  `LoginConnectionConfiguration<T>`
  `credentialSupplier(Supplier<ConnectionCredentials> theSupplier)`
  Specify the supplier which will provide credentials at the time which they will be used.
  `Options`
  `getOptions()`
  Return the current options of this configuration.
  `LoginConnectionConfiguration<T>`
  `server(String theServerURL)`
  Specify the URL of the database server.
  `<S> LoginConnectionConfiguration<T>`
  `set(Option<S> theOption, S theValue)`
  Set an arbitrary option.
  `LoginConnectionConfiguration<T>`
  `setAll(Options theOptions)`
  Set all the specified options

- ## Field Details

  - ### BEARER

    static final String BEARER
    Special username that will be used when an `API token` is used
    See Also:
      - Constant Field Values

  - ### USERNAME

    static final Option<String> USERNAME
    Option for the username property

  - ### PASSWORD

    static final Option<String> PASSWORD
    Option for the password property

  - ### IS_TOKEN

    static final Option<Boolean> IS_TOKEN
    Option for the token property

  - ### SERVER

    static final Option<String> SERVER
    Option for the server URL property

  - ### CREDENTIALS

    static final Option<ConnectionCredentials> CREDENTIALS
    Option for the credentials associated with a connection

  - ### CREDENTIALS_SUPPLIER

    static final Option<Supplier<ConnectionCredentials>> CREDENTIALS_SUPPLIER
    Option to set the Supplier which will be called at the time connection credentials are needed

  - ### KRB5_REVERSE_DNS

    static final Option<Boolean> KRB5_REVERSE_DNS
    Set a specific credential object instead of an implied on with username/password. This option is used to setup Kerberos authentication.

- ## Method Details

  - ### connect

    T connect() throws StardogException
    Open the connection to the database as described by this configuration.
    Returns:
      the connection
    Throws:
      `StardogException` - if there was an error while opening the connection.

  - ### credentials

    LoginConnectionConfiguration<T> credentials(String theUsername, String thePassword)
    Specify the username and password that should be used to authenticate to the database.
    Parameters:
      `theUsername` - the username
      `thePassword` - the password
    Returns:
      this configuration

  - ### credentials

    LoginConnectionConfiguration<T> credentials(ConnectionCredentials theConnectionCredentials)
    Specify the credentials that should be used to authenticate to the database.
    Parameters:
      `theConnectionCredentials` - the credentials
    Returns:
      this configuration

  - ### credentialSupplier

    LoginConnectionConfiguration<T> credentialSupplier(Supplier<ConnectionCredentials> theSupplier)
    Specify the supplier which will provide credentials at the time which they will be used.
    Parameters:
      `theSupplier` - the credential supplier
    Returns:
      this configuration

  - ### credentials

    LoginConnectionConfiguration<T> credentials(String theAPIToken)
    Specify the API token that should be used to authenticate to the database. No other credentials info (username or password) is needed if an API token is provided.
    Returns:
      this configuration

  - ### server

    LoginConnectionConfiguration<T> server(String theServerURL)
    Specify the URL of the database server.
    Parameters:
      `theServerURL` - the server url
    Returns:
      this configuration

  - ### set

    <S> LoginConnectionConfiguration<T> set(Option<S> theOption, S theValue)
    Set an arbitrary option.
    Parameters:
      `theOption` - the option to set
      `theValue` - the value of the option
    Returns:
      this configuration

  - ### setAll

    LoginConnectionConfiguration<T> setAll(Options theOptions)
    Set all the specified options
    Parameters:
      `theOptions` - the options to set
    Returns:
      this configuration

  - ### getOptions

    Options getOptions()
    Return the current options of this configuration. Returns a copy of the options, changes to the resulting object will have NO effect on this configuration.
    Returns:
      the options