Package javax.jcr

Examples of javax.jcr.Repository.login()


   
    @Override
    public void runTest() throws RepositoryException {
        Repository repository = getRepository();
        for (int i = 0; i < 1000; i++) {
            Session session = repository.login(getCredentials());
            try {
                session.getRootNode();
            } finally {
                session.logout();
            }
View Full Code Here


     * @param args command line arguments (ignored)
     * @throws Exception if an error occurs
     */
    public static void main(String[] args) throws Exception {
        Repository repository = new TransientRepository();
        Session session = repository.login();
        try {
            String user = session.getUserID();
            String name = repository.getDescriptor(Repository.REP_NAME_DESC);
            System.out.println(
                    "Logged in as " + user + " to a " + name + " repository.");
View Full Code Here

     * @param args command line arguments (ignored)
     * @throws Exception if an error occurs
     */
    public static void main(String[] args) throws Exception {
        Repository repository = new TransientRepository();
        Session session = repository.login(
                new SimpleCredentials("username", "password".toCharArray()));
        try {
            Node root = session.getRootNode();

            // Store content
View Full Code Here

                return repository.getDescriptor(key);
            }

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

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

                return repository.login(credentials, workspace);
            }

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

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

                    throws RepositoryException {
                return repository.login(credentials);
            }

            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

        Object cf = mcf.createConnectionFactory();
        assertTrue(cf instanceof JCARepositoryHandle);
        Repository repository = (Repository) cf;

        // Open a new session
        Session session = repository.login(JCR_SUPERUSER);
        assertTrue(session != null);
        assertTrue(session instanceof JCASessionHandle);

        // Logout session
        session.logout();
View Full Code Here

            throws Exception {
        synchronized (REPOSITORY_INSTANCES) {
            Repository repo = REPOSITORY_INSTANCES.get(dir);
            if (repo == null) {
                repo = createRepository(dir, xml);
                Session session = repo.login(superuser);
                try {
                    TestContentLoader loader = new TestContentLoader();
                    loader.loadTestContent(session);
                } finally {
                    session.logout();
View Full Code Here

        Object cf = mcf.createConnectionFactory();
        assertTrue(cf instanceof JCARepositoryHandle);
        Repository repository = (Repository) cf;

        // Open a new session
        Session session = repository.login(JCR_SUPERUSER);
        assertTrue(session != null);
        assertTrue(session instanceof JCASessionHandle);

        // Logout session
        session.logout();
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.