root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / DataServerExplorer.java @ 24874
History | View | Annotate | Download (2.82 KB)
1 |
package org.gvsig.fmap.dal; |
---|---|
2 |
|
3 |
import java.util.List; |
4 |
|
5 |
import org.gvsig.fmap.dal.exception.DataException; |
6 |
|
7 |
/**
|
8 |
* DataServerExplorer is an abstraction for any type of data server. It allows
|
9 |
* connecting to the server and browsing its contents.
|
10 |
*
|
11 |
* More specifically, this interface provides a list of the available data
|
12 |
* stores in a server.
|
13 |
*/
|
14 |
public interface DataServerExplorer { |
15 |
|
16 |
/**
|
17 |
* Returns the DataServerExplorer's name
|
18 |
*
|
19 |
* @return String containing this DataServerExplorer's name
|
20 |
*/
|
21 |
public String getName(); |
22 |
|
23 |
/**
|
24 |
* Indicates whether this DataServerExplorer can create a new DataStore in the
|
25 |
* server.
|
26 |
*
|
27 |
* @return true if this DataServerExplorer can be created or false otherwise.
|
28 |
*/
|
29 |
public boolean canAdd(); |
30 |
|
31 |
/**
|
32 |
* Indicates whether this DataServerExplorer can create a new DataStore in the
|
33 |
* server.
|
34 |
*
|
35 |
* @param parameters
|
36 |
* , an instance of DataStoreParameters.
|
37 |
*
|
38 |
* @return true if this DataServerExplorer can be created or false otherwise.
|
39 |
* @throws DataException
|
40 |
*/
|
41 |
public boolean canAdd(String storeName) |
42 |
throws DataException;
|
43 |
|
44 |
/**
|
45 |
* Provides a list of available stores in the server.
|
46 |
*
|
47 |
* @return list of DataStoreParameters
|
48 |
*
|
49 |
* @throws DataException
|
50 |
*/
|
51 |
public List list() throws DataException; |
52 |
|
53 |
/**
|
54 |
* Creates new DataStore in this server.
|
55 |
*
|
56 |
* @param parameters
|
57 |
* , an instance of DataStoreParameters from
|
58 |
* {@link DataServerExplorer#getAddParameters(String)} that describes
|
59 |
* the new DataStore.
|
60 |
* @param overwrite
|
61 |
* if the store already exists
|
62 |
*
|
63 |
* @return true if the DataStoreParameters were successfully added, false
|
64 |
* otherwise.
|
65 |
*
|
66 |
* @throws DataException
|
67 |
*/
|
68 |
public boolean add(NewDataStoreParameters parameters, boolean overwrite) |
69 |
throws DataException;
|
70 |
|
71 |
/**
|
72 |
* Removes a store from the server given its DataStoreParameters. If the
|
73 |
* store is a file then this method deletes the file, if it is a table in a
|
74 |
* database then this method drops the table, and so on.
|
75 |
*
|
76 |
* @param parameters
|
77 |
* @throws DataException
|
78 |
*/
|
79 |
void remove(DataStoreParameters parameters) throws DataException; |
80 |
|
81 |
/**
|
82 |
* Given the store's name, returns its parameters for creation.
|
83 |
*
|
84 |
* @param storeName
|
85 |
* @return
|
86 |
* @throws DataException
|
87 |
*/
|
88 |
public NewDataStoreParameters getAddParameters(String storeName) |
89 |
throws DataException;
|
90 |
|
91 |
/**
|
92 |
* Frees the resources used by this DataServerExplorer.
|
93 |
*
|
94 |
* @throws DataException
|
95 |
*/
|
96 |
public void dispose() throws DataException; |
97 |
|
98 |
/**
|
99 |
* Returns this DataServerExplorer parameters
|
100 |
*
|
101 |
* @return an instance of DataServerExplorerParameters containing this
|
102 |
* DataServerExplorer parameters.
|
103 |
*/
|
104 |
public DataServerExplorerParameters getParameters();
|
105 |
|
106 |
} |