Search in sources :

Example 1 with RepositoryInterceptor

use of org.eclipse.rdf4j.repository.event.RepositoryInterceptor in project rdf4j by eclipse.

the class InterceptingRepositoryWrapper method getConnection.

@Override
public InterceptingRepositoryConnection getConnection() throws RepositoryException {
    RepositoryConnection conn = getDelegate().getConnection();
    if (activated) {
        boolean denied = false;
        for (RepositoryInterceptor interceptor : interceptors) {
            denied = interceptor.getConnection(getDelegate(), conn);
            if (denied) {
                break;
            }
        }
        if (denied) {
            conn = null;
        }
    }
    if (conn == null)
        return null;
    InterceptingRepositoryConnection iconn = new InterceptingRepositoryConnectionWrapper(this, conn);
    for (RepositoryConnectionInterceptor conInterceptor : conInterceptors) {
        iconn.addRepositoryConnectionInterceptor(conInterceptor);
    }
    return iconn;
}
Also used : RepositoryConnection(org.eclipse.rdf4j.repository.RepositoryConnection) InterceptingRepositoryConnection(org.eclipse.rdf4j.repository.event.InterceptingRepositoryConnection) InterceptingRepositoryConnection(org.eclipse.rdf4j.repository.event.InterceptingRepositoryConnection) RepositoryConnectionInterceptor(org.eclipse.rdf4j.repository.event.RepositoryConnectionInterceptor) RepositoryInterceptor(org.eclipse.rdf4j.repository.event.RepositoryInterceptor)

Aggregations

RepositoryConnection (org.eclipse.rdf4j.repository.RepositoryConnection)1 InterceptingRepositoryConnection (org.eclipse.rdf4j.repository.event.InterceptingRepositoryConnection)1 RepositoryConnectionInterceptor (org.eclipse.rdf4j.repository.event.RepositoryConnectionInterceptor)1 RepositoryInterceptor (org.eclipse.rdf4j.repository.event.RepositoryInterceptor)1