Package javax.jcr

Examples of javax.jcr.Repository


     * @throws IOException
     */
    public void spool(OutputContext outputContext) throws IOException {
        if (outputContext.hasStream()) {
            Session session = getRepositorySession();
            Repository rep = session.getRepository();
            String repName = rep.getDescriptor(Repository.REP_NAME_DESC);
            String repURL = rep.getDescriptor(Repository.REP_VENDOR_URL_DESC);
            String repVersion = rep.getDescriptor(Repository.REP_VERSION_DESC);
            String repostr = repName + " " + repVersion;

            StringBuffer sb = new StringBuffer();
            sb.append("<html><head><title>");
            sb.append(repostr);
View Full Code Here


    }

    public void testGetAllNodeIds() throws Exception {
        Node root = testRootNode;
        Session session = root.getSession();
        Repository rep = session.getRepository();

        if (!(rep instanceof RepositoryImpl)) {
            log("Test skipped. Required repository class: "
                    + RepositoryImpl.class + " got: " + rep.getClass());
            return;
        }

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
View Full Code Here

    public Session getRepositorySession() throws JcrStorageException {
        if (session != null)
            return session;
        try {
            Repository repository = new TransientRepository();
            session = repository.login(new SimpleCredentials("xmpp-admin", "adminpassword".toCharArray()));
            return session;
        } catch (Exception e) {
            throw new JcrStorageException(e);
        }
    }
View Full Code Here

        session.save();
    }

    @Test
    public void createRepository() throws RepositoryException {
        Repository repository = getRepository();
        assertNotNull(repository);
    }
View Full Code Here

        assertEquals(42L, session.getAttribute(RepositoryImpl.REFRESH_INTERVAL));
    }

    @Test(expected = NoSuchWorkspaceException.class)
    public void loginInvalidWorkspace() throws RepositoryException {
        Repository repository = getRepository();
        repository.login(new GuestCredentials(), "invalid");
    }
View Full Code Here

            ServletHolder holder =
                    new ServletHolder(new OakServlet(repository));
            context.addServlet(holder, path + "/*");

            final Repository jcrRepository = jcr.createRepository();

            ServletHolder webdav =
                    new ServletHolder(new SimpleWebdavServlet() {
                        @Override
                        public Repository getRepository() {
View Full Code Here

     * not implement {@link ConsistencyChecker}, or if the associated
     * {@link Repository} is not a {@link RepositoryImpl}.
     */
    public static ConsistencyReport checkConsistency(Session session, boolean runFix)
            throws NotExecutableException, RepositoryException {
        Repository r = session.getRepository();
        if (!(r instanceof RepositoryImpl)) {
            throw new NotExecutableException();
        } else {
            RepositoryImpl ri = (RepositoryImpl) r;
            PersistenceManager pm = ri.getWorkspaceInfo(
View Full Code Here

     * not implement {@link ConsistencyChecker}, or if the associated
     * {@link Repository} is not a {@link RepositoryImpl}.
     */
    public static ConsistencyReport checkVersionStoreConsistency(Session session, boolean runFix)
            throws NotExecutableException, RepositoryException {
        Repository r = session.getRepository();
        if (!(r instanceof RepositoryImpl)) {
            throw new NotExecutableException();
        } else {
            RepositoryImpl ri = (RepositoryImpl) r;
            PersistenceManager pm = ri.getRepositoryContext()
View Full Code Here

     * @param parameters repository parameters
     * @return repository instance
     */
    public synchronized Repository createRepository(
            Map<String, String> parameters) throws RepositoryException {
        Repository repository = repositories.get(parameters);
        if (repository == null) {
            repository =  JcrUtils.getRepository(parameters);
            repositories.put(parameters, repository);
        }
        return repository;
View Full Code Here

     * @param configFile The path to the repository configuration file.
     */
    public synchronized void autoShutdownRepository(
            Map<String, String> parameters) {
        if (this.isAutoShutdown()) {
            Repository repository = repositories.get(parameters);
            if (repository instanceof JackrabbitRepository) {
                ((JackrabbitRepository) repository).shutdown();
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.jcr.Repository

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.