svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / DataServerExplorer.java @ 25482
History | View | Annotate | Download (2.88 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, given the store name.
|
34 |
*
|
35 |
* @param storeName
|
36 |
* store name.
|
37 |
*
|
38 |
* @return
|
39 |
* true if this DataServerExplorer can create a new store or false otherwise.
|
40 |
*
|
41 |
* @throws DataException
|
42 |
*/
|
43 |
public boolean canAdd(String storeName) |
44 |
throws DataException;
|
45 |
|
46 |
/**
|
47 |
* Provides a list of available stores in the server.
|
48 |
*
|
49 |
* @return list of DataStoreParameters
|
50 |
*
|
51 |
* @throws DataException
|
52 |
*/
|
53 |
public List list() throws DataException; |
54 |
|
55 |
/**
|
56 |
* Creates new DataStore in this server.
|
57 |
*
|
58 |
* @param parameters
|
59 |
* , an instance of DataStoreParameters from
|
60 |
* {@link DataServerExplorer#getAddParameters(String)} that describes
|
61 |
* the new DataStore.
|
62 |
* @param overwrite
|
63 |
* if the store already exists
|
64 |
*
|
65 |
* @return true if the DataStoreParameters were successfully added, false
|
66 |
* otherwise.
|
67 |
*
|
68 |
* @throws DataException
|
69 |
*/
|
70 |
public boolean add(NewDataStoreParameters parameters, boolean overwrite) |
71 |
throws DataException;
|
72 |
|
73 |
/**
|
74 |
* Removes a store from the server given its DataStoreParameters. If the
|
75 |
* store is a file then this method deletes the file, if it is a table in a
|
76 |
* database then this method drops the table, and so on.
|
77 |
*
|
78 |
* @param parameters
|
79 |
* @throws DataException
|
80 |
*/
|
81 |
void remove(DataStoreParameters parameters) throws DataException; |
82 |
|
83 |
/**
|
84 |
* Given the store's name, returns its parameters for creation.
|
85 |
*
|
86 |
* @param storeName
|
87 |
*
|
88 |
* @return
|
89 |
* parameters to create a store
|
90 |
*
|
91 |
* @throws DataException
|
92 |
*/
|
93 |
public NewDataStoreParameters getAddParameters(String storeName) |
94 |
throws DataException;
|
95 |
|
96 |
/**
|
97 |
* Frees the resources used by this DataServerExplorer.
|
98 |
*
|
99 |
* @throws DataException
|
100 |
*/
|
101 |
public void dispose() throws DataException; |
102 |
|
103 |
/**
|
104 |
* Returns this DataServerExplorer parameters
|
105 |
*
|
106 |
* @return an instance of DataServerExplorerParameters containing this
|
107 |
* DataServerExplorer parameters.
|
108 |
*/
|
109 |
public DataServerExplorerParameters getParameters();
|
110 |
|
111 |
} |