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

History | View | Annotate | Download (5.28 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.SupportTransactions;
31
import org.gvsig.fmap.dal.exception.DataException;
32
import org.gvsig.fmap.dal.feature.EditableFeatureType;
33
import org.gvsig.fmap.dal.feature.Feature;
34
import org.gvsig.fmap.dal.feature.FeatureSelection;
35
import org.gvsig.fmap.dal.feature.FeatureStore;
36
import org.gvsig.fmap.dal.feature.FeatureStoreNotification;
37
import org.gvsig.fmap.dal.feature.FeatureType;
38
import org.gvsig.fmap.dal.resource.Resource;
39
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
40

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

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

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

    
67
        /**
68
         * Call this to send a notification to observers of this store
69
         * 
70
   * @param storeNotification
71
   * @return 
72
         */
73
        public FeatureStoreNotification notifyChange(FeatureStoreNotification storeNotification);
74

    
75
        /**
76
         * Call this to send a notification to observers of this store relative to
77
         * Resources
78
         * 
79
         * @param notification
80
   * @param resource
81
   * @return 
82
         */
83
        public FeatureStoreNotification notifyChange(String notification, Resource resource);
84

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

    
95
        /**
96
         * Create a new instance of default implementation of a {@link FeatureProvider}
97
         *
98
   * @param type
99
         * @return new {@link FeatureProvider}
100
         * @throws DataException
101
         */
102
        public FeatureProvider createDefaultFeatureProvider(FeatureType type)
103
                        throws DataException;
104

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

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

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

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

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

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

    
162

    
163
        /**
164
         * Return original {@link FeatureType} of {@link FeatureStoreProvider}.
165
         *
166
         * @param featureTypeId, of the {@link FeatureType}
167
         * @return
168
         */
169
        public FeatureType getProviderFeatureType(String featureTypeId);
170

    
171
        /**
172
         * Extract {@link FeatureProvider} from a {@link Feature} instance.
173
         *
174
         * @param feature
175
         * @return
176
         */
177
        public FeatureProvider getFeatureProviderFromFeature(Feature feature);
178

    
179
        /**
180
         * Return current FeatureStore
181
         *
182
         * @return
183
         */
184
        public FeatureStore getFeatureStore();
185

    
186
        /**
187
         * Return current FeatureStore name.
188
         *
189
         * @return
190
         */
191
        public String getName();
192

    
193
        /**
194
         * Return default {@link FeatureType} of the store
195
         *
196
         * @return
197
   * @throws org.gvsig.fmap.dal.exception.DataException
198
         */
199
        public FeatureType getDefaultFeatureType() throws DataException;
200
        
201
  public List getFeatureTypes() throws DataException;
202

    
203
}