Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src-test / org / gvsig / fmap / mapcontext / persistence / DummyDBFeatureStore.java @ 37298

History | View | Annotate | Download (13.5 KB)

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

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

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

    
48
public class DummyDBFeatureStore implements FeatureStore {
49

    
50
        private String name = "[empty]";
51

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

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

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

    
69
        }
70

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

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

    
79
        }
80

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

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

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

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

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

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

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

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

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

    
130
        }
131

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

    
135
        }
136

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

    
140
        }
141

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

    
145
        }
146

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

    
152
        }
153

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

    
157
        }
158

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

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

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

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

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

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

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

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

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

    
205
        }
206

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

    
210
        }
211

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

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

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

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

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

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

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

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

    
251
        }
252

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

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

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

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

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

    
276
        }
277

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

    
281
        }
282

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

    
286
        }
287

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

    
291
        }
292

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

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

    
303
        public void dispose() {
304
                // TODO Auto-generated method stub
305

    
306
        }
307

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

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

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

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

    
326
        }
327

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

    
332
        }
333

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

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

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

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

    
353
        }
354

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

    
358
        }
359

    
360
        public void beginComplexNotification() {
361
                // TODO Auto-generated method stub
362

    
363
        }
364

    
365
        public void disableNotifications() {
366
                // TODO Auto-generated method stub
367

    
368
        }
369

    
370
        public void enableNotifications() {
371
                // TODO Auto-generated method stub
372

    
373
        }
374

    
375
        public void endComplexNotification() {
376
                // TODO Auto-generated method stub
377

    
378
        }
379

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

    
383
        }
384

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

    
388
        }
389

    
390
        public void deleteObservers() {
391
                // TODO Auto-generated method stub
392

    
393
        }
394

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

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

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

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

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

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

    
421
        }
422

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

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

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

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

    
441
        }
442

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

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

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

    
459
        }
460

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

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

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

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

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

    
484
        }
485

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

    
489
        }
490

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

    
494
        }
495

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

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

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

    
517
        }
518

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

    
523
        }
524

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

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

    
536
        public void clear() {
537
                // Nothing to do
538
        }
539

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

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

    
550
    public boolean isKnownEnvelope() {
551
        // TODO Auto-generated method stub
552
        return false;
553
    }
554

    
555
    public boolean hasRetrievedFeaturesLimit() {
556
        // TODO Auto-generated method stub
557
        return false;
558
    }
559

    
560
    public int getRetrievedFeaturesLimit() {
561
        // TODO Auto-generated method stub
562
        return 0;
563
    }
564

    
565
    public Interval getInterval() {
566
        // TODO Auto-generated method stub
567
        return null;
568
    }
569

    
570
    public Collection getTimes() {
571
        // TODO Auto-generated method stub
572
        return null;
573
    }
574

    
575
    public Collection getTimes(Interval interval) {
576
        // TODO Auto-generated method stub
577
        return null;
578
    }
579

    
580
    public FeatureIndex createIndex(String indexTypeName,
581
        FeatureType featureType, String attributeName, String indexName)
582
        throws DataException {
583
        // TODO Auto-generated method stub
584
        return null;
585
    }
586

    
587
    public FeatureIndex createIndex(String indexTypeName,
588
        FeatureType featureType, String attributeName, String indexName,
589
        Observer observer) throws DataException {
590
        // TODO Auto-generated method stub
591
        return null;
592
    }
593
}