|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsmbdav.DefaultLockManager
Nested Class Summary | |
protected class |
DefaultLockManager.BasicLock
|
Field Summary | |
protected java.util.Map |
locks
|
protected static java.util.Timer |
TIMER
|
Fields inherited from interface smbdav.LockManager |
EXCLUSIVE_LOCK_SUPPORT, NO_LOCK_SUPPORT, SHARED_LOCK_SUPPORT |
Constructor Summary | |
DefaultLockManager()
|
|
DefaultLockManager(long defaultTimeout)
|
|
DefaultLockManager(long defaultTimeout,
long maximumTimeout)
|
Method Summary | |
protected DefaultLockManager.BasicLock |
createLock(jcifs.smb.SmbFile resource,
java.security.Principal principal,
java.lang.String lockToken,
LockInfo lockInfo)
|
Lock[] |
getActiveLocks(jcifs.smb.SmbFile resource)
Returns the set of active locks on the specified resource. |
long |
getDefaultTimeout()
|
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. |
long |
getMaximumTimeout()
|
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 |
setDefaultTimeout(long defaultTimeout)
|
void |
setMaximumTimeout(long maximumTimeout)
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.util.Timer TIMER
protected final java.util.Map locks
Constructor Detail |
public DefaultLockManager()
public DefaultLockManager(long defaultTimeout)
public DefaultLockManager(long defaultTimeout, long maximumTimeout)
Method Detail |
public long getDefaultTimeout()
public void setDefaultTimeout(long defaultTimeout)
public long getMaximumTimeout()
public void setMaximumTimeout(long maximumTimeout)
public int getLockSupport(jcifs.smb.SmbFile resource) throws java.io.IOException
LockManager
getLockSupport
in interface LockManager
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
LockManager
isLocked
in interface LockManager
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
LockManager
getActiveLocks
in interface LockManager
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
LockManager
SmbFile
instance for performing operations
against the resource. If such management is not required, this method
returns the resource passed in by the caller.
getLockedResource
in interface LockManager
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
LockManager
lock
in interface LockManager
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
LockManager
refresh
in interface LockManager
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).
java.io.IOException
- If an IO error occurs.
LockException
- If the locks could not be refreshed.public void unlock(jcifs.smb.SmbFile resource, java.security.Principal principal, java.lang.String lockToken) throws LockException, java.io.IOException
LockManager
unlock
in interface LockManager
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.
java.io.IOException
- If an IO error occurs.
LockException
- If the lock could not be removed.protected DefaultLockManager.BasicLock createLock(jcifs.smb.SmbFile resource, java.security.Principal principal, java.lang.String lockToken, LockInfo lockInfo) throws java.io.IOException, LockException
java.io.IOException
LockException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |