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