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 / DataManagerProviderServices.java @ 40596

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

    
25
package org.gvsig.fmap.dal.spi;
26

    
27
import org.gvsig.fmap.dal.DataManager;
28
import org.gvsig.fmap.dal.DataServerExplorerParameters;
29
import org.gvsig.fmap.dal.DataStoreParameters;
30
import org.gvsig.fmap.dal.DataStoreProviderFactory;
31
import org.gvsig.fmap.dal.DataTypes;
32
import org.gvsig.fmap.dal.exception.DataException;
33
import org.gvsig.fmap.dal.exception.InitializeException;
34
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
35
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
36
import org.gvsig.fmap.dal.feature.FeatureStore;
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
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices;
41
import org.gvsig.tools.dynobject.DynObject;
42

    
43

    
44
/**
45
 * Inteface of DataManager of Services for data providers
46
 *
47
 * @author jmvivo
48
 *
49
 */
50
public interface DataManagerProviderServices extends DataManager {
51

    
52
        public void registerStoreProvider(String name,
53
                        Class dataStoreProviderClass,
54
                        Class parametersClass);
55
        
56
        /**
57
         * Registers a store factory. 
58
         * @param name
59
         * @param dataStoreProviderClass
60
         * @param factoryClass
61
         */
62
        public void registerStoreFactory(String name,
63
                        Class storeFactoryClass);
64

    
65
        /**
66
         * Register a new provider of data server explorer
67
         *
68
         * FIXME
69
         *
70
         * @param <code>name</code> of de provider
71
         * @param dataSourceClass
72
         *            class of provider
73
         * @param parametersClass
74
         *            parameters class of provider
75
         */
76
        public void registerExplorerProvider(String name,
77
                        Class dataSourceClass, Class parametersClass);
78

    
79

    
80
    /**
81
     * Registers a new feature index provider.
82
     *
83
     * @param name
84
     *                         provider's name
85
     *
86
     * @param description
87
     *                         provider's description
88
     *
89
     * @param clazz
90
     *                         a custom FeatureIndexProvider implementation
91
     *
92
     * @param dataType
93
     *                         one of the constants in {@link DataTypes}. This means that this provider
94
     *                         can build indexes based on attributes of this type.
95
     */
96
        public void registerFeatureIndexProvider(String name, String description, Class clazz, int dataType);
97

    
98
        /**
99
         * Returns a DataIndexProvider compatible with the attribute data type.
100
         *
101
         * @param store
102
         *            associated FeatureStore
103
         * @param type
104
         *            associated FeatureType
105
         * @param attr
106
         *            associated FeatureAttributeDescriptor
107
         * @param providerNames
108
         *            array of strings containing one or more preferred providers
109
         * @return empty DataIndexProvider, initialized and ready to use
110
         */
111
        public FeatureIndexProviderServices createFeatureIndexProvider(String name, FeatureStore store, FeatureType type,
112
                        String indexName,
113
                        FeatureAttributeDescriptor attr) throws InitializeException,
114
                        ProviderNotRegisteredException;
115

    
116
         /**
117
     * Registers a new cache provider.
118
     *
119
     * @param name
120
     *                         provider's name
121
     *
122
     * @param description
123
     *                         provider's description
124
     *
125
     * @param clazz
126
     *                         a custom FeatureCacheProvider implementation
127
     */
128
         public void registerFeatureCacheProvider(FeatureCacheProviderFactory providerFactory);
129
                    
130
         /**
131
          * Creates a FeatureCacheProvider from a name and the parameters to configure 
132
          * its data server explorer. The cache provider creates new stores using the
133
          * {@link DataServerExplorerParameters}.
134
          * @param name provider's name.                   
135
          * @param parameters parameters used to create a explorer.
136
          * @return A cache provider
137
          * @throws DataException
138
          */
139
         public FeatureCacheProvider createFeatureCacheProvider(String name, DynObject parameters) throws DataException;
140

    
141

    
142
         /**
143
          *
144
          * Creates a new instance of the provider associated to the passed parameters.
145
          * 
146
          * @param store
147
          * @param parameters
148
          * @return
149
          * @throws InitializeException
150
          * @throws ProviderNotRegisteredException
151
          */
152
         public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException;         
153

    
154
         public void registerStoreProviderFactory(DataStoreProviderFactory factory);
155

    
156
}