AnsweredAssumed Answered

Create JCR session from a ticket

Question asked by sam4alf on Jun 20, 2011
Hi all,

I'm trying to create a JCR session using a login ticket. Here is what I have so far:

SessionImpl session = new SessionImpl(new RepositoryImpl());
            session.init(loginTicket, "SpacesStore", new HashMap());

            if (session.isLive()) {
                System.out.println("Session created: " + session.getUserID());
            } else {
                System.out.println("Session is not live.");

            NodeImpl rootNode = (NodeImpl) session.getRootNode();
            System.out.println("Root node: path=" + rootNode.getPath() +
                ", type=" + rootNode.getPrimaryNodeType().getName());
            Node documentNode = (Node) session.getNodeByUUID(documentId);
            System.out.println("documentNode: " + documentNode.getUuid());

Somehow, it fails in creating session. I couldn't find any example on how to create this session. Any help is greatly appreciated.