svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / feature / spi / FeatureStoreProviderServices.java @ 43020
History | View | Annotate | Download (4.92 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | *
|
||
11 | * This program 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
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | |||
25 | package org.gvsig.fmap.dal.feature.spi; |
||
26 | |||
27 | import java.util.List; |
||
28 | |||
29 | import org.gvsig.fmap.dal.DataManager; |
||
30 | import org.gvsig.fmap.dal.exception.DataException; |
||
31 | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
||
32 | import org.gvsig.fmap.dal.feature.Feature; |
||
33 | import org.gvsig.fmap.dal.feature.FeatureSelection; |
||
34 | import org.gvsig.fmap.dal.feature.FeatureStore; |
||
35 | import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
||
36 | import org.gvsig.fmap.dal.feature.FeatureType; |
||
37 | import org.gvsig.fmap.dal.resource.Resource; |
||
38 | import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
||
39 | |||
40 | /**
|
||
41 | * Interface of Services for feature based data providers
|
||
42 | *
|
||
43 | * @author jmvivo
|
||
44 | *
|
||
45 | */
|
||
46 | public interface FeatureStoreProviderServices extends |
||
47 | DataStoreProviderServices { |
||
48 | |||
49 | /**
|
||
50 | * Call this to send a notification to observers of this store
|
||
51 | *
|
||
52 | * @param notification
|
||
53 | */
|
||
54 | public void notifyChange(String notification); |
||
55 | |||
56 | /**
|
||
57 | * Call this to send a notification to observers of this store
|
||
58 | *
|
||
59 | * @param notification
|
||
60 | */
|
||
61 | public void notifyChange(String notification, FeatureProvider data); |
||
62 | |||
63 | /**
|
||
64 | * Call this to send a notification to observers of this store
|
||
65 | *
|
||
66 | * @param notification
|
||
67 | */
|
||
68 | public void notifyChange(FeatureStoreNotification storeNotification); |
||
69 | |||
70 | /**
|
||
71 | * Call this to send a notification to observers of this store relative to
|
||
72 | * Resources
|
||
73 | *
|
||
74 | * @param notification
|
||
75 | */
|
||
76 | public void notifyChange(String notification, Resource resource); |
||
77 | |||
78 | /**
|
||
79 | * Create a new instance of default implementation of a
|
||
80 | * {@link FeatureSelection}
|
||
81 | *
|
||
82 | * @return new {@link FeatureSelection}
|
||
83 | * @throws DataException
|
||
84 | */
|
||
85 | public FeatureSelection createDefaultFeatureSelection()
|
||
86 | throws DataException;
|
||
87 | |||
88 | /**
|
||
89 | * Create a new instance of default implementation of a {@link FeatureProvider}
|
||
90 | *
|
||
91 | * @return new {@link FeatureProvider}
|
||
92 | * @throws DataException
|
||
93 | */
|
||
94 | public FeatureProvider createDefaultFeatureProvider(FeatureType type)
|
||
95 | throws DataException;
|
||
96 | |||
97 | /**
|
||
98 | * Sets {@link FeatureType} available from this store.<br>
|
||
99 | *
|
||
100 | * <strong>Note:</strong> <code>defaultType</code> must be in
|
||
101 | * <code>types</code>
|
||
102 | *
|
||
103 | * @param list
|
||
104 | * of all {@link FeatureType} available
|
||
105 | * @param {@link FeatureType} used in
|
||
106 | * {@link FeatureStore#getDefaultFeatureType()}
|
||
107 | */
|
||
108 | public void setFeatureTypes(List types, FeatureType defaultType); |
||
109 | |||
110 | /**
|
||
111 | * Reaturn {@link DataManager} instance.
|
||
112 | *
|
||
113 | * @return
|
||
114 | */
|
||
115 | public DataManager getManager();
|
||
116 | |||
117 | /**
|
||
118 | * Create a {@link Feature} instance for {@link FeatureProvider}
|
||
119 | * <code>data</code>
|
||
120 | *
|
||
121 | * <br>
|
||
122 | * <br>
|
||
123 | * <strong>NOTE:</strong> Normaly <strong> Providers must use</strong>
|
||
124 | * {@link FeatureProvider} instances instead Feature
|
||
125 | *
|
||
126 | * @param data
|
||
127 | * @return a {@link Feature}
|
||
128 | * @throws DataException
|
||
129 | */
|
||
130 | public Feature createFeature(FeatureProvider data)
|
||
131 | throws DataException;
|
||
132 | |||
133 | /**
|
||
134 | * Creates a new instance of EditableFeatureType. Uses 'default' as
|
||
135 | * identifier.
|
||
136 | *
|
||
137 | * @return
|
||
138 | */
|
||
139 | public EditableFeatureType createFeatureType();
|
||
140 | |||
141 | /**
|
||
142 | * Creates a new instance of EditableFeatureType. Uses 'id' as identifier.
|
||
143 | *
|
||
144 | * @return
|
||
145 | */
|
||
146 | public EditableFeatureType createFeatureType(String id); |
||
147 | |||
148 | /**
|
||
149 | * Return the instance of {@link FeatureStoreProvider} for this store.
|
||
150 | *
|
||
151 | * @return
|
||
152 | */
|
||
153 | public FeatureStoreProvider getProvider();
|
||
154 | |||
155 | |||
156 | /**
|
||
157 | * Return original {@link FeatureType} of {@link FeatureStoreProvider}.
|
||
158 | *
|
||
159 | * @param id
|
||
160 | * of the {@link FeatureType}
|
||
161 | * @return
|
||
162 | * @throws DataException
|
||
163 | */
|
||
164 | public FeatureType getProviderFeatureType(String featureTypeId); |
||
165 | |||
166 | /**
|
||
167 | * Extract {@link FeatureProvider} from a {@link Feature} instance.
|
||
168 | *
|
||
169 | * @param feature
|
||
170 | * @return
|
||
171 | */
|
||
172 | public FeatureProvider getFeatureProviderFromFeature(Feature feature);
|
||
173 | |||
174 | /**
|
||
175 | * Return current FeatureStore
|
||
176 | *
|
||
177 | * @return
|
||
178 | */
|
||
179 | public FeatureStore getFeatureStore();
|
||
180 | |||
181 | /**
|
||
182 | * Return current FeatureStore name.
|
||
183 | *
|
||
184 | * @return
|
||
185 | */
|
||
186 | public String getName(); |
||
187 | |||
188 | /**
|
||
189 | * Return default {@link FeatureType} of the store
|
||
190 | *
|
||
191 | * @return
|
||
192 | */
|
||
193 | public FeatureType getDefaultFeatureType() throws DataException; |
||
194 | |||
195 | } |