@Override public boolean isInitialized() { return rep.isInitialized(); }
public RdfResourceImporter(Repository repository, String baseUri, Resource...contexts){ if(repository == null){ throw new IllegalArgumentException("The parsed Repository MUST NOT be NULL"); } if(!repository.isInitialized()){ throw new IllegalStateException("The parsed Repository MUST BE initialised!"); } this.repository = repository; if(baseUri == null){ throw new IllegalArgumentException("The parsed base URI MUST NOT be NULL!"); } this.baseUri = baseUri; this.contexts = contexts; }
/** * Constructs a {@link RdfIndexingSource} for the parsed parameters. This * expects that {@link #setConfiguration(Map)} is not called * @param repository * @param contexts */ public RdfIndexingSource(Repository repository, Resource...contexts){ if(repository == null){ throw new IllegalArgumentException("The parsed Repository MUST NOT be NULL!"); } if(!repository.isInitialized()){ throw new IllegalStateException("Parsed Repository is not initialized"); } this.repository = repository; this.sesameFactory = repository.getValueFactory(); this.contexts = contexts; }
public static RepositoryConnection getConnection(Repository repository) throws SesameRepositoryFailure { Objects.requireNonNull(repository, "Repository cannot be null"); if(!repository.isInitialized()) { throw new IllegalStateException("Template support has been disposed"); } try { return repository.getConnection(); } catch(RepositoryException e) { throw new SesameRepositoryFailure(COULD_NOT_CONNECT_TO_THE_REPOSITORY,e); } }
RepositoryConnection getConnection() { if(!repository.isInitialized()) { throw new IllegalStateException("Template support has been disposed"); } try { return repository.getConnection(); } catch(RepositoryException e) { throw new QueryTemplateSupportFailure("Could not connect to the internal repository", e); } }
boolean dispose() { boolean result = true; if(repository.isInitialized()) { try { repository.shutDown(); } catch (RepositoryException e) { logDiscardedFailure("Could not shutdown repository", e); result=false; } } return result; }
if(!repository.isInitialized()) { repository.initialize();
throw new IllegalArgumentException("The parsed repository MUST NOT be NULL!"); if(!repo.isInitialized()){ throw new IllegalArgumentException("The parsed repository MUST BE initialised!");
public void initialize() { if (repository == null || !repository.isInitialized()) { try { repository = createRepository(sesameInference);