org.apache.jackrabbit.core.retention
Class RetentionManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.ProtectedItemModifier
      extended by org.apache.jackrabbit.core.retention.RetentionManagerImpl
All Implemented Interfaces:
RetentionManager

public class RetentionManagerImpl
extends ProtectedItemModifier
implements RetentionManager

RetentionManagerImpl...


Constructor Summary
RetentionManagerImpl(SessionImpl session)
           
 
Method Summary
 Hold addHold(String absPath, String name, boolean isDeep)
          Places a hold on the existing node at absPath.
 Hold[] getHolds(String absPath)
          Returns all hold objects that have been added through this API to the existing node at absPath.
 RetentionPolicy getRetentionPolicy(String absPath)
          Returns the retention policy that has been set using RetentionManager.setRetentionPolicy(java.lang.String, org.apache.jackrabbit.api.jsr283.retention.RetentionPolicy) on the node at absPath or null if no policy has been set.
 void removeHold(String absPath, Hold hold)
          Removes the specified hold from the node at absPath.
 void removeRetentionPolicy(String absPath)
          Causes the current retention policy on the node at absPath to no longer apply.
 void setRetentionPolicy(String absPath, RetentionPolicy retentionPolicy)
          Sets the retention policy of the node at absPath to that defined in the specified policy node.
 
Methods inherited from class org.apache.jackrabbit.core.ProtectedItemModifier
addNode, removeItem, setProperty, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetentionManagerImpl

public RetentionManagerImpl(SessionImpl session)
Parameters:
session - The editing session.
Method Detail

getHolds

public Hold[] getHolds(String absPath)
                throws PathNotFoundException,
                       AccessDeniedException,
                       RepositoryException
Description copied from interface: RetentionManager
Returns all hold objects that have been added through this API to the existing node at absPath. If no hold has been set before, this method returns an empty array.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to retrieve the holds.

A RepositoryException is thrown if another error occurs.

Specified by:
getHolds in interface RetentionManager
Parameters:
absPath - an absolute path.
Returns:
All hold objects that have been added to the existing node at absPath through this API or an empty array if no hold has been set.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to retrieve the holds.
RepositoryException - if another error occurs.
See Also:
RetentionManager.getHolds(String)

addHold

public Hold addHold(String absPath,
                    String name,
                    boolean isDeep)
             throws PathNotFoundException,
                    AccessDeniedException,
                    LockException,
                    VersionException,
                    RepositoryException
Description copied from interface: RetentionManager
Places a hold on the existing node at absPath. If isDeep is true) the hold applies to this node and its subtree. The hold does not take effect until a save is performed. A node may have more than one hold.

The format and interpretation of the name are not specified. They are application-dependent.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to perform the operation.

An LockException is thrown if the node at absPath is locked and this implementation performs this validation immediately instead of waiting until save.

An VersionException is thrown if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.

A RepositoryException is thrown if another error occurs.

Specified by:
addHold in interface RetentionManager
Parameters:
absPath - an absolute path.
name - an application-dependent string.
isDeep - a boolean indicating if the hold applies to the subtree.
Returns:
The Hold applied.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to perform the operation.
LockException - if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save.
VersionException - if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.
RepositoryException - if another error occurs.
See Also:
RetentionManager.addHold(String, String, boolean)

removeHold

public void removeHold(String absPath,
                       Hold hold)
                throws PathNotFoundException,
                       AccessDeniedException,
                       LockException,
                       VersionException,
                       RepositoryException
Description copied from interface: RetentionManager
Removes the specified hold from the node at absPath. The removal does not take effect until a save is performed.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to perform the operation.

An LockException is thrown if the node at absPath is locked and this implementation performs this validation immediately instead of waiting until save.

An VersionException is thrown if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.

A RepositoryException is thrown if another error occurs.

Specified by:
removeHold in interface RetentionManager
Parameters:
absPath - an absolute path.
hold - the hold to be removed.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to perform the operation.
LockException - if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save.
VersionException - if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.
RepositoryException - if another error occurs.
See Also:
RetentionManager.removeHold(String, Hold)

getRetentionPolicy

public RetentionPolicy getRetentionPolicy(String absPath)
                                   throws PathNotFoundException,
                                          AccessDeniedException,
                                          RepositoryException
Description copied from interface: RetentionManager
Returns the retention policy that has been set using RetentionManager.setRetentionPolicy(java.lang.String, org.apache.jackrabbit.api.jsr283.retention.RetentionPolicy) on the node at absPath or null if no policy has been set.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to retrieve the retention policy.

A RepositoryException is thrown if another error occurs.

Specified by:
getRetentionPolicy in interface RetentionManager
Parameters:
absPath - an absolute path to an existing node.
Returns:
The retention policy that applies to the existing node at absPath or null if no policy applies.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to retrieve the policy.
RepositoryException - if another error occurs.
See Also:
RetentionManager.getRetentionPolicy(String)

setRetentionPolicy

public void setRetentionPolicy(String absPath,
                               RetentionPolicy retentionPolicy)
                        throws PathNotFoundException,
                               AccessDeniedException,
                               LockException,
                               VersionException,
                               RepositoryException
Description copied from interface: RetentionManager
Sets the retention policy of the node at absPath to that defined in the specified policy node. Interpretation and enforcement of this policy is an implementation issue. In any case the policy does does not take effect until a save is performed.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to perform the operation.

An LockException is thrown if the node at absPath is locked and this implementation performs this validation immediately instead of waiting until save.

An VersionException is thrown if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.

A RepositoryException is thrown if another error occurs.

Specified by:
setRetentionPolicy in interface RetentionManager
Parameters:
absPath - an absolute path to an existing node.
retentionPolicy - a retention policy.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to perform the operation.
LockException - if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save.
VersionException - if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.
RepositoryException - if another error occurs.
See Also:
RetentionManager.setRetentionPolicy(String, RetentionPolicy)

removeRetentionPolicy

public void removeRetentionPolicy(String absPath)
                           throws PathNotFoundException,
                                  AccessDeniedException,
                                  LockException,
                                  VersionException,
                                  RepositoryException
Description copied from interface: RetentionManager
Causes the current retention policy on the node at absPath to no longer apply. The removal does not take effect until a save is performed.

A PathNotFoundException is thrown if no node at absPath exists or the session does not have privilege to retrieve the node.

An AccessDeniedException is thrown if the current session does not have sufficient rights to perform the operation.

An LockException is thrown if the node at absPath is locked and this implementation performs this validation immediately instead of waiting until save.

An VersionException is thrown if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.

A RepositoryException is thrown if another error occurs.

Specified by:
removeRetentionPolicy in interface RetentionManager
Parameters:
absPath - an absolute path to an existing node.
Throws:
PathNotFoundException - if no node at absPath exists or the session does not have privilege to retrieve the node.
AccessDeniedException - if the current session does not have sufficient rights to perform the operation.
LockException - if a lock applies at the node at absPath and this implementation performs this validation immediately instead of waiting until save.
VersionException - if the node at absPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in and this implementation performs this validation immediately instead of waiting until save.
RepositoryException - if another error occurs.
See Also:
RetentionManager.removeRetentionPolicy(String)


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.