Package javax.jcr

Examples of javax.jcr.GuestCredentials


                    if (sharedObj == null || !(sharedObj instanceof Set)) {
                        sharedCredentials = new HashSet<Credentials>();
                    } else {
                        sharedCredentials = (Set) sharedObj;
                    }
                    guestCredentials = new GuestCredentials();
                    sharedCredentials.add(guestCredentials);
                    sharedState.put(LoginModuleImpl.SHARED_KEY_CREDENTIALS, sharedCredentials);
                    return true;
                }
            } catch (IOException e) {
View Full Code Here


    protected Property getProperty(String path) throws RepositoryException {
        return getSession().getProperty(path);
    }

    protected Session createAnonymousSession() throws RepositoryException {
        return getRepository().login(new GuestCredentials());
    }
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

    @Override
    protected void service(
            HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            ContentSession session = repository.login(new GuestCredentials(), null);
            try {
                Root root = session.getCurrentRoot();
                Tree tree = root.getTree(request.getPathInfo());
                request.setAttribute("root", root);
                request.setAttribute("tree", tree);
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

    private Session guest;

    protected void setUp() throws Exception {
        super.setUp();
        guest = helper.getRepository().login(new GuestCredentials());
    }
View Full Code Here

        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

        }

        // login as admin should fail
        ContentSession anonymousSession = null;
        try {
            anonymousSession = repo.login(new GuestCredentials(), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (anonymousSession != null) {
View Full Code Here

    }

    @Test
    public void testMkDirWithAnonymousSession() throws Exception {
        Session session = repository.login(new GuestCredentials());
        JcrPackageManagerImpl jcrPackageManager = new JcrPackageManagerImpl(session);
        jcrPackageManager.mkdir("/something/that/is/not/going/to/be/found/anywhere/in/this/repository/even/if/searching/in/very/long/paths/like/this", false);
        jcrPackageManager.mkdir("/something/that/is/not/going/to/be/found/anywhere/in/this/repository/even/if/searching/in/very/long/paths/like/this", false);
        jcrPackageManager.mkdir("/something/that/is/not/going/to/be/found/anywhere/in/this/repository/even/if/searching/in/very/long/paths/like/this", false);
    }
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.