Package org.apache.webdav.lib
Class Lock
- java.lang.Object
-
- org.apache.webdav.lib.Lock
-
public class Lock extends java.lang.ObjectThis class represents a lock on a resource.- Version:
- $Revision: 1.3.2.1 $
-
-
Field Summary
Fields Modifier and Type Field Description protected intdepthprotected intlockScopeprotected java.lang.StringlockTokenprotected intlockTypeprotected java.lang.Stringownerprotected java.lang.StringprincipalUrlstatic intSCOPE_EXCLUSIVEThe exclusive constant in the lockscope.static intSCOPE_SHAREDThe shared constant in the lockscope.static java.lang.StringTAG_NAMEThe property name.protected inttimeoutstatic intTYPE_TRANSACTIONType indicating lock is a transaction lock.static intTYPE_WRITEThe write constant in the locktype.
-
Constructor Summary
Constructors Constructor Description Lock(int lockScope, int lockType)Default constructor for the lockentry.Lock(int lockScope, int lockType, int depth, java.lang.String owner, int timeout, java.lang.String lockToken)Default constructor for the activelock.Lock(int lockScope, int lockType, int depth, java.lang.String owner, int timeout, java.lang.String lockToken, java.lang.String principalUrl)Lock(int lockScope, int lockType, int depth, java.lang.String owner, long timeout, java.lang.String lockToken)Deprecated.The timeout value MUST NOT be greater than 2^32-1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDepth()Get the value of the depth.intgetLockScope()Get whether a lock is an exclusive lock, or a shared lock.java.lang.StringgetLockToken()Get the access type of a lock.intgetLockType()Get the access type of a lock.java.lang.StringgetOwner()Get information about the principal taking out a lock.java.lang.StringgetPrincipalUrl()Get theprincipal-URLproperty of the lock, if one.intgetTimeout()Get the timeout associated with a lock.java.lang.StringtoString()
-
-
-
Field Detail
-
TAG_NAME
public static final java.lang.String TAG_NAME
The property name.- See Also:
- Constant Field Values
-
TYPE_WRITE
public static final int TYPE_WRITE
The write constant in the locktype.- See Also:
- Constant Field Values
-
TYPE_TRANSACTION
public static final int TYPE_TRANSACTION
Type indicating lock is a transaction lock.- See Also:
- Constant Field Values
-
SCOPE_EXCLUSIVE
public static final int SCOPE_EXCLUSIVE
The exclusive constant in the lockscope.- See Also:
- Constant Field Values
-
SCOPE_SHARED
public static final int SCOPE_SHARED
The shared constant in the lockscope.- See Also:
- Constant Field Values
-
lockScope
protected int lockScope
-
lockType
protected int lockType
-
depth
protected int depth
-
owner
protected java.lang.String owner
-
timeout
protected int timeout
-
lockToken
protected java.lang.String lockToken
-
principalUrl
protected java.lang.String principalUrl
-
-
Constructor Detail
-
Lock
public Lock(int lockScope, int lockType)Default constructor for the lockentry.
-
Lock
public Lock(int lockScope, int lockType, int depth, java.lang.String owner, int timeout, java.lang.String lockToken)Default constructor for the activelock.
-
Lock
public Lock(int lockScope, int lockType, int depth, java.lang.String owner, int timeout, java.lang.String lockToken, java.lang.String principalUrl)
-
Lock
public Lock(int lockScope, int lockType, int depth, java.lang.String owner, long timeout, java.lang.String lockToken)Deprecated.The timeout value MUST NOT be greater than 2^32-1.Default constructor for the activelock.
-
-
Method Detail
-
getLockScope
public int getLockScope()
Get whether a lock is an exclusive lock, or a shared lock.- Returns:
- The lock scope. If it's not set, it could be -1.
-
getLockType
public int getLockType()
Get the access type of a lock.- Returns:
- The lock type. If it's not set, it could be -1.
-
getDepth
public int getDepth()
Get the value of the depth.- Returns:
- The depth vlaue. If it's not set, it could be -1.
-
getOwner
public java.lang.String getOwner()
Get information about the principal taking out a lock.- Returns:
- The owner.
-
getPrincipalUrl
public java.lang.String getPrincipalUrl()
Get theprincipal-URLproperty of the lock, if one.- Returns:
- an URL as String
-
getTimeout
public int getTimeout()
Get the timeout associated with a lock.- Returns:
- The timeout vlaue. If it's not set, it could be -1.
-
getLockToken
public java.lang.String getLockToken()
Get the access type of a lock.- Returns:
- The lock token.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-