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

History | View | Annotate | Download (5.08 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 IVER T.I. S.A.   {{Task}}
26
 */
27

    
28
package org.gvsig.fmap.dal.spi;
29

    
30
import org.gvsig.fmap.dal.DataManager;
31
import org.gvsig.fmap.dal.DataServerExplorerParameters;
32
import org.gvsig.fmap.dal.DataStoreParameters;
33
import org.gvsig.fmap.dal.DataStoreProviderFactory;
34
import org.gvsig.fmap.dal.DataTypes;
35
import org.gvsig.fmap.dal.exception.DataException;
36
import org.gvsig.fmap.dal.exception.InitializeException;
37
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
38
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
39
import org.gvsig.fmap.dal.feature.FeatureStore;
40
import org.gvsig.fmap.dal.feature.FeatureType;
41
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProvider;
42
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProviderFactory;
43
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices;
44
import org.gvsig.tools.dynobject.DynObject;
45

    
46

    
47
/**
48
 * Inteface of DataManager of Services for data providers
49
 *
50
 * @author jmvivo
51
 *
52
 */
53
public interface DataManagerProviderServices extends DataManager {
54

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

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

    
82

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

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

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

    
144

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

    
157
         public void registerStoreProviderFactory(DataStoreProviderFactory factory);
158

    
159
}