01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-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; either
09: * version 2.1 of the License, or (at your option) any later version.
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.wfs;
17:
18: import java.util.Map;
19:
20: import org.geotools.data.FeatureLock;
21: import org.geotools.filter.Filter;
22:
23: /**
24: * DOCUMENT ME!
25: *
26: * @author dzwiers
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wfs/src/main/java/org/geotools/data/wfs/LockRequest.java $
28: */
29: public class LockRequest implements FeatureLock {
30: private long duration = 0;
31: private String[] types = null;
32: private Filter[] filters = null;
33: private String lockId = null;
34:
35: private LockRequest() {
36: // should not be used
37: }
38:
39: protected LockRequest(long duration, Map dataSets) {
40: this .duration = duration;
41: types = (String[]) dataSets.keySet().toArray(
42: new String[dataSets.size()]);
43: filters = new Filter[types.length];
44:
45: for (int i = 0; i < types.length; i++)
46: filters[i] = (Filter) dataSets.get(types[i]);
47: }
48:
49: protected LockRequest(long duration, String[] types,
50: Filter[] filters) {
51: this .duration = duration;
52: this .types = types;
53: this .filters = filters;
54: }
55:
56: /**
57: *
58: * @see org.geotools.data.FeatureLock#getAuthorization()
59: */
60: public String getAuthorization() {
61: return lockId;
62: }
63:
64: protected void setAuthorization(String auth) {
65: lockId = auth;
66: }
67:
68: /**
69: *
70: * @see org.geotools.data.FeatureLock#getDuration()
71: */
72: public long getDuration() {
73: return duration;
74: }
75:
76: /**
77: *
78: * @return Type Names
79: */
80: public String[] getTypeNames() {
81: return types;
82: }
83:
84: /**
85: *
86: * @return Filters
87: */
88: public Filter[] getFilters() {
89: return filters;
90: }
91: }
|