Package org.apache.karaf.cave.server.api

Examples of org.apache.karaf.cave.server.api.CaveRepository


     */
    public synchronized CaveRepository create(String name, String location, boolean scan) throws Exception {
        if (repositories.get(name) != null) {
            throw new IllegalArgumentException("Cave repository " + name + " already exists");
        }
        CaveRepository repository = new CaveRepositoryImpl(name, location, scan);
        repositories.put(name, repository);
        save();
        return repository;
    }
View Full Code Here


     *
     * @param name the name of Cave repository to remove.
     * @throws Exception in case of remove failure.
     */
    public synchronized void uninstall(String name) throws Exception {
        CaveRepository repository = this.getRepository(name);
        if (repository == null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        repositoryAdmin.removeRepository(repository.getRepositoryXml().toString());
        save();
    }
View Full Code Here

     * Remove a Cave repository from the repositories registry.
     * @param name the name of the repository.
     * @throws Exception
     */
    public synchronized void remove(String name) throws Exception {
        CaveRepository repository = this.getRepository(name);
        if (repository == null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        repositories.remove(name);
    }
View Full Code Here

     *
     * @param name the name of the repository.
     * @throws Exception
     */
    public synchronized void destroy(String name) throws Exception {
        CaveRepository repository = this.getRepository(name);
        if (repository == null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        repositories.remove(name);
        repository.cleanup();
    }
View Full Code Here

     *
     * @param name the name of the Cave repository.
     * @throws Exception in case of registration failure.
     */
    public synchronized void install(String name) throws Exception {
        CaveRepository caveRepository = this.getRepository(name);
        if (caveRepository == null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        repositoryAdmin.addRepository(caveRepository.getRepositoryXml());
    }
View Full Code Here

            }
            for (int i = 0; i < count; i++) {
                String name = storage.getProperty("item." + i + ".name");
                String location = storage.getProperty("item." + i + ".location");
                if (name != null) {
                    CaveRepository repository = new CaveRepositoryImpl(name, location, false);
                    repositories.put(name, repository);
                }
            }
        } catch (Exception e) {
            LOGGER.warn("Unable to load Cave repositories", e);
View Full Code Here

                ServiceReference caveRepositoryServiceReference = bundleContext.getServiceReference(CaveRepositoryService.class.getName());
                if (caveRepositoryServiceReference != null) {
                    CaveRepositoryService caveRepositoryService = (CaveRepositoryService) bundleContext.getService(caveRepositoryServiceReference);
                    if (caveRepositoryService != null) {
                        CaveRepository caveRepository = caveRepositoryService.getRepository(caveRepositoryName);
                        if (caveRepository != null) {
                            url = caveRepository.getRepositoryXml();
                            response.setContentType("text/xml");
                        }
                    }
                    bundleContext.ungetService(caveRepositoryServiceReference);
                }
View Full Code Here

        if (location != null) {
            getCaveRepositoryService().create(name, location, false);
        } else {
            getCaveRepositoryService().create(name, false);
        }
        CaveRepository caveRepository = getCaveRepositoryService().getRepository(name);
        if (generateObr) {
            caveRepository.scan();
        }
        if (install) {
            getCaveRepositoryService().install(name);
        }
    }
View Full Code Here

    public void populateRepository(String name, String url, boolean generateObr, String filter) throws Exception {
        if (getCaveRepositoryService().getRepository(name) != null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        CaveRepository repository = getCaveRepositoryService().getRepository(name);
        repository.populate(new URL(url), filter, generateObr);
        if (generateObr) {
            getCaveRepositoryService().install(name);
        }
    }
View Full Code Here

    public void proxyRepository(String name, String url, boolean generateObr, String filter) throws Exception {
        if (getCaveRepositoryService().getRepository(name) != null) {
            throw new IllegalArgumentException("Cave repository " + name + " doesn't exist");
        }
        CaveRepository repository = getCaveRepositoryService().getRepository(name);
        repository.proxy(new URL(url), filter);
        if (generateObr) {
            getCaveRepositoryService().install(name);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.cave.server.api.CaveRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.