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 / spi / DataStoreProvider.java @ 44440

History | View | Annotate | Download (5.34 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

    
28
import org.gvsig.fmap.dal.DataServerExplorer;
29
import org.gvsig.fmap.dal.DataStore;
30
import org.gvsig.fmap.dal.StoresRepository;
31
import org.gvsig.fmap.dal.exception.CloseException;
32
import org.gvsig.fmap.dal.exception.InitializeException;
33
import org.gvsig.fmap.dal.exception.OpenException;
34
import org.gvsig.fmap.dal.exception.ReadException;
35
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
36
import org.gvsig.fmap.dal.resource.Resource;
37
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
38
import org.gvsig.timesupport.Interval;
39
import org.gvsig.timesupport.Time;
40
import org.gvsig.tools.dispose.Disposable;
41
import org.gvsig.tools.dynobject.DynObject_v2;
42
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
43
import org.gvsig.tools.util.UnmodifiableBasicMap;
44

    
45
/**
46
 * Base interface for all data providers
47
 * 
48
 * @author jmvivo
49
 *
50
 */
51
public interface DataStoreProvider extends org.gvsig.fmap.dal.DataStoreProvider, DynObject_v2, Disposable {
52

    
53
        /**
54
         * Returns an UnmodifiableBasicMap with subStores from this store.
55
         * If do not have children, return an empty UnmodifiableBasicMap.
56
         * Never returns null.
57
         *
58
         * @return SubStores UnmodifiableBasicMap
59
         */
60
        public UnmodifiableBasicMap<String,DataStore> getChildren();
61

    
62
        public StoresRepository getStoresRepository();
63
        
64
        /**
65
         * Returns the resource store associated with this provider. 
66
         * If one does not exist, it will return null.
67
         * 
68
         * @return the ResourcesStorage or null.
69
         */
70
        public ResourcesStorage getResourcesStorage();
71
        /**
72
         * Create a {@link DataServerExplorer} from the same source that this store.
73
         *
74
         * @return ServerExplorer
75
         * @throws ReadException
76
         * @throws ValidateDataParametersException
77
         */
78
        public abstract DataServerExplorer getExplorer() throws ReadException,
79
                        ValidateDataParametersException;
80

    
81
        /**
82
         * Open store. You must call it before do anything whith store.<br>
83
         * This method can be called repeatly.
84
         *
85
         * @throws OpenException
86
         */
87
        public abstract void open() throws OpenException;
88

    
89
        /**
90
         * Request to close de source
91
         *
92
         * @throws CloseException
93
         */
94
        public abstract void close() throws CloseException;
95

    
96
        /**
97
         * Returns the {@link Resource} from where the data is being loaded.
98
         * 
99
         * @return the data {@link Resource}
100
         */
101
        ResourceProvider getResource();
102

    
103
        /**
104
         * Force to reload information of Store
105
         *
106
         * @throws OpenException
107
         * @throws InitializeException
108
         */
109
        public abstract void refresh() throws OpenException, InitializeException;
110

    
111
        /**
112
         * Returns the unique identifier of the Store
113
         *
114
         * FIXME add examples
115
         *
116
         * @return
117
         */
118
        public abstract Object getSourceId();
119

    
120
        /**
121
         * Return the name of the provider.
122
         * Examples: dbf, shp, jdbc, postgresql, wfs, gml
123
         * 
124
         * @return
125
         */
126
        public String getProviderName();
127

    
128
        /**
129
         * Returns the name associated to the provider.
130
         * This name is provided for informational purposes only.
131
         * Explamples:
132
         * 
133
         * In a dbf the filename without the path
134
         * 
135
         * In a DDBB table the name of the table
136
         * 
137
         * In a WFS layer the name of the layer.
138
         *
139
         * @return String containing this store's name.
140
         */
141
        public String getName();
142
        
143
        /**
144
         * Returns a more descriptive name for the provider that getName.
145
         * This name is provided for informational purposes only.
146
         * Explamples:
147
         * 
148
         * In a file based store may return the full name of the filename, path and filename.
149
         * 
150
         * In a data base based store may return "server:dbname:tablename"
151
         * 
152
         * In a WFS layer based store may return "server:layername"
153
         * 
154
         * @return String Containing the full name of the store
155
         */
156
        public String getFullName();
157
        
158
        /**
159
     * Gets the {@link Interval} of the store, that means the temporal
160
     * interval where the store has valid data.
161
     * @return
162
     *         a time interval or null if there is not time support
163
     */
164
    public Interval getInterval();
165
    
166
    /**
167
     * Gets all the possible values of time for which the store has data.  
168
     * @return
169
     *         a collection of {@link Time} objects.
170
     */
171
    public Collection getTimes();
172
    
173
    /**
174
     * Gets all the possible values of time for which the store has data
175
     * and intersects with an interval.
176
     * @param interval
177
     *         the interval of time
178
     * @return
179
     *         a collection of {@link Time} objects.
180
     */
181
    public Collection getTimes(Interval interval);
182
        
183
}