Statistics
| Revision:

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 @ 40559

History | View | Annotate | Download (4.99 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
 * AUTHORS (In addition to CIT):
26
 * 2008 IVER T.I. S.A.   {{Task}}
27
 */
28

    
29
package org.gvsig.fmap.dal.feature.spi;
30

    
31
import java.util.List;
32

    
33
import org.gvsig.fmap.dal.DataManager;
34
import org.gvsig.fmap.dal.exception.DataException;
35
import org.gvsig.fmap.dal.feature.EditableFeatureType;
36
import org.gvsig.fmap.dal.feature.Feature;
37
import org.gvsig.fmap.dal.feature.FeatureSelection;
38
import org.gvsig.fmap.dal.feature.FeatureStore;
39
import org.gvsig.fmap.dal.feature.FeatureStoreNotification;
40
import org.gvsig.fmap.dal.feature.FeatureType;
41
import org.gvsig.fmap.dal.resource.Resource;
42
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
43

    
44
/**
45
 * Interface of Services for feature based data providers
46
 *
47
 * @author jmvivo
48
 *
49
 */
50
public interface FeatureStoreProviderServices extends
51
                DataStoreProviderServices {
52

    
53
        /**
54
         * Call this to send a notification to observers of this store
55
         *
56
         * @param notification
57
         */
58
        public void notifyChange(String notification);
59

    
60
        /**
61
         * Call this to send a notification to observers of this store
62
         * 
63
         * @param notification
64
         */
65
        public void notifyChange(String notification, FeatureProvider data);
66

    
67
        /**
68
         * Call this to send a notification to observers of this store
69
         * 
70
         * @param notification
71
         */
72
        public void 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
         */
80
        public void notifyChange(String notification, Resource resource);
81

    
82
        /**
83
         * Create a new instance of default implementation of a
84
         * {@link FeatureSelection}
85
         *
86
         * @return new {@link FeatureSelection}
87
         * @throws DataException
88
         */
89
        public FeatureSelection createDefaultFeatureSelection()
90
                        throws DataException;
91

    
92
        /**
93
         * Create a new instance of default implementation of a {@link FeatureProvider}
94
         *
95
         * @return new {@link FeatureProvider}
96
         * @throws DataException
97
         */
98
        public FeatureProvider createDefaultFeatureProvider(FeatureType type)
99
                        throws DataException;
100

    
101
        /**
102
         * Sets {@link FeatureType} available from this store.<br>
103
         *
104
         * <strong>Note:</strong> <code>defaultType</code> must be in
105
         * <code>types</code>
106
         *
107
         * @param list
108
         *            of all {@link FeatureType} available
109
         * @param {@link FeatureType} used in
110
         *        {@link FeatureStore#getDefaultFeatureType()}
111
         */
112
        public void setFeatureTypes(List types, FeatureType defaultType);
113

    
114
        /**
115
         * Reaturn {@link DataManager} instance.
116
         *
117
         * @return
118
         */
119
        public DataManager getManager();
120

    
121
        /**
122
         * Create a {@link Feature} instance for {@link FeatureProvider}
123
         * <code>data</code>
124
         *
125
         * <br>
126
         * <br>
127
         * <strong>NOTE:</strong> Normaly <strong> Providers must use</strong>
128
         * {@link FeatureProvider} instances instead Feature
129
         *
130
         * @param data
131
         * @return a {@link Feature}
132
         * @throws DataException
133
         */
134
        public Feature createFeature(FeatureProvider data)
135
        throws DataException;
136

    
137
        /**
138
         * Creates a new instance of EditableFeatureType. Uses 'default' as
139
         * identifier.
140
         *
141
         * @return
142
         */
143
        public EditableFeatureType createFeatureType();
144

    
145
        /**
146
         * Creates a new instance of EditableFeatureType. Uses 'id' as identifier.
147
         *
148
         * @return
149
         */
150
        public EditableFeatureType createFeatureType(String id);
151

    
152
        /**
153
         * Return the instance of {@link FeatureStoreProvider} for this store.
154
         *
155
         * @return
156
         */
157
        public FeatureStoreProvider getProvider();
158

    
159

    
160
        /**
161
         * Return original {@link FeatureType} of {@link FeatureStoreProvider}.
162
         *
163
         * @param id
164
         *            of the {@link FeatureType}
165
         * @return
166
         * @throws DataException
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
         */
197
        public FeatureType getDefaultFeatureType() throws DataException;
198

    
199
}