Package com.complexible.stardog.api
Class ConnectionConfiguration
java.lang.Object
com.complexible.stardog.api.AbstractConnectionConfiguration<Connection>
com.complexible.stardog.api.ConnectionConfiguration
- All Implemented Interfaces:
Copyable<ConnectionConfiguration>,LoginConnectionConfiguration<Connection>
public final class ConnectionConfiguration
extends AbstractConnectionConfiguration<Connection>
implements Copyable<ConnectionConfiguration>
- Since:
- 0.1
- Version:
- 3.0
- Author:
- Michael Grove Grove, Hector Perez-Urbina
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.Using this option directly is deprecated.Fields inherited from class com.complexible.stardog.api.AbstractConnectionConfiguration
CONNECTION_TYPE, mOptionParser, mOptions, RUN_AS_USERFields inherited from interface com.complexible.stardog.api.LoginConnectionConfiguration
BEARER, CREDENTIALS, CREDENTIALS_SUPPLIER, IS_TOKEN, KRB5_REVERSE_DNS, PASSWORD, SERVER, USERNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionOpen a connection to the database specified directly by the connection string which may contain connection optionsconnect()Create a connection object to the database as described by this configuration.copy()Create a deep copy of the object which does not share any references with the original.credentials(ConnectionCredentials theConnectionCredentials) Specify the credentials that should be used to authenticate to the database.credentials(String theUsername, String thePassword) Specify the username and password that should be used to authenticate to the database.credentialSupplier(Supplier<ConnectionCredentials> theSupplier) Specify the supplier which will provide credentials at the time which they will be used.Specify the name of the db you want to connect toexactSize(boolean theExactSize) Specify whethersize()calls on the connection must return accurate values.static ConnectionConfigurationCreate a SNARLConnectionConfiguration based on the full connection string.<V> VReturn the value of the provide connection configuration optionreasoning(boolean theReasoningFlag) Specify whether you would like the connection to utilize reasoning.Run commands passed to this connection as the given userSpecify the reasoning schema that will be used by connection.Specify the URL of the database server.static ConnectionConfigurationCreate a new configuration object for connecting to the Stardog database with the provided nameUse the given options as parameters to the connectionMethods inherited from class com.complexible.stardog.api.AbstractConnectionConfiguration
credentials, getOptions, set, setAll
-
Field Details
-
REASONING_ENABLED
Deprecated.Using this option directly is deprecated. Either use one of thereasoning(boolean)orschema(String)functions or theREASONING_SCHEMAoption instead. -
REASONING_SCHEMA
-
DATABASE
-
TX
-
CLIENT_BUFFER_SIZE
-
OPTIMIZE_MIXED_UPDATES
-
EXACT_SIZE
-
-
Constructor Details
-
ConnectionConfiguration
protected ConnectionConfiguration() -
ConnectionConfiguration
-
-
Method Details
-
copy
Create a deep copy of the object which does not share any references with the original.- Specified by:
copyin interfaceCopyable<ConnectionConfiguration>- Returns:
- a copy of the object
-
credentials
Specify the username and password that should be used to authenticate to the database.- Specified by:
credentialsin interfaceLoginConnectionConfiguration<Connection>- Overrides:
credentialsin classAbstractConnectionConfiguration<Connection>- Parameters:
theUsername- the usernamethePassword- the password- Returns:
- this configuration
-
credentials
Specify the credentials that should be used to authenticate to the database.- Specified by:
credentialsin interfaceLoginConnectionConfiguration<Connection>- Overrides:
credentialsin classAbstractConnectionConfiguration<Connection>- Parameters:
theConnectionCredentials- the credentials- Returns:
- this configuration
-
credentialSupplier
Description copied from interface:LoginConnectionConfigurationSpecify the supplier which will provide credentials at the time which they will be used.- Specified by:
credentialSupplierin interfaceLoginConnectionConfiguration<Connection>- Overrides:
credentialSupplierin classAbstractConnectionConfiguration<Connection>- Parameters:
theSupplier- the credential supplier- Returns:
- this configuration
-
server
Specify the URL of the database server.- Specified by:
serverin interfaceLoginConnectionConfiguration<Connection>- Overrides:
serverin classAbstractConnectionConfiguration<Connection>- Parameters:
theServerURL- the server url- Returns:
- this configuration
-
runningAs
Run commands passed to this connection as the given user- Overrides:
runningAsin classAbstractConnectionConfiguration<Connection>- Parameters:
theUsername- the username- Returns:
- this object
-
reasoning
Specify whether you would like the connection to utilize reasoning. If the reasoning schema was explicitly set via theschema(String)function beforehand then callingreasoning(true)will have no effect. If schema is not set then callingreasoning(true)is equivalent to setting the schema to thedefault schema. Callingreasoning(false)is always equivalent to setting the schema to thenull schema.- Parameters:
theReasoningFlag- the reasoning flag- Returns:
- this configuration
-
schema
Specify the reasoning schema that will be used by connection. If the schema is specified with this function then you do not need to callreasoning(boolean).- Parameters:
theSchema- the name of the schema- Returns:
- this query
-
exactSize
Specify whethersize()calls on the connection must return accurate values.- Parameters:
theExactSize- the exact size flag- Returns:
- this configuration
-
database
Specify the name of the db you want to connect to- Parameters:
theDB- the name of the database- Returns:
- this configuration
-
with
Use the given options as parameters to the connection- Parameters:
theOptions- the connection options- Returns:
- this object
-
get
Return the value of the provide connection configuration option- Type Parameters:
V- the option type- Parameters:
theOption- the value- Returns:
- the option value, or null if it is not set
-
connect
Create a connection object to the database as described by this configuration. This function does not necessarily open a network connection to the server which may happen later when theConnectionis used.- Specified by:
connectin interfaceLoginConnectionConfiguration<Connection>- Returns:
- the connection
- Throws:
StardogException- if there was an error while opening the connection
-
at
Open a connection to the database specified directly by the connection string which may contain connection options- Parameters:
theConnectionString- the connection string- Returns:
- the connection
- Throws:
StardogException- if there is an error connecting to the specified repository
-
from
Create a SNARLConnectionConfiguration based on the full connection string. A ConnectionConfiguration is returned to give users the ability to change properties of the connection string before connecting, or to use to establish aconnection pool.- Parameters:
theConnectionString- the connection string- Returns:
- the configuration representing the connection string.
-
to
Create a new configuration object for connecting to the Stardog database with the provided name- Parameters:
theDBName- the name- Returns:
- a new connection configuration
-