public final class ConnectionConfiguration extends AbstractConnectionConfiguration<Connection> implements Copyable<ConnectionConfiguration>
Modifier and Type | Field and Description |
---|---|
static Option<Integer> |
CLIENT_BUFFER_SIZE |
static Option<String> |
DATABASE |
static Option<Boolean> |
EXACT_SIZE |
static Option<Boolean> |
OPTIMIZE_MIXED_UPDATES |
static Option<Boolean> |
REASONING_ENABLED
Deprecated.
Using this option directly is deprecated. Either use one of the
reasoning(boolean) or schema(String)
functions or the REASONING_SCHEMA option instead. |
static Option<String> |
REASONING_SCHEMA |
static Option<UUID> |
TX |
CONNECTION_TYPE, mOptionParser, mOptions, RUN_AS_USER
CREDENTIALS, CREDENTIALS_SUPPLIER, KRB5_REVERSE_DNS, PASSWORD, SERVER, USERNAME
Modifier | Constructor and Description |
---|---|
protected |
ConnectionConfiguration() |
protected |
ConnectionConfiguration(Options theOptions) |
Modifier and Type | Method and Description |
---|---|
static Connection |
at(String theConnectionString)
Open a connection to the database specified directly by the connection string which may contain connection options
|
Connection |
connect()
Create a connection object to the database as described by this configuration.
|
ConnectionConfiguration |
copy()
Create a deep copy of the object which does not share any references with the original.
|
ConnectionConfiguration |
credentials(ConnectionCredentials theConnectionCredentials)
Specify the credentials that should be used to authenticate to the database.
|
ConnectionConfiguration |
credentials(String theUsername,
String thePassword)
Specify the username and password that should be used to authenticate to the database.
|
ConnectionConfiguration |
credentialSupplier(Supplier<ConnectionCredentials> theSupplier)
Specify the supplier which will provide credentials at the time which they will be used.
|
ConnectionConfiguration |
database(String theDB)
Specify the name of the db you want to connect to
|
ConnectionConfiguration |
exactSize(boolean theExactSize)
Specify whether
size() calls on the connection must return accurate values. |
static ConnectionConfiguration |
from(String theConnectionString)
Create a SNARLConnectionConfiguration based on the full connection string.
|
<V> V |
get(Option<V> theOption)
Return the value of the provide connection configuration option
|
ConnectionConfiguration |
reasoning(boolean theReasoningFlag)
Specify whether you would like the connection to utilize reasoning.
|
ConnectionConfiguration |
runningAs(String theUsername)
Run commands passed to this connection as the given user
|
ConnectionConfiguration |
schema(String theSchema)
Specify the reasoning schema that will be used by connection.
|
ConnectionConfiguration |
server(String theServerURL)
Specify the URL of the database server.
|
static ConnectionConfiguration |
to(String theDBName)
Create a new configuration object for connecting to the Stardog database with the provided name
|
ConnectionConfiguration |
with(Options theOptions)
Use the given options as parameters to the connection
|
getOptions, set, setAll
@Deprecated public static final Option<Boolean> REASONING_ENABLED
reasoning(boolean)
or schema(String)
functions or the REASONING_SCHEMA
option instead.protected ConnectionConfiguration()
protected ConnectionConfiguration(Options theOptions)
public ConnectionConfiguration copy()
copy
in interface Copyable<ConnectionConfiguration>
public ConnectionConfiguration credentials(String theUsername, String thePassword)
credentials
in interface LoginConnectionConfiguration<Connection>
credentials
in class AbstractConnectionConfiguration<Connection>
theUsername
- the usernamethePassword
- the passwordpublic ConnectionConfiguration credentials(ConnectionCredentials theConnectionCredentials)
credentials
in interface LoginConnectionConfiguration<Connection>
credentials
in class AbstractConnectionConfiguration<Connection>
theConnectionCredentials
- the credentialspublic ConnectionConfiguration credentialSupplier(Supplier<ConnectionCredentials> theSupplier)
LoginConnectionConfiguration
credentialSupplier
in interface LoginConnectionConfiguration<Connection>
credentialSupplier
in class AbstractConnectionConfiguration<Connection>
theSupplier
- the credential supplierpublic ConnectionConfiguration server(String theServerURL)
server
in interface LoginConnectionConfiguration<Connection>
server
in class AbstractConnectionConfiguration<Connection>
theServerURL
- the server urlpublic ConnectionConfiguration runningAs(String theUsername)
runningAs
in class AbstractConnectionConfiguration<Connection>
theUsername
- the usernamepublic ConnectionConfiguration reasoning(boolean theReasoningFlag)
schema(String)
function beforehand then calling reasoning(true)
will have no effect. If schema is not set then calling reasoning(true)
is
equivalent to setting the schema to the default schema
. Calling reasoning(false)
is always equivalent to
setting the schema to the null schema
.theReasoningFlag
- the reasoning flagpublic ConnectionConfiguration schema(String theSchema)
reasoning(boolean)
.theSchema
- the name of the schemapublic ConnectionConfiguration exactSize(boolean theExactSize)
size()
calls on the connection must return accurate values.theExactSize
- the exact size flagpublic ConnectionConfiguration database(String theDB)
theDB
- the name of the databasepublic ConnectionConfiguration with(Options theOptions)
theOptions
- the connection optionspublic <V> V get(Option<V> theOption)
V
- the option typetheOption
- the valuepublic Connection connect() throws StardogException
Connection
is used.connect
in interface LoginConnectionConfiguration<Connection>
StardogException
- if there was an error while opening the connectionpublic static Connection at(String theConnectionString) throws StardogException
theConnectionString
- the connection stringStardogException
- if there is an error connecting to the specified repositorypublic static ConnectionConfiguration from(String theConnectionString)
connection pool
.theConnectionString
- the connection stringpublic static ConnectionConfiguration to(String theDBName)
theDBName
- the nameCopyright © 2010-2016 Stardog Union. All Rights Reserved.