Package com.complexible.stardog.api
Interface Driver
-
public interface DriverThe interface that any Driver must implement. A driver will provide a
connectionimplementation specific to its underlying protocol. Toconnect(java.lang.String, com.complexible.common.base.Options), you must provide a valid connection string for the protocol. UseLoginConnectionConfigurationto 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
AdminConnectionimplementation. If the underlying protocol supports admin operations thenconnectAdmin(String, Options)function can be used to perform admin operations.- Since:
- 0.3
- Version:
- 2.0
- Author:
- Michael Grove
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanacceptsURL(java.lang.String theURL)Whether or not this driver can provide a connection for the provided URLConnectionconnect(java.lang.String theURL, Options theOptions)Open a connection to the databaseAdminConnectionconnectAdmin(java.lang.String theURL, Options theOptions)[Optional] Creates anAdminConnectionto the database if the underlying protocol supports admin operations.intgetMajorVersion()Return the major version of this driverintgetMinorVersion()Return the minor version of this driver
-
-
-
Method Detail
-
connect
Connection connect(java.lang.String theURL, Options theOptions) throws StardogException
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(java.lang.String theURL, Options theOptions) throws StardogException, java.lang.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 connectionjava.lang.UnsupportedOperationException- 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
boolean acceptsURL(java.lang.String theURL)
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
-
-