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

History | View | Annotate | Download (4.92 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.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_v2;
41
import org.gvsig.tools.util.UnmodifiableBasicMap;
42

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

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

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

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

    
78
        /**
79
         * Request to close de source
80
         *
81
         * @throws CloseException
82
         */
83
        public abstract void close() throws CloseException;
84

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

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

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

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

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