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 Option<ConnectionCredentials>
CREDENTIALS
Option for the credentials associated with a connectionstatic Option<java.util.function.Supplier<ConnectionCredentials>>
CREDENTIALS_SUPPLIER
Option to set the Supplier which will be called at the time connection credentials are neededstatic Option<java.lang.Boolean>
IS_TOKEN
Option for the token propertystatic Option<java.lang.Boolean>
KRB5_REVERSE_DNS
Set a specific credential object instead of an implied on with username/password.static Option<java.lang.String>
PASSWORD
Option for the password propertystatic Option<java.lang.String>
SERVER
Option for the server URL propertystatic Option<java.lang.String>
USERNAME
Option for the username property
-
Method Summary
All Methods Instance Methods Abstract Methods 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(java.lang.String theUsername, java.lang.String thePassword)
Specify the username and password that should be used to authenticate to the database.LoginConnectionConfiguration<T>
credentialSupplier(java.util.function.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(java.lang.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 Detail
-
USERNAME
static final Option<java.lang.String> USERNAME
Option for the username property
-
PASSWORD
static final Option<java.lang.String> PASSWORD
Option for the password property
-
IS_TOKEN
static final Option<java.lang.Boolean> IS_TOKEN
Option for the token property
-
SERVER
static final Option<java.lang.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<java.util.function.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<java.lang.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 Detail
-
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(java.lang.String theUsername, java.lang.String thePassword)
Specify the username and password that should be used to authenticate to the database.- Parameters:
theUsername
- the usernamethePassword
- 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(java.util.function.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
-
server
LoginConnectionConfiguration<T> server(java.lang.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 settheValue
- 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
-
-