StorageConnector extends AbstractConnector { @Override public void close() throws SesameDriverException { if (!open) { return; } LOG.debug("Closing connector to repository {}.", configuration.getStorageProperties().getPhysicalURI()); try { repository.shutDown(); if (manager != null) { manager.shutDown(); } } catch (RepositoryException e) { throw new SesameDriverException("Exception caught when closing Sesame repository connection.", e); } finally { this.open = false; } } StorageConnector(DriverConfiguration configuration); @Override void close(); @Override TupleQueryResult executeSelectQuery(String query); @Override boolean executeBooleanQuery(String query); @Override void executeUpdate(String query); @Override List<Resource> getContexts(); @Override ValueFactory getValueFactory(); @Override void begin(); @Override void commit(); @Override void rollback(); @Override void addStatements(Collection<Statement> statements); @Override void removeStatements(Collection<Statement> statements); @Override Collection<Statement> findStatements(Resource subject, IRI property, Value value, boolean includeInferred); @Override Collection<Statement> findStatements(Resource subject, org.eclipse.rdf4j.model.IRI property,
                                                Value value, boolean includeInferred, IRI context); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred, IRI context); @Override T unwrap(Class<T> cls); void setRepository(Repository newRepository);  }
@Test void connectorIsAbleToConnectToAlreadyInitializedLocalNativeStorage() throws Exception { final String repoId = "repositoryTest"; final URI repoUri = URI .create("file: this.repositoryFolder = new File(getProjectRootPath() + File.separator + "repositories"); SailImplConfig backend = new NativeStoreConfig(); final SailRepositoryConfig repoType = new SailRepositoryConfig(backend); final RepositoryConfig config = new RepositoryConfig(repoId, repoType); final RepositoryManager repoManager = RepositoryProvider.getRepositoryManagerOfRepository(repoUri.toString()); repoManager.addRepositoryConfig(config); final Repository repo = repoManager.getRepository(repoId); final StorageConnector connector = new StorageConnector(TestUtils.createDriverConfig(repoUri.toString())); assertTrue(connector.isOpen()); connector.close(); }