Package javax.jcr

Examples of javax.jcr.Session.refresh()


            ResourceProxy resource = newResource("/content", "nt:folder");

            AddOrUpdateNodeCommand cmd = new AddOrUpdateNodeCommand(repo, credentials, null, resource, logger);
            cmd.execute().get();

            session.refresh(false);

            content = session.getRootNode().getNode("content");
            assertThat(content.getPrimaryNodeType().getName(), equalTo("nt:folder"));

        } finally {
View Full Code Here


            resource.getProperties().put("attribute", "some value");

            AddOrUpdateNodeCommand cmd = new AddOrUpdateNodeCommand(repo, credentials, null, resource, logger);
            cmd.execute().get();

            session.refresh(false);

            content = session.getRootNode().getNode("content");
            assertThat(content.getPrimaryNodeType().getName(), equalTo("custom"));

        } finally {
View Full Code Here

            }

            ReorderChildNodesCommand cmd = new ReorderChildNodesCommand(repo, credentials, resource, logger);
            cmd.execute().get();

            session.refresh(false);

            finalOrder = new ArrayList<String>();

            NodeIterator nodes = session.getNode("/content").getNodes();
            while (nodes.hasNext()) {
View Full Code Here

            } catch (AccessControlException e) {
                // success
            }

            // latest after refresh privilege manager must be updated
            s2.refresh(true);
            Privilege priv = pm.getPrivilege(privName);
            assertEquals(privName, priv.getName());
            assertEquals(isAbstract, priv.isAbstract());
            assertFalse(priv.isAggregate());
        } finally {
View Full Code Here

        Node node = session.getNode("/");
        node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        session.refresh(true);
        Node sourceNode = session.getNode("/source/node");
        session.move("/source/node", "/target/moved");
        // assertEquals("/target/moved", sourceNode.getPath());  // passes on JR2, fails on Oak
        try {
            sourceNode.getPath();
View Full Code Here

            response.setError(e);

        } finally {
            try {
                if (session.hasPendingChanges()) {
                    session.refresh(false);
                }
            } catch (RepositoryException e) {
                log.warn("RepositoryException in finally block: {}",
                    e.getMessage(), e);
            }
View Full Code Here

        // Otherwise clean up the session if there are any pending changes.
        // Those changes are not persisted, but dropped. If this fails, the
        // session is logged out and not returned/added to the pool
        try {
            if (session.hasPendingChanges()) {
                session.refresh(false);
            }
        } catch (RepositoryException re) {
            log.info("Cannot check or drop pending changes of session " +
                "{}, logging out", userId);
            this.poolDropCounter++;
View Full Code Here

   }

   public Session getSession(String workspaceName) throws Exception
   {
      Session curSession = sessionFactory.getSession(workspaceName, ftpServer.getRepository());
      curSession.refresh(false);
      return curSession;
   }

   public String changePath(String resPath)
   {
View Full Code Here

            } catch (PathNotFoundException e) {
                // success
            }

            // revert all transient modifications
            rw.refresh(false);
            Property pAgain = (Property) rw.getItem(prop1Path);

            // TODO: for generic jsr 170 test: change assert to p.isSame(pAgain)
            assertSame(p, pAgain);
            assertEquals("string1", p.getString());
View Full Code Here

                    for (TxInfo i: removedIntermediates.values()) {
                        i.isIntermediate = 1;
                    }
                    removedIntermediates.clear();
                    processedInfos.clear();
                    session.refresh(false);
                }
            }
        }
        checkinNodes(session);
        applyMemberships(session);
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.