public interface Lock
Classes that implement this interface represent WebDAV Class 2 hierarchy items. To create WebDAV Class 2 compliant server you must implement this interface on your file items and folder items.
| Modifier and Type | Method and Description |
|---|---|
List<LockInfo> |
getActiveLocks()
Gets the array of all locks for this item.
|
LockResult |
lock(boolean shared,
boolean deep,
long timeout,
String owner)
Locks this item.
|
RefreshLockResult |
refreshLock(String token,
long timeout)
Updates lock timeout information on this item.
|
void |
unlock(String lockToken)
Removes lock with the specified token from this item.
|
List<LockInfo> getActiveLocks() throws ServerException
This method must return all locks for the item including deep locks on any of the parent folders.
All fields of each LockInfo structure in the array must be set.
ServerException - In case of an error.
<<<< getActiveLocksImpl >>>>LockResult lock(boolean shared, boolean deep, long timeout, String owner) throws LockedException, MultistatusException, ServerException
In your Lock implementation you must generate lock token and create LockResult class instance.
You must also associate generated token with the hierarchy item in your repository during this call.
The token is sent to the WebDAV client.
shared - Indicates whether a lock is shared or exclusive.deep - Indicates whether a lock is enforceable on the subtree.timeout - Lock expiration time in seconds. Negative value means never.owner - Provides information about the principal taking out a lock.LockedException - The item is locked, so the method has been rejected.MultistatusException - Errors have occured during processing of the subtree.ServerException - In case of an error
<<<< lockImpl >>>>RefreshLockResult refreshLock(String token, long timeout) throws PreconditionFailedException, ServerException
token - The lock token associated with a lock.timeout - Lock expiration time in seconds. Negative value means never.PreconditionFailedException - Included lock token was not enforceable on this item.ServerException - In case of an error.
<<<< refreshLockImpl >>>>void unlock(String lockToken) throws PreconditionFailedException, ServerException
If this lock included more than one hierarchy item, the lock is removed from all items included in the lock.
lockToken - Lock with this token should be removed from the item.PreconditionFailedException - Included lock token was not enforceable on this item.ServerException - In case of an error.
<<<< unlockImpl >>>>Copyright © ITHit. All Rights Reserved.