Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_0_Build_2020 / libraries / libFMap_mapcontext / src-test / org / gvsig / fmap / mapcontext / persistence / DummyDBFeatureStore.java @ 33790

History | View | Annotate | Download (12.3 KB)

1
package org.gvsig.fmap.mapcontext.persistence;
2

    
3
import java.util.Iterator;
4
import java.util.List;
5
import java.util.Set;
6

    
7
import org.cresques.cts.IProjection;
8
import org.gvsig.fmap.dal.DataQuery;
9
import org.gvsig.fmap.dal.DataServerExplorer;
10
import org.gvsig.fmap.dal.DataSet;
11
import org.gvsig.fmap.dal.DataStoreParameters;
12
import org.gvsig.fmap.dal.exception.DataException;
13
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
14
import org.gvsig.fmap.dal.feature.EditableFeature;
15
import org.gvsig.fmap.dal.feature.EditableFeatureType;
16
import org.gvsig.fmap.dal.feature.Feature;
17
import org.gvsig.fmap.dal.feature.FeatureCache;
18
import org.gvsig.fmap.dal.feature.FeatureIndex;
19
import org.gvsig.fmap.dal.feature.FeatureIndexes;
20
import org.gvsig.fmap.dal.feature.FeatureLocks;
21
import org.gvsig.fmap.dal.feature.FeatureQuery;
22
import org.gvsig.fmap.dal.feature.FeatureReference;
23
import org.gvsig.fmap.dal.feature.FeatureSelection;
24
import org.gvsig.fmap.dal.feature.FeatureSet;
25
import org.gvsig.fmap.dal.feature.FeatureStore;
26
import org.gvsig.fmap.dal.feature.FeatureStoreTransforms;
27
import org.gvsig.fmap.dal.feature.FeatureType;
28
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
29
import org.gvsig.fmap.dal.feature.exception.NeedEditingModeException;
30
import org.gvsig.fmap.geom.primitive.Envelope;
31
import org.gvsig.tools.ToolsLocator;
32
import org.gvsig.tools.dynobject.DynClass;
33
import org.gvsig.tools.dynobject.DynObject;
34
import org.gvsig.tools.dynobject.DynStruct;
35
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
36
import org.gvsig.tools.dynobject.exception.DynMethodException;
37
import org.gvsig.tools.exception.BaseException;
38
import org.gvsig.tools.observer.Observer;
39
import org.gvsig.tools.persistence.PersistenceManager;
40
import org.gvsig.tools.persistence.PersistentState;
41
import org.gvsig.tools.persistence.exception.PersistenceException;
42
import org.gvsig.tools.undo.RedoException;
43
import org.gvsig.tools.undo.UndoException;
44
import org.gvsig.tools.visitor.Visitor;
45

    
46
public class DummyDBFeatureStore implements FeatureStore {
47

    
48
        private String name = "[empty]";
49

    
50
        public DummyDBFeatureStore() {
51
                
52
        }
53
        
54
        public DummyDBFeatureStore(String id) {
55
                name = "[DATABASE FEATURE STORE - " + id + "]";
56
        }
57

    
58
        public boolean allowWrite() {
59
                // TODO Auto-generated method stub
60
                return false;
61
        }
62

    
63
        public void beginEditingGroup(String description)
64
                        throws NeedEditingModeException {
65
                // TODO Auto-generated method stub
66

    
67
        }
68

    
69
        public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException {
70
                // TODO Auto-generated method stub
71
                return false;
72
        }
73

    
74
        public void cancelEditing() throws DataException {
75
                // TODO Auto-generated method stub
76

    
77
        }
78

    
79
        public FeatureQuery createFeatureQuery() {
80
                // TODO Auto-generated method stub
81
                return null;
82
        }
83

    
84
        public FeatureSelection createFeatureSelection() throws DataException {
85
                // TODO Auto-generated method stub
86
                return null;
87
        }
88

    
89
        public FeatureIndex createIndex(FeatureType featureType,
90
                        String attributeName, String indexName) throws DataException {
91
                // TODO Auto-generated method stub
92
                return null;
93
        }
94

    
95
        public FeatureIndex createIndex(FeatureType featureType,
96
                        String attributeName, String indexName, Observer observer)
97
                        throws DataException {
98
                // TODO Auto-generated method stub
99
                return null;
100
        }
101

    
102
        public EditableFeature createNewFeature() throws DataException {
103
                // TODO Auto-generated method stub
104
                return null;
105
        }
106

    
107
        public EditableFeature createNewFeature(FeatureType type,
108
                        Feature defaultValues) throws DataException {
109
                // TODO Auto-generated method stub
110
                return null;
111
        }
112

    
113
        public EditableFeature createNewFeature(FeatureType type,
114
                        boolean defaultValues) throws DataException {
115
                // TODO Auto-generated method stub
116
                return null;
117
        }
118

    
119
        public EditableFeature createNewFeature(boolean defaultValues)
120
                        throws DataException {
121
                // TODO Auto-generated method stub
122
                return null;
123
        }
124

    
125
        public void delete(Feature feature) throws DataException {
126
                // TODO Auto-generated method stub
127

    
128
        }
129

    
130
        public void edit() throws DataException {
131
                // TODO Auto-generated method stub
132

    
133
        }
134

    
135
        public void edit(int mode) throws DataException {
136
                // TODO Auto-generated method stub
137

    
138
        }
139

    
140
        public void endEditingGroup() throws NeedEditingModeException {
141
                // TODO Auto-generated method stub
142

    
143
        }
144

    
145
        public void export(DataServerExplorer explorer,
146
                        String providerName,
147
                        NewFeatureStoreParameters params) throws DataException {
148
                // TODO Auto-generated method stub
149

    
150
        }
151

    
152
        public void finishEditing() throws DataException {
153
                // TODO Auto-generated method stub
154

    
155
        }
156

    
157
        public FeatureType getDefaultFeatureType() throws DataException {
158
                return new DummyFileFeatureStore.DummyFeatureType();
159
        }
160

    
161
        public Envelope getEnvelope() throws DataException {
162
                // TODO Auto-generated method stub
163
                return null;
164
        }
165

    
166
        public Feature getFeatureByReference(FeatureReference reference)
167
                        throws DataException {
168
                // TODO Auto-generated method stub
169
                return null;
170
        }
171

    
172
        public Feature getFeatureByReference(FeatureReference reference,
173
                        FeatureType featureType) throws DataException {
174
                // TODO Auto-generated method stub
175
                return null;
176
        }
177

    
178
        public long getFeatureCount() throws DataException {
179
                // TODO Auto-generated method stub
180
                return 0;
181
        }
182

    
183
        public FeatureSelection getFeatureSelection() throws DataException {
184
                // TODO Auto-generated method stub
185
                return null;
186
        }
187

    
188
        public FeatureSet getFeatureSet() throws DataException {
189
                // TODO Auto-generated method stub
190
                return null;
191
        }
192

    
193
        public FeatureSet getFeatureSet(FeatureQuery featureQuery)
194
                        throws DataException {
195
                // TODO Auto-generated method stub
196
                return null;
197
        }
198

    
199
        public void getFeatureSet(FeatureQuery featureQuery, Observer observer)
200
                        throws DataException {
201
                // TODO Auto-generated method stub
202

    
203
        }
204

    
205
        public void getFeatureSet(Observer observer) throws DataException {
206
                // TODO Auto-generated method stub
207

    
208
        }
209

    
210
        public FeatureType getFeatureType(String featureTypeId)
211
                        throws DataException {
212
                // TODO Auto-generated method stub
213
                return null;
214
        }
215

    
216
        public List getFeatureTypes() throws DataException {
217
                // TODO Auto-generated method stub
218
                return null;
219
        }
220

    
221
        public FeatureIndexes getIndexes() {
222
                // TODO Auto-generated method stub
223
                return null;
224
        }
225

    
226
        public FeatureLocks getLocks() throws DataException {
227
                // TODO Auto-generated method stub
228
                return null;
229
        }
230

    
231
        public DataStoreParameters getParameters() {
232
                // TODO Auto-generated method stub
233
                return null;
234
        }
235

    
236
        public IProjection getSRSDefaultGeometry() throws DataException {
237
                // TODO Auto-generated method stub
238
                return null;
239
        }
240

    
241
        public FeatureStoreTransforms getTransforms() {
242
                // TODO Auto-generated method stub
243
                return null;
244
        }
245

    
246
        public void insert(EditableFeature feature) throws DataException {
247
                // TODO Auto-generated method stub
248

    
249
        }
250

    
251
        public boolean isAppendModeSupported() {
252
                // TODO Auto-generated method stub
253
                return false;
254
        }
255

    
256
        public boolean isAppending() {
257
                // TODO Auto-generated method stub
258
                return false;
259
        }
260

    
261
        public boolean isEditing() {
262
                // TODO Auto-generated method stub
263
                return false;
264
        }
265

    
266
        public boolean isLocksSupported() {
267
                // TODO Auto-generated method stub
268
                return false;
269
        }
270

    
271
        public void setSelection(FeatureSet selection) throws DataException {
272
                // TODO Auto-generated method stub
273

    
274
        }
275

    
276
        public void update(EditableFeatureType featureType) throws DataException {
277
                // TODO Auto-generated method stub
278

    
279
        }
280

    
281
        public void update(EditableFeature feature) throws DataException {
282
                // TODO Auto-generated method stub
283

    
284
        }
285

    
286
        public void validateFeatures(int mode) throws DataException {
287
                // TODO Auto-generated method stub
288

    
289
        }
290

    
291
        public DataQuery createQuery() {
292
                // TODO Auto-generated method stub
293
                return null;
294
        }
295

    
296
        public DataSet createSelection() throws DataException {
297
                // TODO Auto-generated method stub
298
                return null;
299
        }
300

    
301
        public void dispose() {
302
                // TODO Auto-generated method stub
303

    
304
        }
305

    
306
        public Iterator getChildren() {
307
                // TODO Auto-generated method stub
308
                return null;
309
        }
310

    
311
        public DataSet getDataSet() throws DataException {
312
                // TODO Auto-generated method stub
313
                return null;
314
        }
315

    
316
        public DataSet getDataSet(DataQuery dataQuery) throws DataException {
317
                // TODO Auto-generated method stub
318
                return null;
319
        }
320

    
321
        public void getDataSet(Observer observer) throws DataException {
322
                // TODO Auto-generated method stub
323

    
324
        }
325

    
326
        public void getDataSet(DataQuery dataQuery, Observer observer)
327
                        throws DataException {
328
                // TODO Auto-generated method stub
329

    
330
        }
331

    
332
        public DataServerExplorer getExplorer() throws DataException,
333
                        ValidateDataParametersException {
334
                // TODO Auto-generated method stub
335
                return null;
336
        }
337

    
338
        public String getName() {
339
                // TODO Auto-generated method stub
340
                return name;
341
        }
342

    
343
        public DataSet getSelection() throws DataException {
344
                // TODO Auto-generated method stub
345
                return null;
346
        }
347

    
348
        public void refresh() throws DataException {
349
                // TODO Auto-generated method stub
350

    
351
        }
352

    
353
        public void setSelection(DataSet selection) throws DataException {
354
                // TODO Auto-generated method stub
355

    
356
        }
357

    
358
        public void beginComplexNotification() {
359
                // TODO Auto-generated method stub
360

    
361
        }
362

    
363
        public void disableNotifications() {
364
                // TODO Auto-generated method stub
365

    
366
        }
367

    
368
        public void enableNotifications() {
369
                // TODO Auto-generated method stub
370

    
371
        }
372

    
373
        public void endComplexNotification() {
374
                // TODO Auto-generated method stub
375

    
376
        }
377

    
378
        public void addObserver(Observer o) {
379
                // TODO Auto-generated method stub
380

    
381
        }
382

    
383
        public void deleteObserver(Observer o) {
384
                // TODO Auto-generated method stub
385

    
386
        }
387

    
388
        public void deleteObservers() {
389
                // TODO Auto-generated method stub
390

    
391
        }
392

    
393
        public void loadFromState(PersistentState state) throws PersistenceException {
394
                name = state.getString("name");
395
        }
396

    
397
        public void saveToState(PersistentState state) throws PersistenceException {
398
                state.set("name", name);
399
        }
400

    
401
        public Set getMetadataChildren() {
402
                // TODO Auto-generated method stub
403
                return null;
404
        }
405

    
406
        public Object getMetadataID() {
407
                // TODO Auto-generated method stub
408
                return null;
409
        }
410

    
411
        public String getMetadataName() {
412
                // TODO Auto-generated method stub
413
                return null;
414
        }
415

    
416
        public void delegate(DynObject dynObject) {
417
                // TODO Auto-generated method stub
418

    
419
        }
420

    
421
        public DynClass getDynClass() {
422
                // TODO Auto-generated method stub
423
                return null;
424
        }
425

    
426
        public Object getDynValue(String name) throws DynFieldNotFoundException {
427
                // TODO Auto-generated method stub
428
                return null;
429
        }
430

    
431
        public boolean hasDynValue(String name) {
432
                // TODO Auto-generated method stub
433
                return false;
434
        }
435

    
436
        public void implement(DynClass dynClass) {
437
                // TODO Auto-generated method stub
438

    
439
        }
440

    
441
        public Object invokeDynMethod(String name, DynObject context)
442
                        throws DynMethodException {
443
                // TODO Auto-generated method stub
444
                return null;
445
        }
446

    
447
        public Object invokeDynMethod(int code, DynObject context)
448
                        throws DynMethodException {
449
                // TODO Auto-generated method stub
450
                return null;
451
        }
452

    
453
        public void setDynValue(String name, Object value)
454
                        throws DynFieldNotFoundException {
455
                // TODO Auto-generated method stub
456

    
457
        }
458

    
459
        public boolean canRedo() {
460
                // TODO Auto-generated method stub
461
                return false;
462
        }
463

    
464
        public boolean canUndo() {
465
                // TODO Auto-generated method stub
466
                return false;
467
        }
468

    
469
        public List getRedoInfos() {
470
                // TODO Auto-generated method stub
471
                return null;
472
        }
473

    
474
        public List getUndoInfos() {
475
                // TODO Auto-generated method stub
476
                return null;
477
        }
478

    
479
        public void redo() throws RedoException {
480
                // TODO Auto-generated method stub
481

    
482
        }
483

    
484
        public void redo(int num) throws RedoException {
485
                // TODO Auto-generated method stub
486

    
487
        }
488

    
489
        public void undo() throws UndoException {
490
                // TODO Auto-generated method stub
491

    
492
        }
493

    
494
        public void undo(int num) throws UndoException {
495
                // TODO Auto-generated method stub
496

    
497
        }
498
        
499
        
500
        public static void registerPersistent() {
501
                PersistenceManager manager = ToolsLocator.getPersistenceManager();
502
                DynStruct definition = manager.addDefinition(
503
                                DummyDBFeatureStore.class,
504
                                "DummyDBFeatureStore",
505
                                "DummyDBFeatureStore Persistence definition",
506
                                null, 
507
                                null
508
                );
509
                definition.addDynFieldString("name");
510
        }
511

    
512
        public void accept(Visitor visitor) throws BaseException {
513
                // TODO Auto-generated method stub
514

    
515
        }
516

    
517
        public void accept(Visitor visitor, DataQuery dataQuery)
518
                        throws BaseException {
519
                // TODO Auto-generated method stub
520

    
521
        }
522

    
523
        public void createCache(String name, DynObject parameters)
524
                        throws DataException {
525
                // TODO Auto-generated method stub
526
                
527
        }
528

    
529
        public FeatureCache getCache() {
530
                // TODO Auto-generated method stub
531
                return null;
532
        }
533

    
534
        public void clear() {
535
                // Nothing to do
536
        }
537

    
538
        public String getProviderName() {
539
                // TODO Auto-generated method stub
540
                return null;
541
        }
542

    
543
        public String getFullName() {
544
                // TODO Auto-generated method stub
545
                return null;
546
        }
547
}