Package com.complexible.stardog.api
Interface Driver
public interface Driver
The interface that any Driver must implement. A driver will provide a connection implementation
specific to its underlying protocol. To connect(java.lang.String, com.complexible.common.base.Options), you must provide a valid connection string for the
protocol. Use LoginConnectionConfiguration to programmatically create a connection string and use the appropriate
Driver to connect to Stardog.
Optionally, a driver can support performing admin operations by providing an AdminConnection implementation.
If the underlying protocol supports admin operations then connectAdmin(String, Options) function can be used to
perform admin operations.
- Since:
- 0.3
- Version:
- 2.0
- Author:
- Michael Grove
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String theURL) Whether or not this driver can provide a connection for the provided URLOpen a connection to the databaseconnectAdmin(String theURL, Options theOptions) [Optional] Creates anAdminConnectionto the database if the underlying protocol supports admin operations.intReturn the major version of this driverintReturn the minor version of this driver
-
Method Details
-
connect
Open a connection to the database- Parameters:
theURL- the URL of the databasetheOptions- any options needed for the connection, such as timeouts or username/pw- Returns:
- the connection
- Throws:
StardogException- if the driver is unable to establish the connection
-
connectAdmin
AdminConnection connectAdmin(String theURL, Options theOptions) throws StardogException, UnsupportedOperationException [Optional] Creates anAdminConnectionto the database if the underlying protocol supports admin operations.- Parameters:
theURL- the URL of the databasetheOptions- any options needed for the connection, such as timeouts or username/pw- Returns:
- admin client
- Throws:
StardogException- if the driver is unable to establish the connectionUnsupportedOperationException- if the driver does not support admin operations
-
getMajorVersion
int getMajorVersion()Return the major version of this driver- Returns:
- the major version
-
getMinorVersion
int getMinorVersion()Return the minor version of this driver- Returns:
- the minor version
-
acceptsURL
Whether or not this driver can provide a connection for the provided URL- Parameters:
theURL- the URL- Returns:
- true if it can (potentially) connect to it, false otherwise
-