Interface RetentionManager
-
public interface RetentionManager
TheRetentionManager
object is accessed viaSession.getRetentionManager()
.- Since:
- JCR 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Hold
addHold(java.lang.String absPath, java.lang.String name, boolean isDeep)
Places a hold on the existing node atabsPath
.Hold[]
getHolds(java.lang.String absPath)
Returns all hold objects that have been added through this API to the existing node atabsPath
.RetentionPolicy
getRetentionPolicy(java.lang.String absPath)
Returns the retention policy that has been set usingsetRetentionPolicy(java.lang.String, javax.jcr.retention.RetentionPolicy)
on the node atabsPath
ornull
if no policy has been set.void
removeHold(java.lang.String absPath, Hold hold)
Removes the specifiedhold
from the node atabsPath
.void
removeRetentionPolicy(java.lang.String absPath)
Causes the current retention policy on the node atabsPath
to no longer apply.void
setRetentionPolicy(java.lang.String absPath, RetentionPolicy retentionPolicy)
Sets the retention policy of the node atabsPath
to that defined in the specified policy node.
-
-
-
Method Detail
-
getHolds
Hold[] getHolds(java.lang.String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException
Returns all hold objects that have been added through this API to the existing node atabsPath
. If no hold has been set before, this method returns an empty array.- 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 atabsPath
exists or the session does not have sufficent access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to retrieve the holds.RepositoryException
- if another error occurs.
-
addHold
Hold addHold(java.lang.String absPath, java.lang.String name, boolean isDeep) throws PathNotFoundException, AccessDeniedException, LockException, VersionException, RepositoryException
Places a hold on the existing node atabsPath
. IfisDeep
istrue
) the hold applies to this node and its subgraph. The hold does not take effect until asave
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
VersionException
will be thrown either immediately, on dispatch or on persists, if the node atabsPath
is read-only due to a checked-in node. Implementations may differ on when this validation is performed.A
LockException
will be thrown either immediately, on dispatch or on persists, if a lock prevents the operation. Implementations may differ on when this validation is performed.- Parameters:
absPath
- an absolute path.name
- an application-dependent string.isDeep
- a boolean indicating if the hold applies to the subgraph.- Returns:
- The
Hold
applied. - Throws:
PathNotFoundException
- if no node atabsPath
exists or the session does not have sufficient access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to perform the operation.LockException
- if a lock applies at the node atabsPath
and this implementation performs this validation immediately.VersionException
- if the node atabsPath
is read-only due to a checked-in node. and this implementation performs this validation immediately.RepositoryException
- if another error occurs.
-
removeHold
void removeHold(java.lang.String absPath, Hold hold) throws PathNotFoundException, AccessDeniedException, LockException, VersionException, RepositoryException
Removes the specifiedhold
from the node atabsPath
. The removal does not take effect until asave
is performed.A
VersionException
will be thrown either immediately, on dispatch or on persists, if the node atabsPath
is read-only due to a checked-in node. Implementations may differ on when this validation is performed.A
LockException
will be thrown either immediately, on dispatch or on persists, if a lock prevents the operation. Implementations may differ on when this validation is performed.- Parameters:
absPath
- an absolute path.hold
- the hold to be removed.- Throws:
PathNotFoundException
- if no node atabsPath
exists or the session does not have sufficient access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to perform the operation.LockException
- if a lock applies at the node atabsPath
and this implementation performs this validation immediately.VersionException
- if the node atabsPath
is read-only due to a checked-in node and this implementation performs this validation immediately.RepositoryException
- if another error occurs.
-
getRetentionPolicy
RetentionPolicy getRetentionPolicy(java.lang.String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException
Returns the retention policy that has been set usingsetRetentionPolicy(java.lang.String, javax.jcr.retention.RetentionPolicy)
on the node atabsPath
ornull
if no policy has been set.- Parameters:
absPath
- an absolute path to an existing node.- Returns:
- The retention policy that applies to the existing node at
absPath
ornull
if no policy applies. - Throws:
PathNotFoundException
- if no node atabsPath
exists or the session does not have sufficent access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to retrieve the policy.RepositoryException
- if another error occurs.
-
setRetentionPolicy
void setRetentionPolicy(java.lang.String absPath, RetentionPolicy retentionPolicy) throws PathNotFoundException, AccessDeniedException, LockException, VersionException, RepositoryException
Sets the retention policy of the node atabsPath
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 asave
is performed.A
VersionException
will be thrown either immediately, on dispatch or on persists, if the node atabsPath
is read-only due to a checked-in node. Implementations may differ on when this validation is performed.A
LockException
will be thrown either immediately, on dispatch or on persists, if a lock prevents the operation. Implementations may differ on when this validation is performed.- Parameters:
absPath
- an absolute path to an existing node.retentionPolicy
- a retention policy.- Throws:
PathNotFoundException
- if no node atabsPath
exists or the session does not have sufficient access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to perform the operation.LockException
- if a lock applies at the node atabsPath
and this implementation performs this validation immediately.VersionException
- if the node atabsPath
is read-only due to a checked-in node and this implementation performs this validation immediately.RepositoryException
- if another error occurs.
-
removeRetentionPolicy
void removeRetentionPolicy(java.lang.String absPath) throws PathNotFoundException, AccessDeniedException, LockException, VersionException, RepositoryException
Causes the current retention policy on the node atabsPath
to no longer apply. The removal does not take effect until asave
is performed.A
VersionException
will be thrown either immediately, on dispatch or on persists, if the node atabsPath
is read-only due to a checked-in node. Implementations may differ on when this validation is performed.A
LockException
will be thrown either immediately, on dispatch or on persists, if a lock prevents the operation. Implementations may differ on when this validation is performed.- Parameters:
absPath
- an absolute path to an existing node.- Throws:
PathNotFoundException
- if no node atabsPath
exists or the session does not have sufficient access to retrieve the node.AccessDeniedException
- if the current session does not have sufficient access to perform the operation.LockException
- if a lock applies at the node atabsPath
and this implementation performs this validation immediately.VersionException
- if the node atabsPath
is read-only due to a checked-in node and this implementation performs this validation immediately.RepositoryException
- if another error occurs.
-
-