root / trunk / extensions / extWCS / src / es / uji / lsi / wcs / client / Operation.java @ 1877
History | View | Annotate | Download (1.24 KB)
1 |
package es.uji.lsi.wcs.client; |
---|---|
2 |
/*
|
3 |
* Operation.java
|
4 |
*
|
5 |
* Created on 18 de enero de 2005, 14:08
|
6 |
*/
|
7 |
import java.util.*; |
8 |
/**
|
9 |
*
|
10 |
* @author jaume
|
11 |
*/
|
12 |
public class Operation { |
13 |
public static final int GET_CAPABILITIES = 0; |
14 |
public static final int DESCRIBE_COVERAGE = 1; |
15 |
public static final int GET_COVERAGE = 2; |
16 |
|
17 |
/** Creates a new instance of Operation */
|
18 |
public Operation() { |
19 |
} |
20 |
|
21 |
public static void setParam(int op_code, String param_name, String value, Hashtable parameters) throws Exception{ |
22 |
if (parameters.containsKey(param_name)) parameters.remove(param_name);
|
23 |
parameters.put(param_name, value); |
24 |
} |
25 |
|
26 |
public static String getParamsString(Hashtable parameters) throws Exception{ |
27 |
String s = "service="+parameters.get("service")+"&version="+parameters.get("version")+"&request="+parameters.get("request"); |
28 |
Enumeration e = parameters.keys();
|
29 |
while (e.hasMoreElements()){
|
30 |
String key = (String) e.nextElement(); |
31 |
if (!(key.equals("service")||key.equals("version")||key.equals("request"))) { |
32 |
s += "&"+key+"="+parameters.get(key); |
33 |
|
34 |
} |
35 |
} |
36 |
System.out.println("parametros: "+s); |
37 |
return "?"+s; |
38 |
} |
39 |
|
40 |
} |