Package com.complexible.stardog.api

# Class AbstractConnectionConfiguration<T>

java.lang.Object
com.complexible.stardog.api.AbstractConnectionConfiguration<T>

All Implemented Interfaces:
  `LoginConnectionConfiguration<T>`

Direct Known Subclasses:
  `AdminConnectionConfiguration`, `ConnectionConfiguration`

public abstract class AbstractConnectionConfiguration<T> extends Object implements LoginConnectionConfiguration<T>

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Option<String>`
  `CONNECTION_TYPE`
  This is used to describe Stardog's communicate to server to which this connection will connect information about how this connection is being used The main use case is for a replicated cluster command to be able to tell the remote node that this connection is in fact replicated and not a command coming from an end user.
  `static final com.complexible.stardog.api.OptionParser`
  `mOptionParser`
  `protected final Options`
  `mOptions`
  `static final Option<String>`
  `RUN_AS_USER`

  ### Fields inherited from interface com.complexible.stardog.api.LoginConnectionConfiguration

  `BEARER, CREDENTIALS, CREDENTIALS_SUPPLIER, IS_TOKEN, KRB5_REVERSE_DNS, PASSWORD, SERVER, USERNAME`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractConnectionConfiguration()`
  `protected`
  `AbstractConnectionConfiguration(Options theOptions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AbstractConnectionConfiguration<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.
  `AbstractConnectionConfiguration<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.
  `AbstractConnectionConfiguration`
  `runningAs(String theUsername)`
  Run commands passed to this connection as the given user
  `AbstractConnectionConfiguration<T>`
  `server(String theServerURL)`
  Specify the URL of the database server.
  `<S> AbstractConnectionConfiguration<T>`
  `set(Option<S> theOption, S theValue)`
  Set an arbitrary option.
  `LoginConnectionConfiguration<T>`
  `setAll(Options theOptions)`
  Set all the specified options

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

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

  ### Methods inherited from interface com.complexible.stardog.api.LoginConnectionConfiguration

  `connect`

- ## Field Details

  - ### mOptions

    protected final Options mOptions

  - ### mOptionParser

    public static final com.complexible.stardog.api.OptionParser mOptionParser

  - ### RUN_AS_USER

    public static final Option<String> RUN_AS_USER

  - ### CONNECTION_TYPE

    public static final Option<String> CONNECTION_TYPE
    This is used to describe Stardog's communicate to server to which this connection will connect information about how this connection is being used The main use case is for a replicated cluster command to be able to tell the remote node that this connection is in fact replicated and not a command coming from an end user.

- ## Constructor Details

  - ### AbstractConnectionConfiguration

    protected AbstractConnectionConfiguration()

  - ### AbstractConnectionConfiguration

    protected AbstractConnectionConfiguration(Options theOptions)

- ## Method Details

  - ### set

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

  - ### credentials

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

  - ### credentials

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

  - ### credentialSupplier

    public LoginConnectionConfiguration<T> credentialSupplier(Supplier<ConnectionCredentials> theSupplier)
    Description copied from interface: `LoginConnectionConfiguration`
    Specify the supplier which will provide credentials at the time which they will be used.
    Specified by:
      `credentialSupplier` in interface `LoginConnectionConfiguration<T>`
    Parameters:
      `theSupplier` - the credential supplier
    Returns:
      this configuration

  - ### credentials

    public LoginConnectionConfiguration<T> credentials(String theAPIToken)
    Description copied from interface: `LoginConnectionConfiguration`
    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.
    Specified by:
      `credentials` in interface `LoginConnectionConfiguration<T>`
    Returns:
      this configuration

  - ### server

    public AbstractConnectionConfiguration<T> server(String theServerURL)
    Specify the URL of the database server.
    Specified by:
      `server` in interface `LoginConnectionConfiguration<T>`
    Parameters:
      `theServerURL` - the server url
    Returns:
      this configuration

  - ### runningAs

    public AbstractConnectionConfiguration runningAs(String theUsername)
    Run commands passed to this connection as the given user
    Parameters:
      `theUsername` - the username
    Returns:
      this object

  - ### setAll

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

  - ### getOptions

    public 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.
    Specified by:
      `getOptions` in interface `LoginConnectionConfiguration<T>`
    Returns:
      the options