Examples of RetentionManager


Examples of javax.jcr.retention.RetentionManager

        // do a 'rollback'
        s.refresh(false);
        Node root = s.getRootNode();
        Node testRootNode;
       
        RetentionManager rm;
        try {
            rm = s.getRetentionManager();
        } catch (UnsupportedRepositoryOperationException ex) {
            rm = null;
        }
       
        if (root.hasNode(testPath)) {
            // clean test root
            testRootNode = root.getNode(testPath);
            for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
                Node child = children.nextNode();

                // Remove retention policy if needed
                if (rm != null) {
                    RetentionPolicy pol = rm.getRetentionPolicy(child.getPath());
                    if (pol != null) {
                        rm.removeRetentionPolicy(child.getPath());
                        s.save();
                    }
                }
               
                NodeDefinition nodeDef = child.getDefinition();
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        // do a 'rollback'
        s.refresh(false);
        Node root = s.getRootNode();
        Node testRootNode;
       
        RetentionManager rm;
        try {
            rm = s.getRetentionManager();
        } catch (UnsupportedRepositoryOperationException ex) {
            rm = null;
        }
       
        if (root.hasNode(testPath)) {
            // clean test root
            testRootNode = root.getNode(testPath);
            for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
                Node child = children.nextNode();

                // Remove retention policy if needed
                if (rm != null) {
                    RetentionPolicy pol = rm.getRetentionPolicy(child.getPath());
                    if (pol != null) {
                        rm.removeRetentionPolicy(child.getPath());
                        s.save();
                    }
                }
               
                NodeDefinition nodeDef = child.getDefinition();
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        // do a 'rollback'
        s.refresh(false);
        Node root = s.getRootNode();
        Node testRootNode;
       
        RetentionManager rm;
        try {
            rm = s.getRetentionManager();
        } catch (UnsupportedRepositoryOperationException ex) {
            rm = null;
        }
       
        if (root.hasNode(testPath)) {
            // clean test root
            testRootNode = root.getNode(testPath);
            for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
                Node child = children.nextNode();

                // Remove retention policy if needed
                if (rm != null) {
                    RetentionPolicy pol = rm.getRetentionPolicy(child.getPath());
                    if (pol != null) {
                        rm.removeRetentionPolicy(child.getPath());
                        s.save();
                    }
                }
               
                NodeDefinition nodeDef = child.getDefinition();
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

    }

    public void testReadOnlySession() throws NotExecutableException, RepositoryException {
        Session s = helper.getReadOnlySession();
        try {
            RetentionManager rmgr = getRetentionManager(s);
            try {
                rmgr.getRetentionPolicy(testNodePath);
                fail("Read-only session doesn't have sufficient privileges to retrieve retention policy.");
            } catch (AccessDeniedException e) {
                // success
            }
            try {
                rmgr.setRetentionPolicy(testNodePath, getApplicableRetentionPolicy());
                fail("Read-only session doesn't have sufficient privileges to retrieve retention policy.");
            } catch (AccessDeniedException e) {
                // success
            }
        } finally {
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        String childPath = getLockedChildNode().getPath();

        // get another session.
        Session otherS = helper.getSuperuserSession();
        try {
            RetentionManager rmgr = getRetentionManager(otherS);
            rmgr.setRetentionPolicy(childPath, getApplicableRetentionPolicy());
            otherS.save();

            fail("Setting a retention policy on a locked node must throw LockException.");
        } catch (LockException e) {
            // success
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        retentionMgr.setRetentionPolicy(childPath, getApplicableRetentionPolicy());
        testRootNode.save();

        Session otherS = helper.getSuperuserSession();
        try {
            RetentionManager rmgr = getRetentionManager(otherS);
            rmgr.removeRetentionPolicy(childPath);
            fail("Removing a retention policy on a locked node must throw LockException.");
        } catch (LockException e) {
            // success
        } finally {
            otherS.logout();
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        String childPath = child.getPath();

        // get another session.
        Session otherS = helper.getSuperuserSession();
        try {
            RetentionManager rmgr = getRetentionManager(otherS);
            rmgr.setRetentionPolicy(childPath, getApplicableRetentionPolicy());
            otherS.save();

            fail("Setting a retention policy on a checked-in node must throw VersionException.");
        } catch (VersionException e) {
            // success
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        superuser.save();
        child.checkin();

        Session otherS = helper.getSuperuserSession();
        try {
            RetentionManager rmgr = getRetentionManager(otherS);
            rmgr.removeRetentionPolicy(child.getPath());
            otherS.save();
            fail("Removing a retention policy on a checked-in node must throw VersionException.");
        } catch (VersionException e) {
            // success
        } finally {
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

    }

    public void testReadOnlySession() throws NotExecutableException, RepositoryException {
        javax.jcr.Session s = helper.getReadOnlySession();
        try {
            RetentionManager rmgr = getRetentionManager(s);
            try {
                rmgr.getHolds(testNodePath);
                fail("Read-only session doesn't have sufficient privileges to retrieve holds.");
            } catch (AccessDeniedException e) {
                // success
            }
            try {
                rmgr.addHold(testNodePath, getHoldName(), false);
                fail("Read-only session doesn't have sufficient privileges to retrieve holds.");
            } catch (AccessDeniedException e) {
                // success
            }
        } finally {
View Full Code Here

Examples of javax.jcr.retention.RetentionManager

        List holdsBefore = Arrays.asList(retentionMgr.getHolds(child.getPath()));

        // get another session.
        javax.jcr.Session otherS = helper.getSuperuserSession();
        try {
            RetentionManager rmgr = getRetentionManager(otherS);           
            rmgr.addHold(child.getPath(), getHoldName(), false);
            otherS.save();

            fail("Adding hold on a locked node must throw LockException.");
        } catch (LockException e) {
            // success
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.