Skip to content

Package: ConnectorFactory

ConnectorFactory

Coverage

1: /**
2: * Copyright (C) 2022 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
5: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
6: * version.
7: * <p>
8: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
10: * details. You should have received a copy of the GNU General Public License along with this program. If not, see
11: * <http://www.gnu.org/licenses/>.
12: */
13: package cz.cvut.kbss.ontodriver.sesame.connector;
14:
15: import cz.cvut.kbss.ontodriver.exception.OntoDriverException;
16: import cz.cvut.kbss.ontodriver.sesame.exceptions.SesameDriverException;
17: import org.eclipse.rdf4j.repository.Repository;
18:
19: public interface ConnectorFactory {
20:
21: /**
22: * Creates a storage connector.
23: * <p>
24: * It is possible that the underlying implementation will return some sort of proxy for a single storage connector.
25: *
26: * @return New storage connector
27: */
28: Connector createStorageConnector();
29:
30: /**
31: * Closes this factory
32: *
33: * @throws SesameDriverException When storage access error occurs
34: */
35: void close() throws OntoDriverException;
36:
37: /**
38: * Whether this factory is open.
39: *
40: * @return Factory status
41: */
42: boolean isOpen();
43:
44: /**
45: * Sets the underlying repository.
46: * <p>
47: * Note that this functionality is supported only for in-memory stores.
48: *
49: * @param repository The new repository
50: * @throws SesameDriverException In case setting the repository fails
51: */
52: void setRepository(Repository repository) throws SesameDriverException;
53: }