Revision 36207 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/spi/index/FeatureIndexProviderServices.java

View differences:

FeatureIndexProviderServices.java
1 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
*/
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 22

  
23 23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 {{Company}}   {{Task}}
26
*/
27
 
24
 * AUTHORS (In addition to CIT):
25
 * 2008 {{Company}}   {{Task}}
26
 */
28 27

  
29 28
package org.gvsig.fmap.dal.feature.spi.index;
30 29

  
31 30
import org.gvsig.fmap.dal.exception.InitializeException;
32 31
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
33 32
import org.gvsig.fmap.dal.feature.FeatureIndex;
33
import org.gvsig.fmap.dal.feature.FeatureStoreNotification;
34 34
import org.gvsig.fmap.dal.feature.FeatureType;
35 35
import org.gvsig.fmap.dal.feature.exception.FeatureIndexException;
36 36
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices;
37
import org.gvsig.tools.observer.Observable;
37 38

  
38

  
39 39
/**
40
 * SPI for all index implementations
41
 * @author jyarza
42
 *
40
 * SPI for all index implementations.
41
 * 
42
 * This observable object provides notificationswhen the index has finished
43
 * filling with data and is available to be used. The observer will
44
 * receive then a {@link FeatureStoreNotification#INDEX_FILLED_SUCCESSFULLY}
45
 * notification, with the index object if it has finished
46
 * successfully, or a {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
47
 * notification with the exception object if there has been
48
 * any error in the process.
49
 * 
50
 * @see FeatureStoreNotification#INDEX_FILLED_SUCCESSFULLY
51
 * @see FeatureStoreNotification#INDEX_FILLING_ERROR
52
 * 
53
 * @author gvSIG team
43 54
 */
44
public interface FeatureIndexProviderServices extends FeatureIndex {
45
	
46
	/** Initializes this provider */
47
	public void initialize() throws InitializeException;
48
	
49
	/** Column to which belongs this index */
50
	public FeatureAttributeDescriptor getFeatureAttributeDescriptor();
51
	
52
	/** FeatureType to which belongs this index */
53
	public FeatureType getFeatureType();
54
	
55
	/** FeatureStore to which belongs this index */
56
	public FeatureStoreProviderServices getFeatureStoreProviderServices();
57
	
58
	/** Returns the absolute path (directory + filename) where this index is or will be stored */
59
	public String getFileName();
60
	
61
	/** Returns a temporary absolute path (directory + filename) according to the system environment */
62
	public String getTemporaryFileName();
63
	
64
	/** Calculates and returns a new filename for an index, using the given prefix and suffix */
65
	public String getNewFileName(String prefix, String sufix);
66
	
67
	/** Fills this index with the store's data */
68
	public void fill() throws FeatureIndexException;	
55
public interface FeatureIndexProviderServices extends FeatureIndex, Observable {
56

  
57
    /** Initializes this provider */
58
    public void initialize() throws InitializeException;
59

  
60
    /** Column to which belongs this index */
61
    public FeatureAttributeDescriptor getFeatureAttributeDescriptor();
62

  
63
    /** FeatureType to which belongs this index */
64
    public FeatureType getFeatureType();
65

  
66
    /** FeatureStore to which belongs this index */
67
    public FeatureStoreProviderServices getFeatureStoreProviderServices();
68

  
69
    /**
70
     * Returns the absolute path (directory + filename) where this index is or
71
     * will be stored
72
     */
73
    public String getFileName();
74

  
75
    /**
76
     * Returns a temporary absolute path (directory + filename) according to the
77
     * system environment
78
     */
79
    public String getTemporaryFileName();
80

  
81
    /**
82
     * Calculates and returns a new filename for an index, using the given
83
     * prefix and suffix
84
     */
85
    public String getNewFileName(String prefix, String sufix);
86

  
87
    /**
88
     * Fills this index with the store's data. This operation will not return
89
     * until the index has filled with all the store's data.
90
     * 
91
     * @throws FeatureIndexException
92
     *             if there is an error while filling the index
93
     */
94
    public void fill() throws FeatureIndexException;
95

  
96
    /**
97
     * Fills this index with the store's data.
98
     * 
99
     * @param background
100
     *            if the filling must be performed in background
101
     * 
102
     * @throws FeatureIndexException
103
     *             if there is an error while filling the index
104
     */
105
    public void fill(boolean background) throws FeatureIndexException;
106

  
107
    /**
108
     * Sets the index as valid or invalid, so it may be used or not.
109
     * 
110
     * @param valid
111
     *            status to set the index to
112
     */
113
    public void setValid(boolean valid);
69 114
}
70

  

Also available in: Unified diff