|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface that must be implemented by lock management providers.
This provides the core operations used by Davenport to coordinate
locking of resources. A provider would implement this interface and
install a subclass of LockManagerFactory
to create instances
of the implementation.
Field Summary | |
static int |
EXCLUSIVE_LOCK_SUPPORT
Indicates that exclusive locking is supported for a given resource. |
static int |
NO_LOCK_SUPPORT
Indicates that no locking support is provided for a given resource. |
static int |
SHARED_LOCK_SUPPORT
Indicates that shared locking is supported for a given resource. |
Method Summary | |
Lock[] |
getActiveLocks(jcifs.smb.SmbFile resource)
Returns the set of active locks on the specified resource. |
jcifs.smb.SmbFile |
getLockedResource(jcifs.smb.SmbFile resource,
java.security.Principal principal)
Returns a handle for manipulating a locked SMB resource. |
int |
getLockSupport(jcifs.smb.SmbFile resource)
Retrieves the lock support mask for a specified resource. |
boolean |
isLocked(jcifs.smb.SmbFile resource,
java.lang.String lockToken)
Indicates whether the specified resource is locked under the provided lock token. |
java.lang.String |
lock(jcifs.smb.SmbFile resource,
java.security.Principal principal,
LockInfo lockInfo)
Locks the specified resource, using the provided lock information. |
void |
refresh(jcifs.smb.SmbFile resource,
java.security.Principal principal,
java.lang.String[] lockTokens,
long timeout)
Refreshes the locks represented by the provided lock tokens on the specified resource. |
void |
unlock(jcifs.smb.SmbFile resource,
java.security.Principal principal,
java.lang.String lockToken)
Removes the lock on the specified resource represented by the provided lock token. |
Field Detail |
public static final int NO_LOCK_SUPPORT
public static final int EXCLUSIVE_LOCK_SUPPORT
public static final int SHARED_LOCK_SUPPORT
Method Detail |
public int getLockSupport(jcifs.smb.SmbFile resource) throws java.io.IOException
resource
- The resource for which lock support is being
inspected.
int
representing the supported locks for
the specified resource. This value is the exclusive-OR of all
supported lock types.
java.io.IOException
- If an IO error occurs.public boolean isLocked(jcifs.smb.SmbFile resource, java.lang.String lockToken) throws java.io.IOException
resource
- The resource.lockToken
- The lock token.
boolean
indicating whether the lock token
provided represents an active lock on the specified resource.
java.io.IOException
- If an IO error occurs.public Lock[] getActiveLocks(jcifs.smb.SmbFile resource) throws java.io.IOException
resource
- The resource.
Lock[]
representing the set of all current
active locks held on the specified resource.
java.io.IOException
- If an IO error occurs.public jcifs.smb.SmbFile getLockedResource(jcifs.smb.SmbFile resource, java.security.Principal principal) throws java.io.IOException
SmbFile
instance for performing operations
against the resource. If such management is not required, this method
returns the resource passed in by the caller.
resource
- The resource for which the lock instance is to be
obtained.principal
- The requesting principal.
SmbFile
object used to perform
write and delete operations on the resource. If no special
resource management is required by this manager, this method returns
the resource passed in by the caller.
java.io.IOException
- If an IO error occurs.public java.lang.String lock(jcifs.smb.SmbFile resource, java.security.Principal principal, LockInfo lockInfo) throws LockException, java.io.IOException
resource
- The resource that will be locked.principal
- The principal requesting the lock.lockInfo
- Information regarding the lock that is to be applied.
String
containing the lock token that
was created as a result of this operation.
LockException
- If the lock could not be created.
java.io.IOException
- If an IO error occurs.public void refresh(jcifs.smb.SmbFile resource, java.security.Principal principal, java.lang.String[] lockTokens, long timeout) throws LockException, java.io.IOException
resource
- The resource whose locks will be refreshed.principal
- The principal requesting the lock refresh.lockTokens
- The set of lock tokens for the locks that are to
be refreshed.timeout
- The requested lock timeout value. This is a value in
milliseconds, or one of
SmbDAVUtilities.UNSPECIFIED_TIMEOUT
(if no timeout is
specified) or
SmbDAVUtilities.INFINITE_TIMEOUT
(if an infinite timeout
is requested).
LockException
- If the locks could not be refreshed.
java.io.IOException
- If an IO error occurs.public void unlock(jcifs.smb.SmbFile resource, java.security.Principal principal, java.lang.String lockToken) throws LockException, java.io.IOException
resource
- The resource whose lock is to be removed.principal
- The principal requesting the lock removal.lockToken
- The lock token representing the lock that is
to be removed.
LockException
- If the lock could not be removed.
java.io.IOException
- If an IO error occurs.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |