Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.ContentRepository.login()


                final ContentRepository repository = rcb.getContentRepository();
                systemSession = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
                    @Override
                    public ContentSession run() throws LoginException, NoSuchWorkspaceException {
                        return repository.login(null, rcb.getWorkspaceName());
                    }
                });
                root = systemSession.getLatestRoot();
            } catch (UnsupportedCallbackException e) {
                log.debug(e.getMessage());
View Full Code Here


                final ContentRepository repository = rcb.getContentRepository();
                systemSession = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
                    @Override
                    public ContentSession run() throws LoginException, NoSuchWorkspaceException {
                        return repository.login(null, rcb.getWorkspaceName());
                    }
                });
                root = systemSession.getLatestRoot();
            } catch (UnsupportedCallbackException e) {
                log.debug(e.getMessage());
View Full Code Here

                .createContentRepository();

        ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
            @Override
            public ContentSession run() throws Exception {
                return repo.login(null, null);
            }
        });
        try {
            Root root = cs.getLatestRoot();
            UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
View Full Code Here

        }

        // login as admin should fail
        ContentSession adminSession = null;
        try {
            adminSession = repo.login(new SimpleCredentials("admin", new char[0]), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (adminSession != null) {
View Full Code Here

                .createContentRepository();

        ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
            @Override
            public ContentSession run() throws Exception {
                return repo.login(null, null);
            }
        });
        try {
            Root root = cs.getLatestRoot();
            UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
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

                .createContentRepository();

        ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
            @Override
            public ContentSession run() throws Exception {
                return repo.login(null, null);
            }
        });
        try {
            Root root = cs.getLatestRoot();
            UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
View Full Code Here

        }

        // login as admin should fail
        ContentSession adminSession = null;
        try {
            adminSession = repo.login(new SimpleCredentials("admin", new char[0]), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (adminSession != null) {
View Full Code Here

                .createContentRepository();

        ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
            @Override
            public ContentSession run() throws Exception {
                return repo.login(null, null);
            }
        });
        try {
            Root root = cs.getLatestRoot();
            UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
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

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.