org.apache.webdav.lib

Class Lock


public class Lock
extends java.lang.Object

This class represents a lock on a resource.
Version:
$Revision: 1.3.2.1 $

Field Summary

static int
SCOPE_EXCLUSIVE
The exclusive constant in the lockscope.
static int
SCOPE_SHARED
The shared constant in the lockscope.
static String
TAG_NAME
The property name.
static int
TYPE_TRANSACTION
Type indicating lock is a transaction lock.
static int
TYPE_WRITE
The write constant in the locktype.
protected int
depth
protected int
lockScope
protected String
lockToken
protected int
lockType
protected String
owner
protected String
principalUrl
protected int
timeout

Constructor Summary

Lock(int lockScope, int lockType)
Default constructor for the lockentry.
Lock(int lockScope, int lockType, int depth, String owner, int timeout, String lockToken)
Default constructor for the activelock.
Lock(int lockScope, int lockType, int depth, String owner, int timeout, String lockToken, String principalUrl)
Lock(int lockScope, int lockType, int depth, String owner, long timeout, String lockToken)
Deprecated. The timeout value MUST NOT be greater than 2^32-1.

Method Summary

int
getDepth()
Get the value of the depth.
int
getLockScope()
Get whether a lock is an exclusive lock, or a shared lock.
String
getLockToken()
Get the access type of a lock.
int
getLockType()
Get the access type of a lock.
String
getOwner()
Get information about the principal taking out a lock.
String
getPrincipalUrl()
Get the principal-URL property of the lock, if one.
int
getTimeout()
Get the timeout associated with a lock.
String
toString()

Field Details

SCOPE_EXCLUSIVE

public static final int SCOPE_EXCLUSIVE
The exclusive constant in the lockscope.
Field Value:
0

SCOPE_SHARED

public static final int SCOPE_SHARED
The shared constant in the lockscope.
Field Value:
1

TAG_NAME

public static final String TAG_NAME
The property name.

TYPE_TRANSACTION

public static final int TYPE_TRANSACTION
Type indicating lock is a transaction lock.
Field Value:
1

TYPE_WRITE

public static final int TYPE_WRITE
The write constant in the locktype.
Field Value:
0

depth

protected int depth

lockScope

protected int lockScope

lockToken

protected String lockToken

lockType

protected int lockType

owner

protected String owner

principalUrl

protected String principalUrl

timeout

protected int timeout

Constructor Details

Lock

public Lock(int lockScope,
            int lockType)
Default constructor for the lockentry.

Lock

public Lock(int lockScope,
            int lockType,
            int depth,
            String owner,
            int timeout,
            String lockToken)
Default constructor for the activelock.

Lock

public Lock(int lockScope,
            int lockType,
            int depth,
            String owner,
            int timeout,
            String lockToken,
            String principalUrl)

Lock

public Lock(int lockScope,
            int lockType,
            int depth,
            String owner,
            long timeout,
            String lockToken)

Deprecated. The timeout value MUST NOT be greater than 2^32-1.

Default constructor for the activelock.

Method Details

getDepth

public int getDepth()
Get the value of the depth.
Returns:
The depth vlaue. If it's not set, it could be -1.

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.

getLockToken

public String getLockToken()
Get the access type of a lock.
Returns:
The lock token.

getLockType

public int getLockType()
Get the access type of a lock.
Returns:
The lock type. If it's not set, it could be -1.

getOwner

public String getOwner()
Get information about the principal taking out a lock.
Returns:
The owner.

getPrincipalUrl

public String getPrincipalUrl()
Get the principal-URL property 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.

toString

public String toString()