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 java.lang.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 Option<java.lang.String>CONNECTION_TYPEThis 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 com.complexible.stardog.api.OptionParsermOptionParserprotected OptionsmOptionsstatic Option<java.lang.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 protectedAbstractConnectionConfiguration()protectedAbstractConnectionConfiguration(Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods 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(java.lang.String theAPIToken)Specify the API token that should be used to authenticate to the database.AbstractConnectionConfiguration<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.OptionsgetOptions()Return the current options of this configuration.AbstractConnectionConfigurationrunningAs(java.lang.String theUsername)Run commands passed to this connection as the given userAbstractConnectionConfiguration<T>server(java.lang.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 Detail
-
mOptions
protected final Options mOptions
-
mOptionParser
public static final com.complexible.stardog.api.OptionParser mOptionParser
-
RUN_AS_USER
public static final Option<java.lang.String> RUN_AS_USER
-
CONNECTION_TYPE
public static final Option<java.lang.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 Detail
-
AbstractConnectionConfiguration
protected AbstractConnectionConfiguration()
-
AbstractConnectionConfiguration
protected AbstractConnectionConfiguration(Options theOptions)
-
-
Method Detail
-
set
public <S> AbstractConnectionConfiguration<T> set(Option<S> theOption, S theValue)
Set an arbitrary option.- Specified by:
setin interfaceLoginConnectionConfiguration<T>- Parameters:
theOption- the option to settheValue- the value of the option- Returns:
- this configuration
-
credentials
public AbstractConnectionConfiguration<T> 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<T>- Parameters:
theUsername- the usernamethePassword- 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:
credentialsin interfaceLoginConnectionConfiguration<T>- Parameters:
theConnectionCredentials- the credentials- Returns:
- this configuration
-
credentialSupplier
public LoginConnectionConfiguration<T> 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<T>- Parameters:
theSupplier- the credential supplier- Returns:
- this configuration
-
credentials
public LoginConnectionConfiguration<T> 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<T>- Returns:
- this configuration
-
server
public AbstractConnectionConfiguration<T> server(java.lang.String theServerURL)
Specify the URL of the database server.- Specified by:
serverin interfaceLoginConnectionConfiguration<T>- Parameters:
theServerURL- the server url- Returns:
- this configuration
-
runningAs
public AbstractConnectionConfiguration runningAs(java.lang.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:
setAllin interfaceLoginConnectionConfiguration<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:
getOptionsin interfaceLoginConnectionConfiguration<T>- Returns:
- the options
-
-