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 @ 44871
History | View | Annotate | Download (5.21 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
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 |
* as published by the Free Software Foundation; either version 3
|
9 |
* 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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
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 |
* @return
|
54 |
*/
|
55 |
public FeatureStoreNotification notifyChange(String notification); |
56 |
|
57 |
/**
|
58 |
* Call this to send a notification to observers of this store
|
59 |
*
|
60 |
* @param notification
|
61 |
* @param data
|
62 |
* @return
|
63 |
*/
|
64 |
public FeatureStoreNotification notifyChange(String notification, FeatureProvider data); |
65 |
|
66 |
/**
|
67 |
* Call this to send a notification to observers of this store
|
68 |
*
|
69 |
* @param storeNotification
|
70 |
* @return
|
71 |
*/
|
72 |
public FeatureStoreNotification notifyChange(FeatureStoreNotification storeNotification);
|
73 |
|
74 |
/**
|
75 |
* Call this to send a notification to observers of this store relative to
|
76 |
* Resources
|
77 |
*
|
78 |
* @param notification
|
79 |
* @param resource
|
80 |
* @return
|
81 |
*/
|
82 |
public FeatureStoreNotification notifyChange(String notification, Resource resource); |
83 |
|
84 |
/**
|
85 |
* Create a new instance of default implementation of a
|
86 |
* {@link FeatureSelection}
|
87 |
*
|
88 |
* @return new {@link FeatureSelection}
|
89 |
* @throws DataException
|
90 |
*/
|
91 |
public FeatureSelection createDefaultFeatureSelection()
|
92 |
throws DataException;
|
93 |
|
94 |
/**
|
95 |
* Create a new instance of default implementation of a {@link FeatureProvider}
|
96 |
*
|
97 |
* @param type
|
98 |
* @return new {@link FeatureProvider}
|
99 |
* @throws DataException
|
100 |
*/
|
101 |
public FeatureProvider createDefaultFeatureProvider(FeatureType type)
|
102 |
throws DataException;
|
103 |
|
104 |
/**
|
105 |
* Sets {@link FeatureType} available from this store.<br>
|
106 |
*
|
107 |
* <strong>Note:</strong> <code>defaultType</code> must be in
|
108 |
* <code>types</code>
|
109 |
*
|
110 |
* @param types, list of all {@link FeatureType} available
|
111 |
* @param defaultType, {@link FeatureType} used in {@link FeatureStore#getDefaultFeatureType()}
|
112 |
*/
|
113 |
public void setFeatureTypes(List types, FeatureType defaultType); |
114 |
|
115 |
/**
|
116 |
* Reaturn {@link DataManager} instance.
|
117 |
*
|
118 |
* @return
|
119 |
*/
|
120 |
public DataManager getManager();
|
121 |
|
122 |
/**
|
123 |
* Create a {@link Feature} instance for {@link FeatureProvider}
|
124 |
* <code>data</code>
|
125 |
*
|
126 |
* <br>
|
127 |
* <br>
|
128 |
* <strong>NOTE:</strong> Normaly <strong> Providers must use</strong>
|
129 |
* {@link FeatureProvider} instances instead Feature
|
130 |
*
|
131 |
* @param data
|
132 |
* @return a {@link Feature}
|
133 |
* @throws DataException
|
134 |
*/
|
135 |
public Feature createFeature(FeatureProvider data)
|
136 |
throws DataException;
|
137 |
|
138 |
/**
|
139 |
* Creates a new instance of EditableFeatureType. Uses 'default' as
|
140 |
* identifier.
|
141 |
*
|
142 |
* @return
|
143 |
*/
|
144 |
public EditableFeatureType createFeatureType();
|
145 |
|
146 |
/**
|
147 |
* Creates a new instance of EditableFeatureType.Uses 'id' as identifier.
|
148 |
*
|
149 |
* @param id
|
150 |
* @return
|
151 |
*/
|
152 |
public EditableFeatureType createFeatureType(String id); |
153 |
|
154 |
/**
|
155 |
* Return the instance of {@link FeatureStoreProvider} for this store.
|
156 |
*
|
157 |
* @return
|
158 |
*/
|
159 |
public FeatureStoreProvider getProvider();
|
160 |
|
161 |
|
162 |
/**
|
163 |
* Return original {@link FeatureType} of {@link FeatureStoreProvider}.
|
164 |
*
|
165 |
* @param featureTypeId, of the {@link FeatureType}
|
166 |
* @return
|
167 |
*/
|
168 |
public FeatureType getProviderFeatureType(String featureTypeId); |
169 |
|
170 |
/**
|
171 |
* Extract {@link FeatureProvider} from a {@link Feature} instance.
|
172 |
*
|
173 |
* @param feature
|
174 |
* @return
|
175 |
*/
|
176 |
public FeatureProvider getFeatureProviderFromFeature(Feature feature);
|
177 |
|
178 |
/**
|
179 |
* Return current FeatureStore
|
180 |
*
|
181 |
* @return
|
182 |
*/
|
183 |
public FeatureStore getFeatureStore();
|
184 |
|
185 |
/**
|
186 |
* Return current FeatureStore name.
|
187 |
*
|
188 |
* @return
|
189 |
*/
|
190 |
public String getName(); |
191 |
|
192 |
/**
|
193 |
* Return default {@link FeatureType} of the store
|
194 |
*
|
195 |
* @return
|
196 |
* @throws org.gvsig.fmap.dal.exception.DataException
|
197 |
*/
|
198 |
public FeatureType getDefaultFeatureType() throws DataException; |
199 |
|
200 |
public List getFeatureTypes() throws DataException; |
201 |
|
202 |
} |