public final class Repositories extends Object
Repository
and RepositoryConnection
objects.Modifier and Type | Method and Description |
---|---|
static void |
consume(Repository repository,
java.util.function.Consumer<RepositoryConnection> processFunction)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Consumer , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static void |
consume(Repository repository,
java.util.function.Consumer<RepositoryConnection> processFunction,
java.util.function.Consumer<RepositoryException> exceptionHandler)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Consumer , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static void |
consumeSilent(Repository repository,
java.util.function.Consumer<RepositoryConnection> processFunction)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Consumer , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static <T> T |
get(Repository repository,
java.util.function.Function<RepositoryConnection,T> processFunction)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Function , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static <T> T |
get(Repository repository,
java.util.function.Function<RepositoryConnection,T> processFunction,
java.util.function.Consumer<RepositoryException> exceptionHandler)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Function , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static <T> T |
getSilent(Repository repository,
java.util.function.Function<RepositoryConnection,T> processFunction)
Opens a
RepositoryConnection to the given Repository, sends the
connection to the given Function , before either rolling back the
transaction if it failed, or committing the transaction if it was
successful. |
static <T> T |
graphQuery(Repository repository,
String query,
java.util.function.Function<GraphQueryResult,T> processFunction)
Performs a SPARQL Construct or Describe query on the given Repository and
passes the results to the given
Function with the result from the
function returned by the method. |
static void |
graphQuery(Repository repository,
String query,
RDFHandler handler)
Performs a SPARQL Construct or Describe query on the given Repository and
passes the results to the given
RDFHandler . |
static <T> T |
tupleQuery(Repository repository,
String query,
java.util.function.Function<TupleQueryResult,T> processFunction)
Performs a SPARQL Select query on the given Repository and passes the
results to the given
Function with the result from the function
returned by the method. |
static void |
tupleQuery(Repository repository,
String query,
TupleQueryResultHandler handler)
Performs a SPARQL Select query on the given Repository and passes the
results to the given
TupleQueryResultHandler . |
public static void consume(Repository repository, java.util.function.Consumer<RepositoryConnection> processFunction) throws RepositoryException, UnknownTransactionStateException
RepositoryConnection
to the given Repository, sends the
connection to the given Consumer
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.repository
- The Repository
to open a connection to.processFunction
- A Consumer
that performs an action on the connection.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)public static void consume(Repository repository, java.util.function.Consumer<RepositoryConnection> processFunction, java.util.function.Consumer<RepositoryException> exceptionHandler) throws RepositoryException, UnknownTransactionStateException
RepositoryConnection
to the given Repository, sends the
connection to the given Consumer
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.repository
- The Repository
to open a connection to.processFunction
- A Consumer
that performs an action on the connection.exceptionHandler
- A Consumer
that handles an exception if one was generated.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)public static void consumeSilent(Repository repository, java.util.function.Consumer<RepositoryConnection> processFunction)
RepositoryConnection
to the given Repository, sends the
connection to the given Consumer
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.repository
- The Repository
to open a connection to.processFunction
- A Consumer
that performs an action on the connection.public static <T> T get(Repository repository, java.util.function.Function<RepositoryConnection,T> processFunction) throws RepositoryException, UnknownTransactionStateException
RepositoryConnection
to the given Repository, sends the
connection to the given Function
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.T
- The type of the return value.repository
- The Repository
to open a connection to.processFunction
- A Function
that performs an action on the connection and
returns a result.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)public static <T> T get(Repository repository, java.util.function.Function<RepositoryConnection,T> processFunction, java.util.function.Consumer<RepositoryException> exceptionHandler) throws RepositoryException, UnknownTransactionStateException
RepositoryConnection
to the given Repository, sends the
connection to the given Function
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.T
- The type of the return value.repository
- The Repository
to open a connection to.processFunction
- A Function
that performs an action on the connection and
returns a result.exceptionHandler
- A Consumer
that handles an exception if one was generated.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)public static <T> T getSilent(Repository repository, java.util.function.Function<RepositoryConnection,T> processFunction)
RepositoryConnection
to the given Repository, sends the
connection to the given Function
, before either rolling back the
transaction if it failed, or committing the transaction if it was
successful.T
- The type of the return value.repository
- The Repository
to open a connection to.processFunction
- A Function
that performs an action on the connection and
returns a result.public static <T> T tupleQuery(Repository repository, String query, java.util.function.Function<TupleQueryResult,T> processFunction) throws RepositoryException, UnknownTransactionStateException, MalformedQueryException, QueryEvaluationException
Function
with the result from the function
returned by the method.T
- The type of the return value.repository
- The Repository
to open a connection to.query
- The SPARQL Select query to execute.processFunction
- A Function
that performs an action on the results of the
query and returns a result.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)MalformedQueryException
- If the supplied query is malformedQueryEvaluationException
- If there was an error evaluating the querypublic static void tupleQuery(Repository repository, String query, TupleQueryResultHandler handler) throws RepositoryException, UnknownTransactionStateException, MalformedQueryException, QueryEvaluationException
TupleQueryResultHandler
.repository
- The Repository
to open a connection to.query
- The SPARQL Select query to execute.handler
- A TupleQueryResultHandler
that consumes the results.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)MalformedQueryException
- If the supplied query is malformedQueryEvaluationException
- If there was an error evaluating the querypublic static <T> T graphQuery(Repository repository, String query, java.util.function.Function<GraphQueryResult,T> processFunction) throws RepositoryException, UnknownTransactionStateException, MalformedQueryException, QueryEvaluationException
Function
with the result from the
function returned by the method.T
- The type of the return value.repository
- The Repository
to open a connection to.query
- The SPARQL Construct or Describe query to execute.processFunction
- A Function
that performs an action on the results of the
query and returns a result.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)MalformedQueryException
- If the supplied query is malformedQueryEvaluationException
- If there was an error evaluating the querypublic static void graphQuery(Repository repository, String query, RDFHandler handler) throws RepositoryException, UnknownTransactionStateException, MalformedQueryException, QueryEvaluationException
RDFHandler
.repository
- The Repository
to open a connection to.query
- The SPARQL Construct or Describe query to execute.handler
- An RDFHandler
that consumes the results.RepositoryException
- If there was an exception dealing with the Repository.UnknownTransactionStateException
- If the transaction state was not properly recognised. (Optional
specific exception)MalformedQueryException
- If the supplied query is malformedQueryEvaluationException
- If there was an error evaluating the queryCopyright © 2001-2016 Aduna. All Rights Reserved.