Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / spi / DataManagerProviderServices.java @ 33664

History | View | Annotate | Download (4.51 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.DataTypes;
33
import org.gvsig.fmap.dal.exception.DataException;
34
import org.gvsig.fmap.dal.exception.InitializeException;
35
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
36
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
37
import org.gvsig.fmap.dal.feature.FeatureStore;
38
import org.gvsig.fmap.dal.feature.FeatureType;
39
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProvider;
40
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProviderFactory;
41
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices;
42
import org.gvsig.tools.dynobject.DynObject;
43

    
44

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

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

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

    
80

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

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

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

    
144
}