svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / DataServerExplorer.java @ 40333
History | View | Annotate | Download (3.54 KB)
1 | 24496 | jmvivo | package org.gvsig.fmap.dal; |
---|---|---|---|
2 | 19399 | vcaballero | |
3 | 23894 | jjdelcerro | import java.util.List; |
4 | |||
5 | 24505 | jmvivo | import org.gvsig.fmap.dal.exception.DataException; |
6 | 31284 | cordinyana | import org.gvsig.tools.dispose.Disposable; |
7 | 23754 | jjdelcerro | |
8 | 24366 | jiyarza | /**
|
9 | 24874 | jmvivo | * DataServerExplorer is an abstraction for any type of data server. It allows
|
10 | 24568 | jmvivo | * connecting to the server and browsing its contents.
|
11 | *
|
||
12 | * More specifically, this interface provides a list of the available data
|
||
13 | * stores in a server.
|
||
14 | 24366 | jiyarza | */
|
15 | 31284 | cordinyana | public interface DataServerExplorer extends Disposable { |
16 | 19399 | vcaballero | |
17 | 24366 | jiyarza | /**
|
18 | 24874 | jmvivo | * Returns the DataServerExplorer's name
|
19 | 24568 | jmvivo | *
|
20 | 24874 | jmvivo | * @return String containing this DataServerExplorer's name
|
21 | 24366 | jiyarza | */
|
22 | 33717 | jjdelcerro | public String getProviderName(); |
23 | 24568 | jmvivo | |
24 | 24366 | jiyarza | /**
|
25 | 24874 | jmvivo | * Indicates whether this DataServerExplorer can create a new DataStore in the
|
26 | 24568 | jmvivo | * server.
|
27 | *
|
||
28 | 24874 | jmvivo | * @return true if this DataServerExplorer can be created or false otherwise.
|
29 | 24568 | jmvivo | */
|
30 | public boolean canAdd(); |
||
31 | |||
32 | /**
|
||
33 | 25785 | jmvivo | * Indicates whether this DataServerExplorer can create a new DataStore in
|
34 | * the server, given the store name.
|
||
35 | *
|
||
36 | 25482 | jiyarza | * @param storeName
|
37 | * store name.
|
||
38 | 25785 | jmvivo | *
|
39 | * @return true if this DataServerExplorer can create a new store or false
|
||
40 | * otherwise.
|
||
41 | *
|
||
42 | 24568 | jmvivo | * @throws DataException
|
43 | 24366 | jiyarza | */
|
44 | 24568 | jmvivo | public boolean canAdd(String storeName) |
45 | throws DataException;
|
||
46 | 19672 | vcaballero | |
47 | 24366 | jiyarza | /**
|
48 | 24384 | jiyarza | * Provides a list of available stores in the server.
|
49 | 24568 | jmvivo | *
|
50 | 24366 | jiyarza | * @return list of DataStoreParameters
|
51 | 24568 | jmvivo | *
|
52 | 24366 | jiyarza | * @throws DataException
|
53 | */
|
||
54 | public List list() throws DataException; |
||
55 | 20050 | jmvivo | |
56 | 25785 | jmvivo | public static final int MODE_ALL = 0; |
57 | public static final int MODE_FEATURE = 1; |
||
58 | 32880 | jjdelcerro | public static final int MODE_GEOMETRY = 2; |
59 | public static final int MODE_RASTER = 4; |
||
60 | 25785 | jmvivo | |
61 | 24366 | jiyarza | /**
|
62 | 25785 | jmvivo | * Provides a list of available stores in the server of a type.
|
63 | *
|
||
64 | * @param mode
|
||
65 | * , filter store from a type: {@link #MODE_ALL},
|
||
66 | * {@link #MODE_FEATURE}, {@link #MODE_FEATURE_GEOMETRY},
|
||
67 | * {@link #MODE_RASTER}
|
||
68 | *
|
||
69 | * @return list of DataStoreParameters
|
||
70 | *
|
||
71 | * @throws DataException
|
||
72 | */
|
||
73 | public List list(int mode) throws DataException; |
||
74 | |||
75 | /**
|
||
76 | 25813 | jiyarza | * Creates a new DataStore in this server.
|
77 | 25785 | jmvivo | *
|
78 | 24568 | jmvivo | * @param parameters
|
79 | * , an instance of DataStoreParameters from
|
||
80 | 25785 | jmvivo | * {@link DataServerExplorer#getAddParameters(String)} that
|
81 | * describes the new DataStore.
|
||
82 | 24568 | jmvivo | * @param overwrite
|
83 | * if the store already exists
|
||
84 | 25785 | jmvivo | *
|
85 | 24568 | jmvivo | * @return true if the DataStoreParameters were successfully added, false
|
86 | * otherwise.
|
||
87 | 25785 | jmvivo | *
|
88 | 24366 | jiyarza | * @throws DataException
|
89 | */
|
||
90 | 32880 | jjdelcerro | public boolean add(String provider, NewDataStoreParameters parameters, boolean overwrite) |
91 | 24017 | jjdelcerro | throws DataException;
|
92 | 20050 | jmvivo | |
93 | 24366 | jiyarza | /**
|
94 | 24568 | jmvivo | * Removes a store from the server given its DataStoreParameters. If the
|
95 | * store is a file then this method deletes the file, if it is a table in a
|
||
96 | * database then this method drops the table, and so on.
|
||
97 | *
|
||
98 | * @param parameters
|
||
99 | 24366 | jiyarza | * @throws DataException
|
100 | */
|
||
101 | 24017 | jjdelcerro | void remove(DataStoreParameters parameters) throws DataException; |
102 | 23894 | jjdelcerro | |
103 | 24366 | jiyarza | /**
|
104 | 24384 | jiyarza | * Given the store's name, returns its parameters for creation.
|
105 | 25785 | jmvivo | *
|
106 | 24366 | jiyarza | * @param storeName
|
107 | 25785 | jmvivo | *
|
108 | * @return parameters to create a store
|
||
109 | *
|
||
110 | 24709 | jmvivo | * @throws DataException
|
111 | 24366 | jiyarza | */
|
112 | 24709 | jmvivo | public NewDataStoreParameters getAddParameters(String storeName) |
113 | throws DataException;
|
||
114 | 24017 | jjdelcerro | |
115 | 24366 | jiyarza | /**
|
116 | 24874 | jmvivo | * Returns this DataServerExplorer parameters
|
117 | 24568 | jmvivo | *
|
118 | 24874 | jmvivo | * @return an instance of DataServerExplorerParameters containing this
|
119 | * DataServerExplorer parameters.
|
||
120 | 24366 | jiyarza | */
|
121 | 24874 | jmvivo | public DataServerExplorerParameters getParameters();
|
122 | 23339 | jmvivo | |
123 | 32880 | jjdelcerro | /**
|
124 | * Return the list of provider names that this server allow.
|
||
125 | *
|
||
126 | * @return List of provider names
|
||
127 | */
|
||
128 | public List getDataStoreProviderNames(); |
||
129 | |||
130 | 19399 | vcaballero | } |