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 / spi / DataStoreProvider.java @ 40435
History | View | Annotate | Download (3.84 KB)
1 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.spi; |
---|---|---|---|
2 | |||
3 | import java.util.Collection; |
||
4 | import java.util.Iterator; |
||
5 | |||
6 | import org.gvsig.fmap.dal.DataServerExplorer; |
||
7 | import org.gvsig.fmap.dal.exception.CloseException; |
||
8 | import org.gvsig.fmap.dal.exception.InitializeException; |
||
9 | import org.gvsig.fmap.dal.exception.OpenException; |
||
10 | import org.gvsig.fmap.dal.exception.ReadException; |
||
11 | import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
||
12 | import org.gvsig.fmap.dal.resource.Resource; |
||
13 | import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
||
14 | import org.gvsig.timesupport.Interval; |
||
15 | import org.gvsig.timesupport.Time; |
||
16 | import org.gvsig.tools.dispose.Disposable; |
||
17 | import org.gvsig.tools.dynobject.DynObject; |
||
18 | |||
19 | /**
|
||
20 | * Base interface for all data providers
|
||
21 | *
|
||
22 | * @author jmvivo
|
||
23 | *
|
||
24 | */
|
||
25 | public interface DataStoreProvider extends org.gvsig.fmap.dal.DataStoreProvider, DynObject, Disposable { |
||
26 | |||
27 | /**
|
||
28 | * Retruns an {@link java.util.Iterator} of SubStores from this store. it
|
||
29 | * this hasn't SubStores returns <code>null</code>.
|
||
30 | *
|
||
31 | * @return SubStores iterator
|
||
32 | */
|
||
33 | public abstract Iterator getChilds(); |
||
34 | |||
35 | /**
|
||
36 | * Create a {@link DataServerExplorer} from the same source that this store.
|
||
37 | *
|
||
38 | * @return ServerExplorer
|
||
39 | * @throws ReadException
|
||
40 | * @throws ValidateDataParametersException
|
||
41 | */
|
||
42 | public abstract DataServerExplorer getExplorer() throws ReadException, |
||
43 | ValidateDataParametersException; |
||
44 | |||
45 | /**
|
||
46 | * Open store. You must call it before do anything whith store.<br>
|
||
47 | * This method can be called repeatly.
|
||
48 | *
|
||
49 | * @throws OpenException
|
||
50 | */
|
||
51 | public abstract void open() throws OpenException; |
||
52 | |||
53 | /**
|
||
54 | * Request to close de source
|
||
55 | *
|
||
56 | * @throws CloseException
|
||
57 | */
|
||
58 | public abstract void close() throws CloseException; |
||
59 | |||
60 | /**
|
||
61 | * Returns the {@link Resource} from where the data is being loaded.
|
||
62 | *
|
||
63 | * @return the data {@link Resource}
|
||
64 | */
|
||
65 | ResourceProvider getResource(); |
||
66 | |||
67 | /**
|
||
68 | * Force to reload information of Store
|
||
69 | *
|
||
70 | * @throws OpenException
|
||
71 | * @throws InitializeException
|
||
72 | */
|
||
73 | public abstract void refresh() throws OpenException, InitializeException; |
||
74 | |||
75 | /**
|
||
76 | * Returns the unique identifier of the Store
|
||
77 | *
|
||
78 | * FIXME add examples
|
||
79 | *
|
||
80 | * @return
|
||
81 | */
|
||
82 | public abstract Object getSourceId(); |
||
83 | |||
84 | /**
|
||
85 | * Return the name of the provider.
|
||
86 | * Examples: dbf, shp, jdbc, postgresql, wfs, gml
|
||
87 | *
|
||
88 | * @return
|
||
89 | */
|
||
90 | public String getProviderName(); |
||
91 | |||
92 | /**
|
||
93 | * Returns the name associated to the provider.
|
||
94 | * This name is provided for informational purposes only.
|
||
95 | * Explamples:
|
||
96 | *
|
||
97 | * In a dbf the filename without the path
|
||
98 | *
|
||
99 | * In a DDBB table the name of the table
|
||
100 | *
|
||
101 | * In a WFS layer the name of the layer.
|
||
102 | *
|
||
103 | * @return String containing this store's name.
|
||
104 | */
|
||
105 | public String getName(); |
||
106 | |||
107 | /**
|
||
108 | * Returns a more descriptive name for the provider that getName.
|
||
109 | * This name is provided for informational purposes only.
|
||
110 | * Explamples:
|
||
111 | *
|
||
112 | * In a file based store may return the full name of the filename, path and filename.
|
||
113 | *
|
||
114 | * In a data base based store may return "server:dbname:tablename"
|
||
115 | *
|
||
116 | * In a WFS layer based store may return "server:layername"
|
||
117 | *
|
||
118 | * @return String Containing the full name of the store
|
||
119 | */
|
||
120 | public String getFullName(); |
||
121 | |||
122 | /**
|
||
123 | * Gets the {@link Interval} of the store, that means the temporal
|
||
124 | * interval where the store has valid data.
|
||
125 | * @return
|
||
126 | * a time interval or null if there is not time support
|
||
127 | */
|
||
128 | public Interval getInterval();
|
||
129 | |||
130 | /**
|
||
131 | * Gets all the possible values of time for which the store has data.
|
||
132 | * @return
|
||
133 | * a collection of {@link Time} objects.
|
||
134 | */
|
||
135 | public Collection getTimes(); |
||
136 | |||
137 | /**
|
||
138 | * Gets all the possible values of time for which the store has data
|
||
139 | * and intersects with an interval.
|
||
140 | * @param interval
|
||
141 | * the interval of time
|
||
142 | * @return
|
||
143 | * a collection of {@link Time} objects.
|
||
144 | */
|
||
145 | public Collection getTimes(Interval interval); |
||
146 | |||
147 | } |