Examples of RetentionPolicy


Examples of javax.jcr.retention.RetentionPolicy

            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();
                    }
                }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    protected void tearDown() throws Exception {
        if (otherS != null) {
            otherS.logout();
        }
        superuser.refresh(false);
        RetentionPolicy rp = retentionMgr.getRetentionPolicy(testNodePath);
        if (rp != null) {
            retentionMgr.removeRetentionPolicy(testNodePath);
            superuser.save();
        }
        super.tearDown();
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    /**
     * Creates a node with a RetentionPolicy
     */
    private void addRetentionTestData(Node node) throws RepositoryException {
        RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy", node.getSession());
        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    protected void setUp() throws Exception {
        super.setUp();

        // make sure there is no retention policy defined at testNodePath.
        RetentionPolicy p = retentionMgr.getRetentionPolicy(testNodePath);
        if (p != null) {
            retentionMgr.removeRetentionPolicy(testNodePath);
            superuser.save();
        }
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    }
   
    public void testGetRetentionPolicy() throws RepositoryException, NotExecutableException {
        retentionMgr.setRetentionPolicy(testNodePath, getApplicableRetentionPolicy());
       
        RetentionPolicy policy = retentionMgr.getRetentionPolicy(testNodePath);
        assertNotNull("RetentionManager.getRetentionPolicy must return the policy set before.", policy);
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

        assertNull("RetentionManager.getRetentionPolicy called on child must not return the policy set before.",
                retentionMgr.getRetentionPolicy(childPath));
    }

    public void testRetentionPolicyGetName() throws RepositoryException, NotExecutableException {
        RetentionPolicy p = getApplicableRetentionPolicy();
        retentionMgr.setRetentionPolicy(testNodePath, p);

        RetentionPolicy policy = retentionMgr.getRetentionPolicy(testNodePath);
        assertEquals("RetentionPolicy.getName() must match the name of the policy set before.", p.getName(), policy.getName());
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

        }
    }

    public void testInvalidName() {
        try {
            RetentionPolicy rp = new RetentionPolicy() {
                public String getName() throws RepositoryException {
                    return "*.[y]";
                }
            };
            retentionMgr.setRetentionPolicy(testNodePath, rp);
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            throw new IllegalStateException("Not initialized.");
        }
        if (retentionCnt <= 0) {
            return false;
        }
        RetentionPolicy rp = null;
        PathMap.Element<RetentionPolicyImpl> element = retentionMap.map(nodePath, true);
        if (element != null) {
            rp = element.get();
        }
        if (rp == null && checkParent) {
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            PathNotFoundException, AccessDeniedException, RepositoryException {

        NodeImpl n = (NodeImpl) session.getNode(absPath);
        session.getAccessManager().checkPermission(session.getQPath(absPath), Permission.RETENTION_MNGMT);

        RetentionPolicy rPolicy = null;
        if (n.isNodeType(REP_RETENTION_MANAGEABLE) && n.hasProperty(REP_RETENTION_POLICY)) {
            String jcrName = n.getProperty(REP_RETENTION_POLICY).getString();
            rPolicy = new RetentionPolicyImpl(jcrName, n.getNodeId(), session);
        }
       
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            throw new IllegalStateException("Not initialized.");
        }
        if (retentionCnt <= 0) {
            return false;
        }
        RetentionPolicy rp = null;
        PathMap.Element<RetentionPolicyImpl> element = retentionMap.map(nodePath, true);
        if (element != null) {
            rp = element.get();
        }
        if (rp == null && checkParent) {
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.