org.deegree.feature.persistence.lock
Interface Lock


public interface Lock

Represents a lock of a LockManager.

Version:
$Revision: 20580 $, $Date: 2009-11-04 18:47:14 +0100 (Wed, 04 Nov 2009) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Method Summary
 CloseableIterator<String> getFailedToLockFeatures()
          Returns the ids of all features that have been requested to be locked, but which couldn't.
 String getId()
          Returns the lock identifier.
 CloseableIterator<String> getLockedFeatures()
          Returns the ids of all locked features.
 int getNumFailedToLock()
          Returns the number of features that have been requested to be locked, but which couldn't.
 int getNumLocked()
          Returns the number of locked features.
 boolean isLocked(String fid)
          Returns whether this Lock involves the specified feature.
 void release()
          Releases all locked features (invalidates the lock).
 void release(QName ftName, Filter filter)
          Releases the specified features from the lock.
 void release(String fid)
          Releases the specified feature from the lock (if it was locked).
 

Method Detail

getId

String getId()
Returns the lock identifier.

Returns:
the lock identifier

getNumLocked

int getNumLocked()
Returns the number of locked features.

Returns:
the number of locked features

getNumFailedToLock

int getNumFailedToLock()
Returns the number of features that have been requested to be locked, but which couldn't.

Returns:
the number of features that have been requested to be locked, but which couldn't

getLockedFeatures

CloseableIterator<String> getLockedFeatures()
                                            throws FeatureStoreException
Returns the ids of all locked features.

NOTE: The caller must invoke CloseableIterator.close() after it's not needed anymore -- otherwise, backing resources (such as database connections) may not be freed.

Returns:
an iterator for all locked feature ids
Throws:
FeatureStoreException

getFailedToLockFeatures

CloseableIterator<String> getFailedToLockFeatures()
                                                  throws FeatureStoreException
Returns the ids of all features that have been requested to be locked, but which couldn't.

NOTE: The caller must invoke CloseableIterator.close() after it's not needed anymore -- otherwise, backing resources (such as database connections) may not be freed.

Returns:
an iterator for all locked feature ids
Throws:
FeatureStoreException

isLocked

boolean isLocked(String fid)
                 throws FeatureStoreException
Returns whether this Lock involves the specified feature.

Parameters:
fid - id of the feature
Returns:
true, if the feature is involved, false otherwise
Throws:
FeatureStoreException

release

void release()
             throws FeatureStoreException
Releases all locked features (invalidates the lock).

Throws:
FeatureStoreException

release

void release(String fid)
             throws FeatureStoreException
Releases the specified feature from the lock (if it was locked).

Parameters:
fid - id of the feature
Throws:
FeatureStoreException

release

void release(QName ftName,
             Filter filter)
             throws FeatureStoreException
Releases the specified features from the lock.

Parameters:
ftName -
filter -
Throws:
FeatureStoreException


Copyright © 2011. All Rights Reserved.