|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.clarkparsia.stardog.api.ConnectionConfiguration
public final class ConnectionConfiguration
Simple class to create connection strings, and connections, for Stardog.
Connection strings generally define where the Stardog server is, what database to connect to,
and the parameters used when connecting. The parameters are ; delimited key-value pairs of
the form key=value at the end of the URL. key's are expected to be all lowercase and
values are case sensitive.
| Field Summary | |
|---|---|
static String |
DEFAULT_PASSWD
Constant for username used to create a connection when no username or password is present |
static String |
DEFAULT_USERNAME
Constant for username used to create a connection when no username or password is present |
static String |
PASSWD
Constant for the password option |
static String |
REASONING
Constant for creating specifying the reasoning level of a connection |
static String |
USERNAME
Constant for the username option |
static Set<String> |
VALID_PROPERTY_NAMES
Set of all valid connection property names |
| Constructor Summary | |
|---|---|
ConnectionConfiguration()
|
|
| Method Summary | |
|---|---|
static Connection |
at(String theConnectionString)
Open a connection to the database specified directly by the connection string |
static Connection |
at(String theConnectionString,
Properties theProperties)
Open a connection to the database specified directly by the connection string with the additional provided connection properties |
Connection |
connect()
Open the connection to the database as described by this configuration |
ReasoningConnection |
connect(ReasoningType theReasoningType)
Opens a reasoning connection to the database as described by this configuration and given reasoning type. |
ConnectionConfiguration |
copy()
Make a copy of this ConnectionConfiguration. |
ConnectionConfiguration |
credentials(String theUser,
String thePass)
Specify the username and password that should be used to authenticate to the database |
static ConnectionConfiguration |
from(String theConnectionString)
Create a ConnectionConfiguration based on the full connection string. |
ConnectionConfiguration |
reasoning(ReasoningType theReasoningType)
Specify the type of reasoning you would like the connection to utilize |
static ConnectionConfiguration |
to(String theName)
Create a new configuration object for connecting to the Stardog database with the provided name |
ConnectionConfiguration |
url(String theURL)
Specify the URL of the database server |
ConnectionConfiguration |
with(Properties theProps)
Use the key-value pairs in this dictionary as parameters to the connection |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String USERNAME
with(java.util.Properties),
Constant Field Valuespublic static final String DEFAULT_USERNAME
public static final String PASSWD
with(java.util.Properties),
Constant Field Valuespublic static final String DEFAULT_PASSWD
public static final String REASONING
public static Set<String> VALID_PROPERTY_NAMES
| Constructor Detail |
|---|
public ConnectionConfiguration()
| Method Detail |
|---|
public ConnectionConfiguration copy()
copy in interface Copyable<ConnectionConfiguration>
public ConnectionConfiguration credentials(String theUser,
String thePass)
theUser - the userthePass - the pass
public static Connection at(String theConnectionString)
throws StardogException
theConnectionString - the connection string
StardogException - if there was an error while connecting
public static Connection at(String theConnectionString,
Properties theProperties)
throws StardogException
theConnectionString - the connection stringtheProperties - additional connection properties
StardogException - if there is an error connecting to the specified repositorypublic static ConnectionConfiguration from(String theConnectionString)
connection pool.
theConnectionString - the connection string
public static ConnectionConfiguration to(String theName)
theName - the name
public ConnectionConfiguration reasoning(ReasoningType theReasoningType)
theReasoningType - the type of reasoning
public ConnectionConfiguration url(String theURL)
theURL - the db server URL
public ConnectionConfiguration with(Properties theProps)
theProps - the additional connection properties
public Connection connect()
throws StardogException
StardogException - if there was an error while opening the connection
public ReasoningConnection connect(ReasoningType theReasoningType)
throws StardogException
reasoning(theReasoningType).connect().as(ReasoningConnection.class).
This means passing ReasoningType.NONE as an argument will cause an exception.
theReasoningType - the type of reasoning
StardogException - if there was an error while opening the connection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||