Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.RepositoryImpl$DescriptorValue


        BlockingParser.block();
        SearchIndex index = getSearchIndex();
        File indexDir = new File(index.getPath());

        // shutdown workspace
        RepositoryImpl repo = (RepositoryImpl) session.getRepository();
        session.logout();
        session = null;
        superuser.logout();
        superuser = null;
        TestHelper.shutdownWorkspace(WORKSPACE_NAME, repo);
View Full Code Here


     * @param session the session that created this object
     * @param list the persistence managers
     * @param sessionList the sessions to access the workspaces
     */
    public GarbageCollector(SessionImpl session, IterablePersistenceManager[] list, Session[] sessionList) {
        RepositoryImpl rep = (RepositoryImpl) session.getRepository();
        store = rep.getDataStore();
        this.pmList = list;
        this.persistenceManagerScan = list != null;
        this.sessionList = sessionList;

        if (session != null) {
View Full Code Here

        File configuration = new File(directory, "repository.xml");

        try {
            RepositoryConfig config = RepositoryConfig.create(
                    configuration.getPath(), directory.getPath());
            RepositoryImpl repository = RepositoryImpl.create(config);
            try {
                Session session = repository.login(
                        new SimpleCredentials("admin", "admin".toCharArray()));
                try {
                    assertTestData(session);
                } finally {
                    session.logout();
                }
            } finally {
                repository.shutdown();
            }
        } catch (RepositoryException e) {
            String message = "Unable to access repository " + directory;
            log.error(message, e);
            fail(message);
View Full Code Here

    private void deleteAll() throws IOException {
        FileUtils.deleteDirectory(new File("./target/dbClusterTest"));
    }

    public void test() throws RepositoryException {
        RepositoryImpl rep1 = RepositoryImpl.create(RepositoryConfig.create(
                new File("./target/dbClusterTest/node1")));
        RepositoryImpl rep2 = RepositoryImpl.create(RepositoryConfig.create(
                new File("./target/dbClusterTest/node2")));
        Session s1 = rep1.login(new SimpleCredentials("admin", "admin".toCharArray()));
        Session s2 = rep2.login(new SimpleCredentials("admin", "admin".toCharArray()));
        s1.getRootNode().addNode("test1");
        s2.getRootNode().addNode("test2");
        s1.save();
        s2.save();
        s1.refresh(true);
        s2.refresh(true);
        s1.getRootNode().getNode("test2");
        s2.getRootNode().getNode("test1");
        rep1.shutdown();
        rep2.shutdown();
    }
View Full Code Here

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

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
        String[] names = new String[coll.size()];
        Iterator<WorkspaceConfig> wspIt = coll.iterator();
        for (int i = 0; wspIt.hasNext(); i++) {
            WorkspaceConfig wsc = (WorkspaceConfig) wspIt.next();
            names[i] = wsc.getName();
        }

        for (int i = 0; i < names.length && i < 1; i++) {
            Session s = getHelper().getSuperuserSession(names[i]);
            try {
                Method m = r.getClass().getDeclaredMethod("getWorkspaceInfo", new Class[] { String.class });
                m.setAccessible(true);
                Object info = m.invoke(r, names[i]);
                m = info.getClass().getDeclaredMethod("getPersistenceManager", new Class[0]);
                m.setAccessible(true);
                PersistenceManager pm = (PersistenceManager) m.invoke(info, new Object[0]);
View Full Code Here

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

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
        String[] names = new String[coll.size()];
        Iterator<WorkspaceConfig> wspIt = coll.iterator();
        for (int i = 0; wspIt.hasNext(); i++) {
            WorkspaceConfig wsc = wspIt.next();
            names[i] = wsc.getName();
        }

        for (int i = 0; i < names.length && i < 1; i++) {
            Session s = getHelper().getSuperuserSession(names[i]);
            try {
                Method m = r.getClass().getDeclaredMethod("getWorkspaceInfo", new Class[] { String.class });
                m.setAccessible(true);
                Object info = m.invoke(r, names[i]);
                m = info.getClass().getDeclaredMethod("getPersistenceManager", new Class[0]);
                m.setAccessible(true);
                PersistenceManager pm = (PersistenceManager) m.invoke(info, new Object[0]);
View Full Code Here

    private static void deleteAll() throws IOException {
        FileUtils.deleteDirectory(new File("./target/dbClusterTest"));
    }

    public void test() throws RepositoryException {
        RepositoryImpl rep1 = RepositoryImpl.create(RepositoryConfig.create(
                new File("./target/dbClusterTest/node1")));
        RepositoryImpl rep2 = RepositoryImpl.create(RepositoryConfig.create(
                new File("./target/dbClusterTest/node2")));
        Session s1 = rep1.login(new SimpleCredentials("admin", "admin".toCharArray()));
        Session s2 = rep2.login(new SimpleCredentials("admin", "admin".toCharArray()));

        s1.getRootNode().addNode("test1");
        s2.getRootNode().addNode("test2");
        s1.save();
        s2.save();
        s1.refresh(true);
        s2.refresh(true);

        s1.getRootNode().getNode("test2");
        s2.getRootNode().getNode("test1");
        rep1.shutdown();
        rep2.shutdown();
    }
View Full Code Here

        Node testFolder = testRootNode.addNode("folder", "nt:folder");
        int num = createFiles(testFolder, 10, 2, 0);
        session.save();

        // shutdown workspace
        RepositoryImpl repo = (RepositoryImpl) session.getRepository();
        session.logout();
        session = null;
        superuser.logout();
        superuser = null;
        TestHelper.shutdownWorkspace(getWorkspaceName(), repo);
View Full Code Here

        BlockingParser.block();
        SearchIndex index = getSearchIndex();
        File indexDir = new File(index.getPath());

        // shutdown workspace
        RepositoryImpl repo = (RepositoryImpl) session.getRepository();
        session.logout();
        session = null;
        superuser.logout();
        superuser = null;
        TestHelper.shutdownWorkspace(getWorkspaceName(), repo);
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        RepositoryImpl repo = (RepositoryImpl) superuser.getRepository();
        String wspName = repo.getConfig().getSecurityConfig().getSecurityManagerConfig().getWorkspaceName();

        s = getHelper().getSuperuserSession(wspName);
        provider = new UserAccessControlProvider();
        provider.init(s, Collections.emptyMap());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.RepositoryImpl$DescriptorValue

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.