com.clarkparsia.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 {#link #connect}, you must provide a valid connection string for the protocol. Use ConnectionConfiguration 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 AdminClient implementation. If the underlying protocol supports admin operations then createAdminClient(String) function can be used to perform admin operations.

Since:
0.3
Version:
1.0.1
Author:
Michael Grove

Method Summary
 boolean acceptsURL(String theURL)
          Whether or not this driver can provide a connection for the provided URL
 Connection connect(String theURL, Properties theProperties)
          Open a connection to the database
 com.clarkparsia.stardog.snarl.admin.client.AdminClient<?> createAdminClient(String theURL)
          [Optional] Creates an AdminClient to the database if the underlying protocol supports admin operations.
 int getMajorVersion()
          Return the major version of this driver
 int getMinorVersion()
          Return the minor version of this driver
 

Method Detail

connect

Connection connect(String theURL,
                   Properties theProperties)
                   throws StardogException
Open a connection to the database

Parameters:
theURL - the URL of the database
theProperties - any properties needed for the connection, such as timeouts or username/pw
Returns:
the connection
Throws:
StardogException - if the driver is unable to establish the connection

createAdminClient

com.clarkparsia.stardog.snarl.admin.client.AdminClient<?> createAdminClient(String theURL)
                                                                            throws StardogException,
                                                                                   UnsupportedOperationException
[Optional] Creates an AdminClient to the database if the underlying protocol supports admin operations.

Parameters:
theURL - the URL of the database
Returns:
admin client
Throws:
StardogException - if the driver is unable to establish the connection
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(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


Copyright © 2010-2013 Clark & Parsia. All Rights Reserved.