Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / spi / FeatureStoreProviderServices.java @ 29391

History | View | Annotate | Download (4.54 KB)

1
/* 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.FeatureType;
39
import org.gvsig.fmap.dal.resource.Resource;
40
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
41

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

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

    
58
        /**
59
         * Call this to send a notification to observers of this store relative to
60
         * Resources
61
         *
62
         * @param notification
63
         */
64
        public void notifyChange(String notification, Resource resource);
65

    
66
        /**
67
         * Create a new instance of default implementation of a
68
         * {@link FeatureSelection}
69
         *
70
         * @return new {@link FeatureSelection}
71
         * @throws DataException
72
         */
73
        public FeatureSelection createDefaultFeatureSelection()
74
                        throws DataException;
75

    
76
        /**
77
         * Create a new instance of default implementation of a {@link FeatureProvider}
78
         *
79
         * @return new {@link FeatureProvider}
80
         * @throws DataException
81
         */
82
        public FeatureProvider createDefaultFeatureProvider(FeatureType type)
83
                        throws DataException;
84

    
85
        /**
86
         * Sets {@link FeatureType} available from this store.<br>
87
         *
88
         * <strong>Note:</strong> <code>defaultType</code> must be in
89
         * <code>types</code>
90
         *
91
         * @param list
92
         *            of all {@link FeatureType} available
93
         * @param {@link FeatureType} used in
94
         *        {@link FeatureStore#getDefaultFeatureType()}
95
         */
96
        public void setFeatureTypes(List types, FeatureType defaultType);
97

    
98
        /**
99
         * Reaturn {@link DataManager} instance.
100
         *
101
         * @return
102
         */
103
        public DataManager getManager();
104

    
105
        /**
106
         * Create a {@link Feature} instance for {@link FeatureProvider}
107
         * <code>data</code>
108
         *
109
         * <br>
110
         * <br>
111
         * <strong>NOTE:</strong> Normaly <strong> Providers must use</strong>
112
         * {@link FeatureProvider} instances instead Feature
113
         *
114
         * @param data
115
         * @return a {@link Feature}
116
         * @throws DataException
117
         */
118
        public Feature createFeature(FeatureProvider data)
119
        throws DataException;
120

    
121
        /**
122
         * Creates a new instance of EditableFeatureType. Uses 'default' as
123
         * identifier.
124
         *
125
         * @return
126
         */
127
        public EditableFeatureType createFeatureType();
128

    
129
        /**
130
         * Creates a new instance of EditableFeatureType. Uses 'id' as identifier.
131
         *
132
         * @return
133
         */
134
        public EditableFeatureType createFeatureType(String id);
135

    
136
        /**
137
         * Return the instance of {@link FeatureStoreProvider} for this store.
138
         *
139
         * @return
140
         */
141
        public FeatureStoreProvider getProvider();
142

    
143

    
144
        /**
145
         * Return original {@link FeatureType} of {@link FeatureStoreProvider}.
146
         *
147
         * @param id
148
         *            of the {@link FeatureType}
149
         * @return
150
         * @throws DataException
151
         */
152
        public FeatureType getProviderFeatureType(String featureTypeId);
153

    
154
        /**
155
         * Extract {@link FeatureProvider} from a {@link Feature} instance.
156
         *
157
         * @param feature
158
         * @return
159
         */
160
        public FeatureProvider getFeatureProviderFromFeature(Feature feature);
161

    
162
        /**
163
         * Return current FeatureStore
164
         *
165
         * @return
166
         */
167
        public FeatureStore getFeatureStore();
168

    
169
        /**
170
         * Return current FeatureStore name
171
         *
172
         * @return
173
         */
174
        public String getName();
175

    
176
        /**
177
         * Return default {@link FeatureType} of the store
178
         *
179
         * @return
180
         */
181
        public FeatureType getDefaultFeatureType() throws DataException;
182

    
183
}