Class DefaultLockableAmetysObject<F extends DefaultLockableAmetysObjectFactory>
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultLockableAmetysObject<F>
-
- Type Parameters:
F- the actual type of factory.
- All Implemented Interfaces:
ACLAmetysObject,AmetysObject,JCRAmetysObject,LockableAmetysObject,LockAwareAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,RemovableAmetysObject,DataAndVersionAwareAmetysObject,ModifiableDataAwareVersionableAmetysObject,VersionableAmetysObject,VersionAwareAmetysObject
public class DefaultLockableAmetysObject<F extends DefaultLockableAmetysObjectFactory> extends DefaultAmetysObject<F> implements LockableAmetysObject
DefaultAmetysObjectwhich is also aLockableAmetysObject.
-
-
Field Summary
-
Fields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
-
-
Constructor Summary
Constructors Constructor Description DefaultLockableAmetysObject(Node node, String parentPath, F factory)Creates anDefaultLockableAmetysObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserIdentitygetLockOwner()Returns the owner of the lock, or null if nonebooleanisLocked()Returns true if thisAmetysObjectis lockedvoidlock()Locks thisAmetysObjectvoidunlock()Unlocks thisAmetysObject-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, disallowInheritance, getAllLabels, getAllRevisions, getBaseNode, getBaseVersion, getLabels, getLabels, getNode, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, getRevision, getRevisionTimestamp, getRevisionTimestamp, getUnversionedDataHolder, getVersionHistory, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers, removeLabel, restoreFromLabel, restoreFromNode, restoreFromRevision, switchToLabel, switchToRevision
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
-
-
-
Constructor Detail
-
DefaultLockableAmetysObject
public DefaultLockableAmetysObject(Node node, String parentPath, F factory)
Creates anDefaultLockableAmetysObject.- Parameters:
node- the node backing thisAmetysObjectparentPath- the parentPath in the Ametys hierarchyfactory- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Detail
-
lock
public void lock() throws AmetysRepositoryException
Description copied from interface:LockableAmetysObjectLocks thisAmetysObject- Specified by:
lockin interfaceLockableAmetysObject- Throws:
AmetysRepositoryException- if a problem occurs
-
unlock
public void unlock() throws AmetysRepositoryException
Description copied from interface:LockableAmetysObjectUnlocks thisAmetysObject- Specified by:
unlockin interfaceLockableAmetysObject- Throws:
AmetysRepositoryException- if a problem occurs
-
isLocked
public boolean isLocked() throws AmetysRepositoryException
Description copied from interface:LockAwareAmetysObjectReturns true if thisAmetysObjectis locked- Specified by:
isLockedin interfaceLockAwareAmetysObject- Returns:
- true if this
AmetysObjectis locked - Throws:
AmetysRepositoryException- if a problem occurs
-
getLockOwner
public UserIdentity getLockOwner() throws AmetysRepositoryException
Description copied from interface:LockAwareAmetysObjectReturns the owner of the lock, or null if none- Specified by:
getLockOwnerin interfaceLockAwareAmetysObject- Returns:
- the owner of the lock, or null if none
- Throws:
AmetysRepositoryException- if a problem occurs
-
-