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 @ 45650

History | View | Annotate | Download (5.46 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.DataTransaction;
31
import org.gvsig.fmap.dal.StoresRepository;
32
import org.gvsig.fmap.dal.exception.CloseException;
33
import org.gvsig.fmap.dal.exception.InitializeException;
34
import org.gvsig.fmap.dal.exception.OpenException;
35
import org.gvsig.fmap.dal.exception.ReadException;
36
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
37
import org.gvsig.fmap.dal.resource.Resource;
38
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
39
import org.gvsig.timesupport.Interval;
40
import org.gvsig.timesupport.Time;
41
import org.gvsig.tools.dispose.Disposable;
42
import org.gvsig.tools.dynobject.DynObject_v2;
43
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
44
import org.gvsig.tools.util.UnmodifiableBasicMap;
45

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

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

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

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

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

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

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

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

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

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