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

History | View | Annotate | Download (5.03 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.util.UnmodifiableBasicMap;
43

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

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

    
61
        public StoresRepository getStoresRepository();
62
        
63
        /**
64
         * Create a {@link DataServerExplorer} from the same source that this store.
65
         *
66
         * @return ServerExplorer
67
         * @throws ReadException
68
         * @throws ValidateDataParametersException
69
         */
70
        public abstract DataServerExplorer getExplorer() throws ReadException,
71
                        ValidateDataParametersException;
72

    
73
        /**
74
         * Open store. You must call it before do anything whith store.<br>
75
         * This method can be called repeatly.
76
         *
77
         * @throws OpenException
78
         */
79
        public abstract void open() throws OpenException;
80

    
81
        /**
82
         * Request to close de source
83
         *
84
         * @throws CloseException
85
         */
86
        public abstract void close() throws CloseException;
87

    
88
        /**
89
         * Returns the {@link Resource} from where the data is being loaded.
90
         * 
91
         * @return the data {@link Resource}
92
         */
93
        ResourceProvider getResource();
94

    
95
        /**
96
         * Force to reload information of Store
97
         *
98
         * @throws OpenException
99
         * @throws InitializeException
100
         */
101
        public abstract void refresh() throws OpenException, InitializeException;
102

    
103
        /**
104
         * Returns the unique identifier of the Store
105
         *
106
         * FIXME add examples
107
         *
108
         * @return
109
         */
110
        public abstract Object getSourceId();
111

    
112
        /**
113
         * Return the name of the provider.
114
         * Examples: dbf, shp, jdbc, postgresql, wfs, gml
115
         * 
116
         * @return
117
         */
118
        public String getProviderName();
119

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