org.eclipse.rdf4j.repository.config.RepositoryConfigException Java Examples
The following examples show how to use
org.eclipse.rdf4j.repository.config.RepositoryConfigException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HTTPRepositoryConfig.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void parse(Model model, Resource implNode) throws RepositoryConfigException { super.parse(model, implNode); try { Models.objectIRI(model.getStatements(implNode, REPOSITORYURL, null)) .ifPresent(iri -> setURL(iri.stringValue())); Models.objectLiteral(model.getStatements(implNode, USERNAME, null)) .ifPresent(username -> setUsername(username.getLabel())); Models.objectLiteral(model.getStatements(implNode, PASSWORD, null)) .ifPresent(password -> setPassword(password.getLabel())); } catch (ModelException e) { throw new RepositoryConfigException(e.getMessage(), e); } }
Example #2
Source File: KnowledgeBaseServiceImpl.java From inception with Apache License 2.0 | 6 votes |
@Transactional @Override public void registerKnowledgeBase(KnowledgeBase aKB, RepositoryImplConfig aCfg) throws RepositoryException, RepositoryConfigException { // Obtain unique repository id String baseName = "pid-" + Long.toString(aKB.getProject().getId()) + "-kbid-"; String repositoryId = repoManager.getNewRepositoryID(baseName); aKB.setRepositoryId(repositoryId); // We want to have a separate Lucene index for every local repo, so we need to hack the // index dir in here because this is the place where we finally know the repo ID. setIndexDir(aKB, aCfg); repoManager.addRepositoryConfig(new RepositoryConfig(repositoryId, aCfg)); entityManager.persist(aKB); }
Example #3
Source File: TypeFilteringRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public Set<String> getRepositoryIDs() throws RepositoryException { Set<String> result = new LinkedHashSet<>(); for (String id : delegate.getRepositoryIDs()) { try { if (isCorrectType(id)) { result.add(id); } } catch (RepositoryConfigException e) { throw new RepositoryException(e); } } return result; }
Example #4
Source File: SystemRepository.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void initialize() throws RepositoryException { super.initialize(); try (RepositoryConnection con = getConnection()) { if (con.isEmpty()) { logger.debug("Initializing empty {} repository", ID); con.begin(); con.setNamespace("rdf", RDF.NAMESPACE); con.setNamespace("sys", RepositoryConfigSchema.NAMESPACE); con.commit(); RepositoryConfig repConfig = new RepositoryConfig(ID, TITLE, new SystemRepositoryConfig()); RepositoryConfigUtil.updateRepositoryConfigs(con, repConfig); } } catch (RepositoryConfigException e) { throw new RepositoryException(e.getMessage(), e); } }
Example #5
Source File: RemoteRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public boolean removeRepository(String repositoryID) throws RepositoryException, RepositoryConfigException { boolean existingRepo = hasRepositoryConfig(repositoryID); if (existingRepo) { try (RDF4JProtocolSession protocolSession = getSharedHttpClientSessionManager() .createRDF4JProtocolSession(serverURL)) { protocolSession.setUsernameAndPassword(username, password); protocolSession.deleteRepository(repositoryID); } catch (IOException e) { logger.warn("error while deleting remote repository", e); throw new RepositoryConfigException(e); } } return existingRepo; }
Example #6
Source File: ContextAwareFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public Repository getRepository(RepositoryImplConfig configuration) throws RepositoryConfigException { if (configuration instanceof ContextAwareConfig) { ContextAwareConfig config = (ContextAwareConfig) configuration; ContextAwareRepository repo = new ContextAwareRepository(); repo.setIncludeInferred(config.isIncludeInferred()); repo.setMaxQueryTime(config.getMaxQueryTime()); repo.setQueryLanguage(config.getQueryLanguage()); repo.setBaseURI(config.getBaseURI()); repo.setReadContexts(config.getReadContexts()); repo.setAddContexts(config.getAddContexts()); repo.setRemoveContexts(config.getRemoveContexts()); repo.setArchiveContexts(config.getArchiveContexts()); repo.setInsertContext(config.getInsertContext()); return repo; } throw new RepositoryConfigException("Invalid configuration class: " + configuration.getClass()); }
Example #7
Source File: TypeFilteringRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public Set<String> getInitializedRepositoryIDs() { Set<String> result = new LinkedHashSet<>(); for (String id : delegate.getInitializedRepositoryIDs()) { try { if (isCorrectType(id)) { result.add(id); } } catch (RepositoryConfigException | RepositoryException e) { logger.error("Failed to verify repository type", e); } } return result; }
Example #8
Source File: Drop.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Try to drop a repository after confirmation from user * * @param repoID repository ID * @throws IOException * @throws RepositoryException * @throws RepositoryConfigException */ private void dropRepository(final String repoID) throws IOException, RepositoryException, RepositoryConfigException { boolean proceed = askProceed("WARNING: you are about to drop repository '" + repoID + "'.", true); if (proceed && !state.getManager().isSafeToRemove(repoID)) { proceed = askProceed("WARNING: dropping this repository may break another that is proxying it.", false); } if (proceed) { if (repoID.equals(state.getRepositoryID())) { close.closeRepository(false); } final boolean isRemoved = state.getManager().removeRepository(repoID); if (isRemoved) { writeInfo("Dropped repository '" + repoID + "'"); } else { writeInfo("Unknown repository '" + repoID + "'"); } } else { writeln("Drop aborted"); } }
Example #9
Source File: Federate.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Validate members of a federation * * @param manager repository manager * @param readonly set to true if read-only repositories are OK * @param memberIDs IDs of the federated repositories * @return true when all members are present */ private boolean validateMembers(RepositoryManager manager, boolean readonly, Deque<String> memberIDs) { boolean result = true; try { for (String memberID : memberIDs) { if (manager.hasRepositoryConfig(memberID)) { if (!readonly) { if (!manager.getRepository(memberID).isWritable()) { result = false; writeError(memberID + " is read-only."); } } } else { result = false; writeError(memberID + " does not exist."); } } } catch (RepositoryException | RepositoryConfigException re) { writeError(re.getMessage()); } return result; }
Example #10
Source File: AbstractCommandTest.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/*** * Add a new repository to the manager. * * @param configStream input stream of the repository configuration * @return ID of the repository as string * @throws IOException * @throws RDF4JException */ protected String addRepository(InputStream configStream) throws IOException, RDF4JException { RDFParser rdfParser = Rio.createParser(RDFFormat.TURTLE, SimpleValueFactory.getInstance()); Model graph = new LinkedHashModel(); rdfParser.setRDFHandler(new StatementCollector(graph)); rdfParser.parse( new StringReader(IOUtil.readString(new InputStreamReader(configStream, StandardCharsets.UTF_8))), RepositoryConfigSchema.NAMESPACE); configStream.close(); Resource repositoryNode = Models.subject(graph.filter(null, RDF.TYPE, RepositoryConfigSchema.REPOSITORY)) .orElseThrow(() -> new RepositoryConfigException("could not find subject resource")); RepositoryConfig repoConfig = RepositoryConfig.create(graph, repositoryNode); repoConfig.validate(); manager.addRepositoryConfig(repoConfig); String repId = Models.objectLiteral(graph.filter(repositoryNode, RepositoryConfigSchema.REPOSITORYID, null)) .orElseThrow(() -> new RepositoryConfigException("missing repository id")) .stringValue(); return repId; }
Example #11
Source File: TypeFilteringRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public Collection<Repository> getInitializedRepositories() { List<Repository> result = new ArrayList<>(); for (String id : getInitializedRepositoryIDs()) { try { Repository repository = getRepository(id); if (repository != null) { result.add(repository); } } catch (RepositoryConfigException | RepositoryException e) { logger.error("Failed to verify repository type", e); } } return result; }
Example #12
Source File: TypeFilteringRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public RepositoryConfig getRepositoryConfig(String repositoryID) throws RepositoryConfigException, RepositoryException { RepositoryConfig result = delegate.getRepositoryConfig(repositoryID); if (result != null) { if (!isCorrectType(result)) { logger.debug( "Surpressing retrieval of repository {}: repository type {} did not match expected type {}", new Object[] { result.getID(), result.getRepositoryImplConfig().getType(), type }); result = null; } } return result; }
Example #13
Source File: KnowledgeBaseDetailsPanel.java From inception with Apache License 2.0 | 6 votes |
private void actionDelete(AjaxRequestTarget aTarget) { // delete only if user confirms deletion confirmationDialog .setTitleModel(new StringResourceModel("kb.details.delete.confirmation.title", this)); confirmationDialog.setContentModel( new StringResourceModel("kb.details.delete.confirmation.content", this, kbwModel.bind("kb"))); confirmationDialog.show(aTarget); confirmationDialog.setConfirmAction(_target -> { KnowledgeBase kb = kbwModel.getObject().getKb(); try { kbService.removeKnowledgeBase(kb); kbwModel.getObject().setKb(null); modelChanged(); } catch (RepositoryException | RepositoryConfigException e) { error("Unable to remove knowledge base: " + e.getLocalizedMessage()); log.error("Unable to remove knowledge base.", e); _target.addChildren(getPage(), IFeedback.class); } _target.add(this); _target.add(findParentWithAssociatedMarkup()); }); }
Example #14
Source File: RepositoryManagerFederator.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
private Value getMemberLocator(String identifier, String memberRepoType) throws MalformedURLException, RepositoryConfigException, RDF4JException { Value locator; if (HTTPRepositoryFactory.REPOSITORY_TYPE.equals(memberRepoType)) { locator = valueFactory.createIRI( ((HTTPRepositoryConfig) manager.getRepositoryConfig(identifier).getRepositoryImplConfig()) .getURL()); } else if (SPARQLRepositoryFactory.REPOSITORY_TYPE.equals(memberRepoType)) { locator = valueFactory.createIRI( ((SPARQLRepositoryConfig) manager.getRepositoryConfig(identifier).getRepositoryImplConfig()) .getQueryEndpointUrl()); } else { locator = valueFactory.createLiteral(identifier); } return locator; }
Example #15
Source File: RepositoryManagerFederator.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Adds a new repository to the {@link org.eclipse.rdf4j.repository.manager.RepositoryManager}, which is a * federation of the given repository id's, which must also refer to repositories already managed by the * {@link org.eclipse.rdf4j.repository.manager.RepositoryManager}. * * @param fedID the desired identifier for the new federation repository * @param description the desired description for the new federation repository * @param members the identifiers of the repositories to federate, which must already exist and be managed by * the {@link org.eclipse.rdf4j.repository.manager.RepositoryManager} * @param readonly whether the federation is read-only * @param distinct whether the federation enforces distinct results from its members * @throws MalformedURLException if the {@link org.eclipse.rdf4j.repository.manager.RepositoryManager} has a * malformed location * @throws RDF4JException if a problem otherwise occurs while creating the federation */ public void addFed(String fedID, String description, Collection<String> members, boolean readonly, boolean distinct) throws MalformedURLException, RDF4JException { if (members.contains(fedID)) { throw new RepositoryConfigException("A federation member may not have the same ID as the federation."); } Model graph = new LinkedHashModel(); BNode fedRepoNode = valueFactory.createBNode(); LOGGER.debug("Federation repository root node: {}", fedRepoNode); addToGraph(graph, fedRepoNode, RDF.TYPE, RepositoryConfigSchema.REPOSITORY); addToGraph(graph, fedRepoNode, RepositoryConfigSchema.REPOSITORYID, valueFactory.createLiteral(fedID)); addToGraph(graph, fedRepoNode, RDFS.LABEL, valueFactory.createLiteral(description)); addImplementation(members, graph, fedRepoNode, readonly, distinct); RepositoryConfig fedConfig = RepositoryConfig.create(graph, fedRepoNode); fedConfig.validate(); manager.addRepositoryConfig(fedConfig); }
Example #16
Source File: SailRepositoryConfig.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void parse(Model model, Resource repImplNode) throws RepositoryConfigException { try { Optional<Resource> sailImplNode = Models.objectResource(model.getStatements(repImplNode, SAILIMPL, null)); if (sailImplNode.isPresent()) { Models.objectLiteral(model.getStatements(sailImplNode.get(), SAILTYPE, null)).ifPresent(typeLit -> { SailFactory factory = SailRegistry.getInstance() .get(typeLit.getLabel()) .orElseThrow(() -> new RepositoryConfigException( "Unsupported Sail type: " + typeLit.getLabel())); sailImplConfig = factory.getConfig(); sailImplConfig.parse(model, sailImplNode.get()); }); } } catch (ModelException | SailConfigException e) { throw new RepositoryConfigException(e.getMessage(), e); } }
Example #17
Source File: SPARQLEmbeddedServer.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * @throws RepositoryException */ private void createTestRepositories() throws RepositoryException, RepositoryConfigException { RemoteRepositoryManager repoManager = RemoteRepositoryManager.getInstance(getServerUrl()); try { repoManager.init(); // create a memory store for each provided repository id for (String repId : repositoryIds) { MemoryStoreConfig memStoreConfig = new MemoryStoreConfig(); SailRepositoryConfig sailRepConfig = new ConfigurableSailRepositoryFactory.ConfigurableSailRepositoryConfig( memStoreConfig); RepositoryConfig repConfig = new RepositoryConfig(repId, sailRepConfig); repoManager.addRepositoryConfig(repConfig); } } finally { repoManager.shutDown(); } }
Example #18
Source File: TestProxyRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Test public final void testGetRepository() throws RDF4JException, IOException { Model graph = Rio.parse(this.getClass().getResourceAsStream("/proxy.ttl"), RepositoryConfigSchema.NAMESPACE, RDFFormat.TURTLE); RepositoryConfig config = RepositoryConfig.create(graph, Models.subject(graph.getStatements(null, RDF.TYPE, RepositoryConfigSchema.REPOSITORY)) .orElseThrow(() -> new RepositoryConfigException("missing Repository instance in config"))); config.validate(); assertThat(config.getID()).isEqualTo("proxy"); assertThat(config.getTitle()).isEqualTo("Test Proxy for 'memory'"); RepositoryImplConfig implConfig = config.getRepositoryImplConfig(); assertThat(implConfig.getType()).isEqualTo("openrdf:ProxyRepository"); assertThat(implConfig).isInstanceOf(ProxyRepositoryConfig.class); assertThat(((ProxyRepositoryConfig) implConfig).getProxiedRepositoryID()).isEqualTo("memory"); // Factory just needs a resolver instance to proceed with construction. // It doesn't actually invoke the resolver until the repository is // accessed. Normally LocalRepositoryManager is the caller of // getRepository(), and will have called this setter itself. ProxyRepository repository = (ProxyRepository) factory.getRepository(implConfig); repository.setRepositoryResolver(mock(RepositoryResolver.class)); assertThat(repository).isInstanceOf(ProxyRepository.class); }
Example #19
Source File: FedXRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException { if (!(config instanceof FedXRepositoryConfig)) { throw new RepositoryConfigException("Unexpected configuration type: " + config.getClass()); } FedXRepositoryConfig fedXConfig = (FedXRepositoryConfig) config; log.info("Configuring FedX for the RDF4J repository manager"); // wrap the FedX Repository in order to allow lazy initialization // => RDF4J repository manager requires control over the repository instance // Note: data dir is handled by RDF4J repository manager and used as a // base directory. return new FedXRepositoryWrapper(fedXConfig); }
Example #20
Source File: RepositoryProvider.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Creates a {@link RepositoryManager}, if not already created, that will be shutdown when the JVM exits cleanly. * * @param url location of the data directory for the RepositoryManager. This should be a URL of the form * http://host:port/path/ (for a RemoteRepositoryManager) or file:///path/ (for a * LocalRepositoryManager). * @return a (new or existing) {@link RepositoryManager} using the supplied url as its data dir. */ public static RepositoryManager getRepositoryManager(String url) throws RepositoryConfigException, RepositoryException { String uri = normalizeDirectory(url); SynchronizedManager sync = null; synchronized (managers) { Iterator<SynchronizedManager> iter = managers.values().iterator(); while (iter.hasNext()) { SynchronizedManager sm = iter.next(); if (!sm.isInitialized()) { sm.shutDown(); iter.remove(); } } if (managers.containsKey(uri)) { sync = managers.get(uri); } else { managers.put(uri, sync = new SynchronizedManager(url)); } } return sync.get(); }
Example #21
Source File: RepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Removes the configuration for the specified repository from the manager's system repository if such a * configuration is present. Returns <tt>true</tt> if the system repository actually contained the specified * repository configuration. * * @param repositoryID The ID of the repository whose configuration needs to be removed. * @throws RepositoryException If the manager failed to update it's system repository. * @throws RepositoryConfigException If the manager doesn't know how to remove a configuration due to inconsistent * configuration data in the system repository. For example, this happens when * there are multiple existing configurations with the concerning ID. * @deprecated since 2.0. Use {@link #removeRepository(String repositoryID)} instead. */ @Deprecated public boolean removeRepositoryConfig(String repositoryID) throws RepositoryException, RepositoryConfigException { logger.debug("Removing repository configuration for {}.", repositoryID); boolean isRemoved = hasRepositoryConfig(repositoryID); synchronized (initializedRepositories) { // update SYSTEM repository if there is one for 2.2 compatibility Repository systemRepository = getSystemRepository(); if (systemRepository != null) { RepositoryConfigUtil.removeRepositoryConfigs(systemRepository, repositoryID); } if (isRemoved) { logger.debug("Shutdown repository {} after removal of configuration.", repositoryID); Repository repository = initializedRepositories.remove(repositoryID); if (repository != null && repository.isInitialized()) { repository.shutDown(); } try { cleanUpRepository(repositoryID); } catch (IOException e) { throw new RepositoryException("Unable to clean up resources for removed repository " + repositoryID, e); } } } return isRemoved; }
Example #22
Source File: SailRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void addDelegate(SailImplConfig config, Sail sail) throws RepositoryConfigException, SailConfigException { Sail delegateSail = createSailStack(config); try { ((StackableSail) sail).setBaseSail(delegateSail); } catch (ClassCastException e) { throw new RepositoryConfigException( "Delegate configured but " + sail.getClass() + " is not a StackableSail"); } }
Example #23
Source File: SailRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
private Sail createSailStack(SailImplConfig config) throws RepositoryConfigException, SailConfigException { Sail sail = createSail(config); if (config instanceof DelegatingSailImplConfig) { SailImplConfig delegateConfig = ((DelegatingSailImplConfig) config).getDelegate(); if (delegateConfig != null) { addDelegate(delegateConfig, sail); } } return sail; }
Example #24
Source File: SailRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException { if (config instanceof SailRepositoryConfig) { SailRepositoryConfig sailRepConfig = (SailRepositoryConfig) config; try { Sail sail = createSailStack(sailRepConfig.getSailImplConfig()); return new SailRepository(sail); } catch (SailConfigException e) { throw new RepositoryConfigException(e.getMessage(), e); } } throw new RepositoryConfigException("Invalid configuration class: " + config.getClass()); }
Example #25
Source File: SailRepositoryConfig.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void validate() throws RepositoryConfigException { super.validate(); if (sailImplConfig == null) { throw new RepositoryConfigException("No Sail implementation specified for Sail repository"); } try { sailImplConfig.validate(); } catch (SailConfigException e) { throw new RepositoryConfigException(e.getMessage(), e); } }
Example #26
Source File: RemoteRepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void addRepositoryConfig(RepositoryConfig config) throws RepositoryException, RepositoryConfigException { try (RDF4JProtocolSession protocolSession = getSharedHttpClientSessionManager() .createRDF4JProtocolSession(serverURL)) { protocolSession.setUsernameAndPassword(username, password); int serverProtocolVersion = Integer.parseInt(protocolSession.getServerProtocol()); if (serverProtocolVersion < 9) { // explicit PUT create operation was introduced in Protocol version 9 String baseURI = Protocol.getRepositoryLocation(serverURL, config.getID()); Resource ctx = SimpleValueFactory.getInstance().createIRI(baseURI + "#" + config.getID()); protocolSession.setRepository(Protocol.getRepositoryLocation(serverURL, SystemRepository.ID)); Model model = getModelFactory().createEmptyModel(); config.export(model, ctx); ByteArrayOutputStream baos = new ByteArrayOutputStream(); Rio.write(model, baos, protocolSession.getPreferredRDFFormat()); removeRepository(config.getID()); try (InputStream contents = new ByteArrayInputStream(baos.toByteArray())) { protocolSession.upload(contents, baseURI, protocolSession.getPreferredRDFFormat(), false, true, ctx); } } else { if (hasRepositoryConfig(config.getID())) { protocolSession.updateRepository(config); } else { protocolSession.createRepository(config); } } } catch (IOException | QueryEvaluationException | UnauthorizedException | NumberFormatException e) { throw new RepositoryException(e); } }
Example #27
Source File: RepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Returns all configured repositories. This may be an expensive operation as it initializes repositories that have * not been initialized yet. * * @return The Set of all Repositories defined in the SystemRepository. * @see #getInitializedRepositories() */ public Collection<Repository> getAllRepositories() throws RepositoryConfigException, RepositoryException { Set<String> idSet = getRepositoryIDs(); ArrayList<Repository> result = new ArrayList<>(idSet.size()); for (String id : idSet) { result.add(getRepository(id)); } return result; }
Example #28
Source File: ProxyRepositoryFactory.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException { ProxyRepository result = null; if (config instanceof ProxyRepositoryConfig) { result = new ProxyRepository(((ProxyRepositoryConfig) config).getProxiedRepositoryID()); } else { throw new RepositoryConfigException("Invalid configuration class: " + config.getClass()); } return result; }
Example #29
Source File: SPARQLRepositoryConfig.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void validate() throws RepositoryConfigException { super.validate(); if (getQueryEndpointUrl() == null) { throw new RepositoryConfigException("No endpoint URL specified for SPARQL repository"); } }
Example #30
Source File: RepositoryManager.java From rdf4j with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Gets the repository that is known by the specified ID from this manager. * * @param identity A repository ID. * @return An initialized Repository object, or <tt>null</tt> if no repository was known for the specified ID. * @throws RepositoryConfigException If no repository could be created due to invalid or incomplete configuration * data. */ @Override public Repository getRepository(String identity) throws RepositoryConfigException, RepositoryException { synchronized (initializedRepositories) { updateInitializedRepositories(); Repository result = initializedRepositories.get(identity); if (result != null && !result.isInitialized()) { // repository exists but has been shut down. throw away the old // object so we can re-read from the config. initializedRepositories.remove(identity); result = null; } if (result == null && SystemRepository.ID.equals(identity)) { result = getSystemRepository(); } if (result == null) { // First call (or old object thrown away), create and initialize the // repository. result = createRepository(identity); if (result != null) { initializedRepositories.put(identity, result); } } return result; } }