Class AdminConnectionConfiguration
- java.lang.Object
-
- com.complexible.stardog.api.AbstractConnectionConfiguration<AdminConnection>
-
- com.complexible.stardog.api.admin.AdminConnectionConfiguration
-
- All Implemented Interfaces:
LoginConnectionConfiguration<AdminConnection>
public final class AdminConnectionConfiguration extends AbstractConnectionConfiguration<AdminConnection>
- Version:
- 2.0
- Author:
- Hector Perez-Urbina
-
-
Field Summary
-
Fields inherited from class com.complexible.stardog.api.AbstractConnectionConfiguration
CONNECTION_TYPE, mOptionParser, mOptions, 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 Constructor Description AdminConnectionConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminConnectionconnect()Open the connection to the database as described by this configuration.AdminConnectionConfigurationcredentials(ConnectionCredentials theConnectionCredentials)Specify the credentials that should be used to authenticate to the database.AdminConnectionConfigurationcredentials(java.lang.String theAPIToken)Specify the API token that should be used to authenticate to the database.AdminConnectionConfigurationcredentials(java.lang.String theUsername, java.lang.String thePassword)Specify the username and password that should be used to authenticate to the database.AdminConnectionConfigurationcredentialSupplier(java.util.function.Supplier<ConnectionCredentials> theSupplier)Specify the supplier which will provide credentials at the time which they will be used.AdminConnectionConfigurationrunningAs(java.lang.String theUserName)Run commands passed to this connection as the given userAdminConnectionConfigurationserver(java.lang.String theServerURL)Specify the URL of the database server.static AdminConnectionConfigurationtoServer(java.lang.String theServerURL)-
Methods inherited from class com.complexible.stardog.api.AbstractConnectionConfiguration
getOptions, set, setAll
-
-
-
-
Method Detail
-
server
public AdminConnectionConfiguration server(java.lang.String theServerURL)
Specify the URL of the database server.- Specified by:
serverin interfaceLoginConnectionConfiguration<AdminConnection>- Overrides:
serverin classAbstractConnectionConfiguration<AdminConnection>- Parameters:
theServerURL- the server url- Returns:
- this configuration
-
credentials
public AdminConnectionConfiguration credentials(java.lang.String theUsername, java.lang.String thePassword)
Specify the username and password that should be used to authenticate to the database.- Specified by:
credentialsin interfaceLoginConnectionConfiguration<AdminConnection>- Overrides:
credentialsin classAbstractConnectionConfiguration<AdminConnection>- Parameters:
theUsername- the usernamethePassword- the password- Returns:
- this configuration
-
credentials
public AdminConnectionConfiguration credentials(ConnectionCredentials theConnectionCredentials)
Specify the credentials that should be used to authenticate to the database.- Specified by:
credentialsin interfaceLoginConnectionConfiguration<AdminConnection>- Overrides:
credentialsin classAbstractConnectionConfiguration<AdminConnection>- Parameters:
theConnectionCredentials- the credentials- Returns:
- this configuration
-
credentials
public AdminConnectionConfiguration credentials(java.lang.String theAPIToken)
Description copied from interface:LoginConnectionConfigurationSpecify 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:
credentialsin interfaceLoginConnectionConfiguration<AdminConnection>- Overrides:
credentialsin classAbstractConnectionConfiguration<AdminConnection>- Returns:
- this configuration
-
credentialSupplier
public AdminConnectionConfiguration credentialSupplier(java.util.function.Supplier<ConnectionCredentials> theSupplier)
Description copied from interface:LoginConnectionConfigurationSpecify the supplier which will provide credentials at the time which they will be used.- Specified by:
credentialSupplierin interfaceLoginConnectionConfiguration<AdminConnection>- Overrides:
credentialSupplierin classAbstractConnectionConfiguration<AdminConnection>- Parameters:
theSupplier- the credential supplier- Returns:
- this configuration
-
runningAs
public AdminConnectionConfiguration runningAs(java.lang.String theUserName)
Run commands passed to this connection as the given user- Overrides:
runningAsin classAbstractConnectionConfiguration<AdminConnection>- Parameters:
theUserName- the username- Returns:
- this object
-
connect
public AdminConnection 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.
-
toServer
public static AdminConnectionConfiguration toServer(java.lang.String theServerURL)
-
-