Package javax.jcr

Examples of javax.jcr.GuestCredentials


        this.repository = repository;
        this.batchReadConfig = batchReadConfig;
        this.supportsObservation = "true".equals(repository.getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED));

        try {
            Session s = repository.login(new GuestCredentials());
            ValueFactory vf = s.getValueFactory();
            if (vf instanceof ValueFactoryQImpl) {
                qValueFactory = ((ValueFactoryQImpl) vf).getQValueFactory();
            }
        } catch (RepositoryException e) {
View Full Code Here


    }

    @Test
    public void testGuestLogin() throws Exception {
        try {
            ContentSession sc = login(new GuestCredentials());
            sc.close();
            fail("Guest login must fail.");
        } catch (LoginException e) {
            // success
        }
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testGuestLogin() throws Exception {
        ContentSession cs = login(new GuestCredentials());
        assertEquals(UserConstants.DEFAULT_ANONYMOUS_ID, cs.getAuthInfo().getUserID());
        cs.close();
    }
View Full Code Here

    protected Session createAnonymousSession() throws RepositoryException {
        Session admin = getAdminSession();
        AccessControlUtils.addAccessControlEntry(admin, "/", EveryonePrincipal.getInstance(), new String[] {Privilege.JCR_READ}, true);
        admin.save();
        return getRepository().login(new GuestCredentials());
    }
View Full Code Here

        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

     * all the iterations of this test have been executed.
     *
     * @return reader session
     */
    protected Session loginAnonymous() {
        return login(new GuestCredentials());
    }
View Full Code Here

    }

    @Test
    public void loginWithAttribute() throws RepositoryException {
        Session session = ((JackrabbitRepository) getRepository()).login(
                new GuestCredentials(), null,
                Collections.<String, Object>singletonMap(RepositoryImpl.REFRESH_INTERVAL, 42));

        String[] attributeNames = session.getAttributeNames();
        assertEquals(1, attributeNames.length);
        assertEquals(RepositoryImpl.REFRESH_INTERVAL, attributeNames[0]);
View Full Code Here

    }

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

        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

    protected Session createAnonymousSession() throws RepositoryException {
        Session admin = getAdminSession();
        AccessControlUtils.addAccessControlEntry(admin, "/", EveryonePrincipal.getInstance(), new String[] {Privilege.JCR_READ}, true);
        admin.save();
        return getRepository().login(new GuestCredentials());
    }
View Full Code Here

TOP

Related Classes of javax.jcr.GuestCredentials

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.