Package javax.jcr

Examples of javax.jcr.Repository.login()


        Repository r3 = new Jcr(mk3).createRepository();
        repos.add(r3);

        Session s1 = r1.login(new SimpleCredentials("admin", "admin".toCharArray()));
        Session s2 = r2.login(new SimpleCredentials("admin", "admin".toCharArray()));
        Session s3 = r3.login(new SimpleCredentials("admin", "admin".toCharArray()));

        ensureIndex(s1.getRootNode(), PROP_NAME);
        syncMKs(1);
        ensureIndex(s2.getRootNode(), PROP_NAME);
        ensureIndex(s3.getRootNode(), PROP_NAME);
View Full Code Here


        repos.add(r1);
        Repository r2 = new Jcr(mk2).createRepository();
        repos.add(r2);

        Session s1 = r1.login(new SimpleCredentials("admin", "admin".toCharArray()));
        Session s2 = r2.login(new SimpleCredentials("admin", "admin".toCharArray()));

        Node root1 = s1.getRootNode().addNode("session-1");
        s1.save();
        Node root2 = s2.getRootNode().addNode("session-2");
        s2.save();
View Full Code Here

    }

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

    @Ignore("OAK-118") // TODO OAK-118: implement workspace management
    @Test
    public void getWorkspaceNames() throws RepositoryException {
View Full Code Here

    }

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

    @Ignore("WIP") // TODO implement workspace management
    @Test
    public void getWorkspaceNames() throws RepositoryException {
View Full Code Here

    }

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

    @Ignore("OAK-118") // TODO OAK-118: implement workspace management
    @Test
    public void getWorkspaceNames() throws RepositoryException {
View Full Code Here

            }

        }) {

            public Session login(String workspace) throws RepositoryException {
                return repository.login(superuser, workspace);
            }

            public Session login() throws RepositoryException {
                return repository.login(superuser);
            }
View Full Code Here

            public Session login(String workspace) throws RepositoryException {
                return repository.login(superuser, workspace);
            }

            public Session login() throws RepositoryException {
                return repository.login(superuser);
            }

        };
    }
View Full Code Here

    public boolean isAuthentic(String userid, CharSequence passwd) {
        Repository repos = repository.getRepository();
        try {
            // Try to log in the Repository with the user and password. If this success we can asume that the user/pass is valid. In
            // all cases we need to logout again to not bind two JCR Session per thread later
            Session session = repos.login(new SimpleCredentials(userid,passwd.toString().toCharArray()), repository.getWorkspace());
            session.logout();
            return true;
        } catch (RepositoryException e) {
            return false;
        }
View Full Code Here

                    Context initialContext = new InitialContext();
                    Repository repository = (Repository)initialContext.lookup(WIDGET_REPOSITORY_JNDI_REPOSITORY_FULL_NAME);
                   
                    // create and login JCR session
                    Credentials credentials = new SimpleCredentials(repositoryUser, repositoryPassword.toCharArray());
                    Session session = ((repositoryWorkspace != null) ? repository.login(credentials, repositoryWorkspace) : repository.login(credentials));
                   
                    // return session object content manager for session
                    return new SessionObjectContentManagerImpl(session, new AnnotationMapperImpl(CLASS_LIST));
                }
View Full Code Here

                    Context initialContext = new InitialContext();
                    Repository repository = (Repository)initialContext.lookup(WIDGET_REPOSITORY_JNDI_REPOSITORY_FULL_NAME);
                   
                    // create and login JCR session
                    Credentials credentials = new SimpleCredentials(repositoryUser, repositoryPassword.toCharArray());
                    Session session = ((repositoryWorkspace != null) ? repository.login(credentials, repositoryWorkspace) : repository.login(credentials));
                   
                    // return session object content manager for session
                    return new SessionObjectContentManagerImpl(session, new AnnotationMapperImpl(CLASS_LIST));
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.