Skip to content

Package: TransactionalRepositoryConnection

TransactionalRepositoryConnection

nameinstructionbranchcomplexitylinemethod
TransactionalRepositoryConnection(RepositoryConnection)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
add(File, String, RDFFormat, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(InputStream, String, RDFFormat, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(Iterable, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(Iteration, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(Reader, String, RDFFormat, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(Resource, IRI, Value, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(Statement, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
add(URL, String, RDFFormat, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
begin()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
begin(IsolationLevel)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
clear(Resource[])
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
clearNamespaces()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
close()
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
commit()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
export(RDFHandler, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
exportStatements(Resource, IRI, Value, boolean, RDFHandler, Resource[])
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getContextIDs()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getIsolationLevel()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNamespace(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNamespaces()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getParserConfig()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getRepository()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getStatements(Resource, IRI, Value, boolean, Resource[])
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getValueFactory()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hasStatement(Resource, IRI, Value, boolean, Resource[])
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hasStatement(Statement, boolean, Resource[])
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isActive()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isAutoCommit()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isEmpty()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isOpen()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareBooleanQuery(QueryLanguage, String)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
prepareBooleanQuery(QueryLanguage, String, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareGraphQuery(QueryLanguage, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareGraphQuery(QueryLanguage, String, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareQuery(QueryLanguage, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareQuery(QueryLanguage, String, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareTupleQuery(QueryLanguage, String)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
prepareTupleQuery(QueryLanguage, String, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareUpdate(QueryLanguage, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepareUpdate(QueryLanguage, String, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
remove(Iterable, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
remove(Iteration, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
remove(Resource, IRI, Value, Resource[])
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
remove(Statement, Resource[])
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
removeNamespace(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
rollback()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setAutoCommit(boolean)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setIsolationLevel(IsolationLevel)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setNamespace(String, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setParserConfig(ParserConfig)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
size(Resource[])
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (C) 2016 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.ontodriver.sesame.connector;
16:
17:
18: import org.eclipse.rdf4j.IsolationLevel;
19: import org.eclipse.rdf4j.common.iteration.Iteration;
20: import org.eclipse.rdf4j.model.*;
21: import org.eclipse.rdf4j.query.*;
22: import org.eclipse.rdf4j.repository.Repository;
23: import org.eclipse.rdf4j.repository.RepositoryConnection;
24: import org.eclipse.rdf4j.repository.RepositoryException;
25: import org.eclipse.rdf4j.repository.RepositoryResult;
26: import org.eclipse.rdf4j.rio.*;
27:
28: import java.io.File;
29: import java.io.IOException;
30: import java.io.InputStream;
31: import java.io.Reader;
32: import java.net.URL;
33:
34: /**
35: * Wraps a standard Sesame {@link RepositoryConnection} and prevents its closing.
36: * <p>
37: * This is because the connector will handle closing when a transaction finishes or the connector is closed.
38: *
39: * @see PoolingStorageConnector
40: */
41: class TransactionalRepositoryConnection implements RepositoryConnection {
42:
43: private final RepositoryConnection wrappedConnection;
44:
45: TransactionalRepositoryConnection(RepositoryConnection wrappedConnection) {
46: this.wrappedConnection = wrappedConnection;
47: }
48:
49: @Override
50: public Repository getRepository() {
51: return wrappedConnection.getRepository();
52: }
53:
54: @Override
55: public void setParserConfig(ParserConfig config) {
56: wrappedConnection.setParserConfig(config);
57: }
58:
59: @Override
60: public ParserConfig getParserConfig() {
61: return wrappedConnection.getParserConfig();
62: }
63:
64: @Override
65: public ValueFactory getValueFactory() {
66: return wrappedConnection.getValueFactory();
67: }
68:
69: @Override
70: public boolean isOpen() throws RepositoryException {
71: return wrappedConnection.isOpen();
72: }
73:
74: @Override
75: public void close() throws RepositoryException {
76: // Do nothing !!!
77: }
78:
79: @Override
80: public Query prepareQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException {
81: return wrappedConnection.prepareQuery(ql, query);
82: }
83:
84: @Override
85: public Query prepareQuery(QueryLanguage ql, String query, String baseURI)
86: throws RepositoryException, MalformedQueryException {
87: return wrappedConnection.prepareQuery(ql, query, baseURI);
88: }
89:
90: @Override
91: public TupleQuery prepareTupleQuery(QueryLanguage ql, String query)
92: throws RepositoryException, MalformedQueryException {
93: return wrappedConnection.prepareTupleQuery(ql, query);
94: }
95:
96: @Override
97: public TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseURI)
98: throws RepositoryException, MalformedQueryException {
99: return wrappedConnection.prepareTupleQuery(ql, query, baseURI);
100: }
101:
102: @Override
103: public GraphQuery prepareGraphQuery(QueryLanguage ql, String query)
104: throws RepositoryException, MalformedQueryException {
105: return wrappedConnection.prepareGraphQuery(ql, query);
106: }
107:
108: @Override
109: public GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseURI)
110: throws RepositoryException, MalformedQueryException {
111: return wrappedConnection.prepareGraphQuery(ql, query, baseURI);
112: }
113:
114: @Override
115: public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query)
116: throws RepositoryException, MalformedQueryException {
117: return wrappedConnection.prepareBooleanQuery(ql, query);
118: }
119:
120: @Override
121: public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String baseURI)
122: throws RepositoryException, MalformedQueryException {
123: return wrappedConnection.prepareBooleanQuery(ql, query, baseURI);
124: }
125:
126: @Override
127: public Update prepareUpdate(QueryLanguage ql, String update) throws RepositoryException, MalformedQueryException {
128: return wrappedConnection.prepareUpdate(ql, update);
129: }
130:
131: @Override
132: public Update prepareUpdate(QueryLanguage ql, String update, String baseURI)
133: throws RepositoryException, MalformedQueryException {
134: return wrappedConnection.prepareUpdate(ql, update, baseURI);
135: }
136:
137: @Override
138: public RepositoryResult<Resource> getContextIDs() throws RepositoryException {
139: return wrappedConnection.getContextIDs();
140: }
141:
142: @Override
143: public RepositoryResult<Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred,
144: Resource... contexts) throws RepositoryException {
145: return wrappedConnection.getStatements(subj, pred, obj, includeInferred, contexts);
146: }
147:
148: @Override
149: public boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts)
150: throws RepositoryException {
151: return wrappedConnection.hasStatement(subj, pred, obj, includeInferred, contexts);
152: }
153:
154: @Override
155: public boolean hasStatement(Statement st, boolean includeInferred, Resource... contexts)
156: throws RepositoryException {
157: return wrappedConnection.hasStatement(st, includeInferred, contexts);
158: }
159:
160: @Override
161: public void exportStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, RDFHandler handler,
162: Resource... contexts) throws RepositoryException, RDFHandlerException {
163: wrappedConnection.exportStatements(subj, pred, obj, includeInferred, handler, contexts);
164: }
165:
166: @Override
167: public void export(RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException {
168: wrappedConnection.export(handler, contexts);
169: }
170:
171: @Override
172: public long size(Resource... contexts) throws RepositoryException {
173: return wrappedConnection.size(contexts);
174: }
175:
176: @Override
177: public boolean isEmpty() throws RepositoryException {
178: return wrappedConnection.isEmpty();
179: }
180:
181: @Override
182: public void setAutoCommit(boolean autoCommit) throws RepositoryException {
183: wrappedConnection.setAutoCommit(autoCommit);
184: }
185:
186: @Override
187: public boolean isAutoCommit() throws RepositoryException {
188: return wrappedConnection.isAutoCommit();
189: }
190:
191: @Override
192: public boolean isActive() throws RepositoryException {
193: return wrappedConnection.isActive();
194: }
195:
196: @Override
197: public void setIsolationLevel(IsolationLevel level) throws IllegalStateException {
198: wrappedConnection.setIsolationLevel(level);
199: }
200:
201: @Override
202: public IsolationLevel getIsolationLevel() {
203: return wrappedConnection.getIsolationLevel();
204: }
205:
206: @Override
207: public void begin() throws RepositoryException {
208: wrappedConnection.begin();
209: }
210:
211: @Override
212: public void begin(IsolationLevel level) throws RepositoryException {
213: wrappedConnection.begin(level);
214: }
215:
216: @Override
217: public void commit() throws RepositoryException {
218: wrappedConnection.commit();
219: }
220:
221: @Override
222: public void rollback() throws RepositoryException {
223: wrappedConnection.rollback();
224: }
225:
226: @Override
227: public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts)
228: throws IOException, RDFParseException, RepositoryException {
229: wrappedConnection.add(in, baseURI, dataFormat, contexts);
230: }
231:
232: @Override
233: public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts)
234: throws IOException, RDFParseException, RepositoryException {
235: wrappedConnection.add(reader, baseURI, dataFormat, contexts);
236: }
237:
238: @Override
239: public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts)
240: throws IOException, RDFParseException, RepositoryException {
241: wrappedConnection.add(url, baseURI, dataFormat, contexts);
242: }
243:
244: @Override
245: public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts)
246: throws IOException, RDFParseException, RepositoryException {
247: wrappedConnection.add(file, baseURI, dataFormat, contexts);
248: }
249:
250: @Override
251: public void add(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException {
252: wrappedConnection.add(subject, predicate, object, contexts);
253: }
254:
255: @Override
256: public void add(Statement st, Resource... contexts) throws RepositoryException {
257: wrappedConnection.add(st, contexts);
258: }
259:
260: @Override
261: public void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException {
262: wrappedConnection.add(statements, contexts);
263: }
264:
265: @Override
266: public <E extends Exception> void add(Iteration<? extends Statement, E> statements, Resource... contexts)
267: throws RepositoryException, E {
268: wrappedConnection.add(statements, contexts);
269: }
270:
271: @Override
272: public void remove(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException {
273: wrappedConnection.remove(subject, predicate, object, contexts);
274: }
275:
276: @Override
277: public void remove(Statement st, Resource... contexts) throws RepositoryException {
278: wrappedConnection.remove(st, contexts);
279: }
280:
281: @Override
282: public void remove(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException {
283: wrappedConnection.remove(statements, contexts);
284: }
285:
286: @Override
287: public <E extends Exception> void remove(Iteration<? extends Statement, E> statements, Resource... contexts)
288: throws RepositoryException, E {
289: wrappedConnection.remove(statements, contexts);
290: }
291:
292: @Override
293: public void clear(Resource... contexts) throws RepositoryException {
294: wrappedConnection.clear(contexts);
295: }
296:
297: @Override
298: public RepositoryResult<Namespace> getNamespaces() throws RepositoryException {
299: return wrappedConnection.getNamespaces();
300: }
301:
302: @Override
303: public String getNamespace(String prefix) throws RepositoryException {
304: return wrappedConnection.getNamespace(prefix);
305: }
306:
307: @Override
308: public void setNamespace(String prefix, String name) throws RepositoryException {
309: wrappedConnection.setNamespace(prefix, name);
310: }
311:
312: @Override
313: public void removeNamespace(String prefix) throws RepositoryException {
314: wrappedConnection.removeNamespace(prefix);
315: }
316:
317: @Override
318: public void clearNamespaces() throws RepositoryException {
319: wrappedConnection.clearNamespaces();
320: }
321: }