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
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 AdminConnection
connect()
Open the connection to the database as described by this configuration.AdminConnectionConfiguration
credentials(ConnectionCredentials theConnectionCredentials)
Specify the credentials that should be used to authenticate to the database.AdminConnectionConfiguration
credentials(java.lang.String theUsername, java.lang.String thePassword)
Specify the username and password that should be used to authenticate to the database.AdminConnectionConfiguration
credentialSupplier(java.util.function.Supplier<ConnectionCredentials> theSupplier)
Specify the supplier which will provide credentials at the time which they will be used.AdminConnectionConfiguration
runningAs(java.lang.String theUserName)
Run commands passed to this connection as the given userAdminConnectionConfiguration
server(java.lang.String theServerURL)
Specify the URL of the database server.static AdminConnectionConfiguration
toServer(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:
server
in interfaceLoginConnectionConfiguration<AdminConnection>
- Overrides:
server
in 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:
credentials
in interfaceLoginConnectionConfiguration<AdminConnection>
- Overrides:
credentials
in 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:
credentials
in interfaceLoginConnectionConfiguration<AdminConnection>
- Overrides:
credentials
in classAbstractConnectionConfiguration<AdminConnection>
- Parameters:
theConnectionCredentials
- the credentials- Returns:
- this configuration
-
credentialSupplier
public AdminConnectionConfiguration credentialSupplier(java.util.function.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 interfaceLoginConnectionConfiguration<AdminConnection>
- Overrides:
credentialSupplier
in 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:
runningAs
in 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)
-
-