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 @ 40435
History | View | Annotate | Download (4.94 KB)
1 | 40435 | jjdelcerro | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
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 2
|
||
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 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 IVER T.I. S.A. {{Task}}
|
||
26 | */
|
||
27 | |||
28 | package org.gvsig.fmap.dal.feature.spi; |
||
29 | |||
30 | import java.util.List; |
||
31 | |||
32 | import org.gvsig.fmap.dal.DataManager; |
||
33 | import org.gvsig.fmap.dal.exception.DataException; |
||
34 | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
||
35 | import org.gvsig.fmap.dal.feature.Feature; |
||
36 | import org.gvsig.fmap.dal.feature.FeatureSelection; |
||
37 | import org.gvsig.fmap.dal.feature.FeatureStore; |
||
38 | import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
||
39 | import org.gvsig.fmap.dal.feature.FeatureType; |
||
40 | import org.gvsig.fmap.dal.resource.Resource; |
||
41 | import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
||
42 | |||
43 | /**
|
||
44 | * Interface of Services for feature based data providers
|
||
45 | *
|
||
46 | * @author jmvivo
|
||
47 | *
|
||
48 | */
|
||
49 | public interface FeatureStoreProviderServices extends |
||
50 | DataStoreProviderServices { |
||
51 | |||
52 | /**
|
||
53 | * Call this to send a notification to observers of this store
|
||
54 | *
|
||
55 | * @param notification
|
||
56 | */
|
||
57 | public void notifyChange(String notification); |
||
58 | |||
59 | /**
|
||
60 | * Call this to send a notification to observers of this store
|
||
61 | *
|
||
62 | * @param notification
|
||
63 | */
|
||
64 | public void notifyChange(String notification, FeatureProvider data); |
||
65 | |||
66 | /**
|
||
67 | * Call this to send a notification to observers of this store
|
||
68 | *
|
||
69 | * @param notification
|
||
70 | */
|
||
71 | public void notifyChange(FeatureStoreNotification storeNotification); |
||
72 | |||
73 | /**
|
||
74 | * Call this to send a notification to observers of this store relative to
|
||
75 | * Resources
|
||
76 | *
|
||
77 | * @param notification
|
||
78 | */
|
||
79 | public void notifyChange(String notification, Resource resource); |
||
80 | |||
81 | /**
|
||
82 | * Create a new instance of default implementation of a
|
||
83 | * {@link FeatureSelection}
|
||
84 | *
|
||
85 | * @return new {@link FeatureSelection}
|
||
86 | * @throws DataException
|
||
87 | */
|
||
88 | public FeatureSelection createDefaultFeatureSelection()
|
||
89 | throws DataException;
|
||
90 | |||
91 | /**
|
||
92 | * Create a new instance of default implementation of a {@link FeatureProvider}
|
||
93 | *
|
||
94 | * @return new {@link FeatureProvider}
|
||
95 | * @throws DataException
|
||
96 | */
|
||
97 | public FeatureProvider createDefaultFeatureProvider(FeatureType type)
|
||
98 | throws DataException;
|
||
99 | |||
100 | /**
|
||
101 | * Sets {@link FeatureType} available from this store.<br>
|
||
102 | *
|
||
103 | * <strong>Note:</strong> <code>defaultType</code> must be in
|
||
104 | * <code>types</code>
|
||
105 | *
|
||
106 | * @param list
|
||
107 | * of all {@link FeatureType} available
|
||
108 | * @param {@link FeatureType} used in
|
||
109 | * {@link FeatureStore#getDefaultFeatureType()}
|
||
110 | */
|
||
111 | public void setFeatureTypes(List types, FeatureType defaultType); |
||
112 | |||
113 | /**
|
||
114 | * Reaturn {@link DataManager} instance.
|
||
115 | *
|
||
116 | * @return
|
||
117 | */
|
||
118 | public DataManager getManager();
|
||
119 | |||
120 | /**
|
||
121 | * Create a {@link Feature} instance for {@link FeatureProvider}
|
||
122 | * <code>data</code>
|
||
123 | *
|
||
124 | * <br>
|
||
125 | * <br>
|
||
126 | * <strong>NOTE:</strong> Normaly <strong> Providers must use</strong>
|
||
127 | * {@link FeatureProvider} instances instead Feature
|
||
128 | *
|
||
129 | * @param data
|
||
130 | * @return a {@link Feature}
|
||
131 | * @throws DataException
|
||
132 | */
|
||
133 | public Feature createFeature(FeatureProvider data)
|
||
134 | throws DataException;
|
||
135 | |||
136 | /**
|
||
137 | * Creates a new instance of EditableFeatureType. Uses 'default' as
|
||
138 | * identifier.
|
||
139 | *
|
||
140 | * @return
|
||
141 | */
|
||
142 | public EditableFeatureType createFeatureType();
|
||
143 | |||
144 | /**
|
||
145 | * Creates a new instance of EditableFeatureType. Uses 'id' as identifier.
|
||
146 | *
|
||
147 | * @return
|
||
148 | */
|
||
149 | public EditableFeatureType createFeatureType(String id); |
||
150 | |||
151 | /**
|
||
152 | * Return the instance of {@link FeatureStoreProvider} for this store.
|
||
153 | *
|
||
154 | * @return
|
||
155 | */
|
||
156 | public FeatureStoreProvider getProvider();
|
||
157 | |||
158 | |||
159 | /**
|
||
160 | * Return original {@link FeatureType} of {@link FeatureStoreProvider}.
|
||
161 | *
|
||
162 | * @param id
|
||
163 | * of the {@link FeatureType}
|
||
164 | * @return
|
||
165 | * @throws DataException
|
||
166 | */
|
||
167 | public FeatureType getProviderFeatureType(String featureTypeId); |
||
168 | |||
169 | /**
|
||
170 | * Extract {@link FeatureProvider} from a {@link Feature} instance.
|
||
171 | *
|
||
172 | * @param feature
|
||
173 | * @return
|
||
174 | */
|
||
175 | public FeatureProvider getFeatureProviderFromFeature(Feature feature);
|
||
176 | |||
177 | /**
|
||
178 | * Return current FeatureStore
|
||
179 | *
|
||
180 | * @return
|
||
181 | */
|
||
182 | public FeatureStore getFeatureStore();
|
||
183 | |||
184 | /**
|
||
185 | * Return current FeatureStore name.
|
||
186 | *
|
||
187 | * @return
|
||
188 | */
|
||
189 | public String getName(); |
||
190 | |||
191 | /**
|
||
192 | * Return default {@link FeatureType} of the store
|
||
193 | *
|
||
194 | * @return
|
||
195 | */
|
||
196 | public FeatureType getDefaultFeatureType() throws DataException; |
||
197 | |||
198 | } |