Revision 43020 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/DataManagerProviderServices.java
DataManagerProviderServices.java | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* Copyright (C) 2007-2013 gvSIG Association. |
5 | 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.
|
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
|
9 |
* version. |
|
10 | 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.
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
14 |
* details. |
|
15 | 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. |
|
16 |
* You should have received a copy of the GNU General Public License along with |
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
20 | 19 |
* |
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
23 | 22 |
*/ |
24 |
|
|
25 | 23 |
package org.gvsig.fmap.dal.spi; |
26 | 24 |
|
25 |
import java.io.InputStream; |
|
26 |
import java.net.URL; |
|
27 | 27 |
import org.gvsig.fmap.dal.DataManager; |
28 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
28 |
import org.gvsig.fmap.dal.DataServerExplorerFactory; |
|
29 |
import org.gvsig.fmap.dal.DataStoreFactory_v2_4; |
|
29 | 30 |
import org.gvsig.fmap.dal.DataStoreParameters; |
30 | 31 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
31 |
import org.gvsig.fmap.dal.DataTypes; |
|
32 |
import org.gvsig.fmap.dal.exception.DataException; |
|
32 |
import org.gvsig.fmap.dal.Register; |
|
33 | 33 |
import org.gvsig.fmap.dal.exception.InitializeException; |
34 | 34 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
35 | 35 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
36 | 36 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
37 | 37 |
import org.gvsig.fmap.dal.feature.FeatureType; |
38 |
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProvider; |
|
39 |
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProviderFactory; |
|
40 | 38 |
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices; |
41 |
import org.gvsig.tools.dynobject.DynObject; |
|
42 | 39 |
|
43 |
|
|
44 | 40 |
/** |
45 | 41 |
* Inteface of DataManager of Services for data providers |
46 | 42 |
* |
47 |
* @author jmvivo |
|
48 |
* |
|
49 | 43 |
*/ |
50 | 44 |
public interface DataManagerProviderServices extends DataManager { |
51 | 45 |
|
52 | 46 |
/** |
53 |
* |
|
54 |
* @param name |
|
55 |
* @param dataStoreProviderClass |
|
56 |
* @param parametersClass |
|
57 |
* @deprecated Use registerStoreProviderFactory |
|
47 |
* |
|
48 |
* Creates a new instance of the provider associated to the passed |
|
49 |
* parameters. |
|
50 |
* |
|
51 |
* @param providerServices |
|
52 |
* @param parameters |
|
53 |
* @return |
|
54 |
* @throws InitializeException |
|
55 |
* @throws ProviderNotRegisteredException |
|
58 | 56 |
*/ |
59 |
public void registerStoreProvider(String name, |
|
60 |
Class dataStoreProviderClass, |
|
61 |
Class parametersClass); |
|
62 |
|
|
63 |
/** |
|
64 |
* Registers a store factory. |
|
65 |
* @param name |
|
66 |
* @param storeFactoryClass |
|
67 |
*/ |
|
68 |
public void registerStoreFactory(String name, |
|
69 |
Class storeFactoryClass); |
|
57 |
public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException; |
|
70 | 58 |
|
71 |
/** |
|
72 |
* Register a new provider of data server explorer |
|
73 |
* |
|
74 |
* FIXME |
|
75 |
* |
|
76 |
* @param name |
|
77 |
* @param dataSourceClass |
|
78 |
* class of provider |
|
79 |
* @param parametersClass |
|
80 |
* parameters class of provider |
|
81 |
*/ |
|
82 |
public void registerExplorerProvider(String name, |
|
83 |
Class dataSourceClass, Class parametersClass); |
|
59 |
public void registerStoreProviderFactory(DataStoreProviderFactory factory); |
|
84 | 60 |
|
61 |
/** |
|
62 |
* Este metodo es temporal hasta que se integre el nuevo raster en el core |
|
63 |
* de gvSIG. |
|
64 |
* |
|
65 |
* @param rasterStoreClass |
|
66 |
*/ |
|
67 |
public void registerDefaultRasterStore(Class rasterStoreClass); |
|
85 | 68 |
|
86 | 69 |
/** |
87 |
* Registers a new feature index provider.
|
|
70 |
* Returns a DataIndexProvider compatible with the attribute data type.
|
|
88 | 71 |
* |
89 | 72 |
* @param name |
90 |
* provider's name |
|
91 |
* |
|
92 |
* @param description |
|
93 |
* provider's description |
|
94 |
* |
|
95 |
* @param clazz |
|
96 |
* a custom FeatureIndexProvider implementation |
|
97 |
* |
|
98 |
* @param dataType |
|
99 |
* one of the constants in {@link DataTypes}. This means that this provider |
|
100 |
* can build indexes based on attributes of this type. |
|
73 |
* @param store associated FeatureStore |
|
74 |
* @param type associated FeatureType |
|
75 |
* @param indexName |
|
76 |
* @param attr associated FeatureAttributeDescriptor |
|
77 |
* @return empty DataIndexProvider, initialized and ready to use |
|
78 |
* @throws org.gvsig.fmap.dal.exception.InitializeException |
|
79 |
* @throws org.gvsig.fmap.dal.exception.ProviderNotRegisteredException |
|
101 | 80 |
*/ |
102 |
public void registerFeatureIndexProvider(String name, String description, Class clazz, int dataType); |
|
81 |
public FeatureIndexProviderServices createFeatureIndexProvider(String name, FeatureStore store, FeatureType type, |
|
82 |
String indexName, |
|
83 |
FeatureAttributeDescriptor attr) throws InitializeException, |
|
84 |
ProviderNotRegisteredException; |
|
103 | 85 |
|
104 |
/** |
|
105 |
* Returns a DataIndexProvider compatible with the attribute data type. |
|
106 |
* |
|
107 |
* @param name |
|
108 |
* @param store |
|
109 |
* associated FeatureStore |
|
110 |
* @param type |
|
111 |
* associated FeatureType |
|
112 |
* @param indexName |
|
113 |
* @param attr |
|
114 |
* associated FeatureAttributeDescriptor |
|
115 |
* @return empty DataIndexProvider, initialized and ready to use |
|
116 |
* @throws org.gvsig.fmap.dal.exception.InitializeException |
|
117 |
* @throws org.gvsig.fmap.dal.exception.ProviderNotRegisteredException |
|
118 |
*/ |
|
119 |
public FeatureIndexProviderServices createFeatureIndexProvider(String name, FeatureStore store, FeatureType type, |
|
120 |
String indexName, |
|
121 |
FeatureAttributeDescriptor attr) throws InitializeException, |
|
122 |
ProviderNotRegisteredException; |
|
86 |
public void registerStoreFactory(DataStoreFactory_v2_4 factory); |
|
123 | 87 |
|
124 |
/** |
|
125 |
* Registers a new cache provider. |
|
126 |
* |
|
127 |
* |
|
128 |
* @param providerFactory |
|
129 |
*/ |
|
130 |
public void registerFeatureCacheProvider(FeatureCacheProviderFactory providerFactory); |
|
131 |
|
|
132 |
/** |
|
133 |
* Creates a FeatureCacheProvider from a name and the parameters to configure |
|
134 |
* its data server explorer. The cache provider creates new stores using the |
|
135 |
* {@link DataServerExplorerParameters}. |
|
136 |
* @param name provider's name. |
|
137 |
* @param parameters parameters used to create a explorer. |
|
138 |
* @return A cache provider |
|
139 |
* @throws DataException |
|
140 |
*/ |
|
141 |
public FeatureCacheProvider createFeatureCacheProvider(String name, DynObject parameters) throws DataException; |
|
88 |
public void registerServerExplorerFactory(DataServerExplorerFactory factory); |
|
142 | 89 |
|
90 |
/** |
|
91 |
* @param name |
|
92 |
* @param dataSourceClass class of provider |
|
93 |
* @param parametersClass parameters class of provider |
|
94 |
* @deprecated use registerServerExplorerFactory |
|
95 |
*/ |
|
96 |
public void registerExplorerProvider(String name, |
|
97 |
Class dataSourceClass, Class parametersClass); |
|
143 | 98 |
|
144 |
/** |
|
145 |
* |
|
146 |
* Creates a new instance of the provider associated to the passed parameters. |
|
147 |
* |
|
148 |
* @param providerServices |
|
149 |
* @param parameters |
|
150 |
* @return |
|
151 |
* @throws InitializeException |
|
152 |
* @throws ProviderNotRegisteredException |
|
153 |
*/ |
|
154 |
public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException; |
|
99 |
/** |
|
100 |
* Registers a store factory. |
|
101 |
* |
|
102 |
* @param name |
|
103 |
* @param storeFactoryClass |
|
104 |
* @deprecated use registerStoreFactory |
|
105 |
*/ |
|
106 |
public void registerStoreFactory(String name, |
|
107 |
Class storeFactoryClass); |
|
155 | 108 |
|
156 |
public void registerStoreProviderFactory(DataStoreProviderFactory factory); |
|
109 |
/** |
|
110 |
* Registers a store . |
|
111 |
* |
|
112 |
* @param name |
|
113 |
* @param dataStoreProviderClass |
|
114 |
* @param parametersClass |
|
115 |
* @deprecated use registerStoreFactory |
|
116 |
*/ |
|
117 |
public void registerStoreProvider(String name, |
|
118 |
Class dataStoreProviderClass, |
|
119 |
Class parametersClass); |
|
157 | 120 |
|
158 |
/** |
|
159 |
* Este metodo es temporal hasta que se integre el nuevo raster en el |
|
160 |
* core de gvSIG. |
|
161 |
* |
|
162 |
* @param rasterStoreClass |
|
163 |
*/ |
|
164 |
public void registerDefaultRasterStore(Class rasterStoreClass); |
|
121 |
/** |
|
122 |
* Return the URL associated to the indicated resource. If the data manager |
|
123 |
* has set a resource loader, use this to search the resource. If this don't |
|
124 |
* contain the indicated resource or the data manager has not set a resource |
|
125 |
* loader, search the resource in the class loader of the object |
|
126 |
* "resourceLoader" indicated as parameter. This is usefull to load the |
|
127 |
* resource files associateds to the xml of parameter and metadad |
|
128 |
* description. |
|
129 |
* |
|
130 |
* @param resourcesLoader |
|
131 |
* @param name |
|
132 |
* @return |
|
133 |
*/ |
|
134 |
public URL getResource(Object resourcesLoader, String name); |
|
135 |
|
|
136 |
/** |
|
137 |
* Return the InputStream associated to the indicated resource. If the data |
|
138 |
* manager has set a resource loader, use this to search the resource. If |
|
139 |
* this don't contain the indicated resource or the data manager has not set |
|
140 |
* a resource loader, search the resource in the class loader of the object |
|
141 |
* "resourceLoader" indicated as parameter. This is usefull to load the |
|
142 |
* resource files associateds to the xml of parameter and metadad |
|
143 |
* description. |
|
144 |
* |
|
145 |
* @param resourcesLoader |
|
146 |
* @param name |
|
147 |
* @return |
|
148 |
*/ |
|
149 |
public InputStream getResourceAsStream(Object resourcesLoader, String name); |
|
150 |
|
|
165 | 151 |
} |
Also available in: Unified diff