Package org.apache.jackrabbit.core.retention

Examples of org.apache.jackrabbit.core.retention.RetentionRegistry


                            + ": colliding with same-named existing node");
                }
            }
        }

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if ((options & CHECK_HOLD) == CHECK_HOLD) {
            if (retentionReg.hasEffectiveHold(parentPath, false)) {
                throw new RepositoryException("Unable to add node. Parent is affected by a hold.");
            }
        }
        if ((options & CHECK_RETENTION) == CHECK_RETENTION) {
            if (retentionReg.hasEffectiveRetention(parentPath, false)) {
                throw new RepositoryException("Unable to add node. Parent is affected by a retention.");
            }
        }
    }
View Full Code Here


                    }
                }
            }
        }

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if ((options & CHECK_HOLD) == CHECK_HOLD) {
            if (retentionReg.hasEffectiveHold(targetPath, true)) {
                throw new RepositoryException("Unable to perform removal. Node is affected by a hold.");
            }
        }
        if ((options & CHECK_RETENTION) == CHECK_RETENTION) {
            if (retentionReg.hasEffectiveRetention(targetPath, true)) {
                throw new RepositoryException("Unable to perform removal. Node is affected by a retention.");
            }
        }
    }
View Full Code Here

        verifyNotProtected(nodePath);

        // versioning status
        verifyCheckedOut(nodePath);

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if (retentionReg.hasEffectiveHold(nodePath, false)) {
            throw new RepositoryException("Unable to write. Node is affected by a hold.");
        }
        if (retentionReg.hasEffectiveRetention(nodePath, false)) {
            throw new RepositoryException("Unable to write. Node is affected by a retention.");
        }
    }
View Full Code Here

                            + ": colliding with same-named existing node");
                }
            }
        }

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if ((options & CHECK_HOLD) == CHECK_HOLD) {
            if (retentionReg.hasEffectiveHold(parentPath, false)) {
                throw new RepositoryException("Unable to add node. Parent is affected by a hold.");
            }
        }
        if ((options & CHECK_RETENTION) == CHECK_RETENTION) {
            if (retentionReg.hasEffectiveRetention(parentPath, false)) {
                throw new RepositoryException("Unable to add node. Parent is affected by a retention.");
            }
        }
    }
View Full Code Here

                    }
                }
            }
        }

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if ((options & CHECK_HOLD) == CHECK_HOLD) {
            if (retentionReg.hasEffectiveHold(targetPath, true)) {
                throw new RepositoryException("Unable to perform removal. Node is affected by a hold.");
            }
        }
        if ((options & CHECK_RETENTION) == CHECK_RETENTION) {
            if (retentionReg.hasEffectiveRetention(targetPath, true)) {
                throw new RepositoryException("Unable to perform removal. Node is affected by a retention.");
            }
        }
    }
View Full Code Here

        verifyNotProtected(nodePath);

        // versioning status
        verifyCheckedOut(nodePath);

        RetentionRegistry retentionReg =
            context.getSessionImpl().getRetentionRegistry();
        if (retentionReg.hasEffectiveHold(nodePath, false)) {
            throw new RepositoryException("Unable to write. Node is affected by a hold.");
        }
        if (retentionReg.hasEffectiveRetention(nodePath, false)) {
            throw new RepositoryException("Unable to write. Node is affected by a retention.");
        }
    }
View Full Code Here

        }
    }

    public void testRemoveHold() throws RepositoryException {
        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
        RetentionRegistry re = s.getRetentionRegistry();
        try {
            Hold[] holds = retentionMgr.getHolds(childNPath);
            for (int i = 0; i < holds.length; i++) {
                retentionMgr.removeHold(childNPath, holds[i]);
                // hold must still be in effect.
                assertTrue(re.hasEffectiveHold(s.getQPath(childNPath), false));
            }
            superuser.save();
           
            assertFalse(re.hasEffectiveHold(s.getQPath(childNPath), false));

        } finally {
            s.logout();
        }
    }
View Full Code Here

        }
    }

    public void testRemoveRetentionPolicy() throws RepositoryException {
        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
        RetentionRegistry re = s.getRetentionRegistry();
        try {
            retentionMgr.removeRetentionPolicy(childNPath);
            // retention must still be in effect.
            assertTrue(re.hasEffectiveRetention(s.getQPath(childNPath), false));

            superuser.save();

            assertFalse(re.hasEffectiveRetention(s.getQPath(childNPath), false));

        } finally {
            s.logout();
        }
    }
View Full Code Here

        }
    }

    public void testAddHold() throws RepositoryException, NotExecutableException {
        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
        RetentionRegistry re = s.getRetentionRegistry();
        Hold h = null;
        try {
            h = retentionMgr.addHold(childN2.getPath(), getHoldName(), false);
            // hold must not be effective yet
            assertFalse(re.hasEffectiveHold(s.getQPath(childN2.getPath()), false));

            superuser.save();
            assertTrue(re.hasEffectiveHold(s.getQPath(childN2.getPath()), false));

        } finally {
            s.logout();

            if (h != null) {
View Full Code Here

        }
    }

    public void testAddMultipleHold() throws RepositoryException, NotExecutableException {
        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
        RetentionRegistry re = s.getRetentionRegistry();
        try {
            retentionMgr.addHold(childN2.getPath(), getHoldName(), false);
            superuser.save();

            // hold is not deep -> only applies to childN2
            assertTrue(re.hasEffectiveHold(s.getQPath(childN2.getPath()), false));
            assertFalse(re.hasEffectiveHold(s.getQPath(childN2.getPath() + "/child"), false));

            retentionMgr.addHold(childN2.getPath(), getHoldName(), true);
            superuser.save();

            // now deep hold must be taken into account
            assertTrue(re.hasEffectiveHold(s.getQPath(childN2.getPath()), false));
            assertTrue(re.hasEffectiveHold(s.getQPath(childN2.getPath() + "/child"), false));

        } finally {
            s.logout();

            Hold[] hdls = retentionMgr.getHolds(childN2.getPath());
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.retention.RetentionRegistry

Copyright © 2018 www.massapicom. 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.