01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data;
17:
18: /**
19: * Used to lock features when used with LockingDataSource.
20: *
21: * <p>
22: * A FeatureLockFactory is used to generate FeatureLocks.
23: * </p>
24: *
25: * <p>
26: * A FeatureLock representing the Current Transaction has been provided.
27: * </p>
28: * <h2>
29: *
30: * <p>
31: * Jody - I have a slightly more consistent specification of this idea in
32: * GeoAPI that should be ported back over.
33: * </p>
34: *
35: * @author Jody Garnett, Refractions Research, Inc.
36: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/data/FeatureLock.java $
37: * @version $Id: FeatureLock.java 20562 2006-07-16 14:54:53Z jgarnett $
38: *
39: * @see <a
40: * href="http://vwfs.refractions.net/docs/Database_Research.pdf">Database
41: * Reseach</a>
42: * @see <a
43: * href="http://vwfs.refractions.net/docs/Transactional_WFS_Design.pdf">Transactional
44: * WFS Design</a>
45: * @see <a
46: * href="http://vwfs.refractions.net/docs/Design_Implications.pdf">Design
47: * Implications</a>
48: * @see FeatureLockFactory
49: */
50: public interface FeatureLock {
51: /**
52: * FeatureLock representing Transaction duration locking
53: *
54: * <p>
55: * When this FeatureLock is used locks are expected to last until the
56: * current Transasction ends with a commit() or rollback().
57: * </p>
58: */
59: public static final FeatureLock TRANSACTION = new CurrentTransactionLock();
60:
61: /**
62: * LockId used for transaction authorization.
63: *
64: * @return A string of the LockId.
65: */
66: String getAuthorization();
67:
68: /**
69: * Time from now the lock will expire
70: *
71: * @return A long of the time till the lock expires.
72: */
73: long getDuration();
74: }
|