use of org.eclipse.rdf4j.repository.event.RepositoryConnectionInterceptor 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;
}
use of org.eclipse.rdf4j.repository.event.RepositoryConnectionInterceptor in project rdf4j by eclipse.
the class InterceptingRepositoryConnectionWrapper method setAutoCommit.
@Override
@Deprecated
public void setAutoCommit(boolean autoCommit) throws RepositoryException {
boolean denied = false;
boolean wasAutoCommit = isAutoCommit();
if (activated && wasAutoCommit != autoCommit) {
for (RepositoryConnectionInterceptor interceptor : interceptors) {
denied = interceptor.setAutoCommit(getDelegate(), autoCommit);
if (denied) {
break;
}
}
}
if (!denied) {
getDelegate().setAutoCommit(autoCommit);
}
}
Aggregations