Project

General

Profile

Download (1011 Bytes) Statistics
| Branch: | Tag: | Revision:
1
package org.bgbm.biovel.drf.checklist;
2

    
3
import java.util.Map;
4

    
5
import org.apache.http.client.utils.URIBuilder;
6

    
7
public class ChecklistURIBuilder extends URIBuilder {
8

    
9
	private String querykey;
10

    
11
	public ChecklistURIBuilder(String hostName,
12
			String endpointSuffix, 
13
			String key,
14
			Map<String, String> paramMap) {
15
		this.querykey = key;
16
		setScheme("http");
17
		setHost(hostName);
18
		setPath(endpointSuffix);		
19
		if(paramMap != null) {
20
			for (Map.Entry<String, String> entry : paramMap.entrySet()) {
21
				setParameter(entry.getKey(), entry.getValue());		    
22
			}
23
		}
24
	}
25
	
26
	public ChecklistURIBuilder(String hostName,
27
			String endpointUrl,
28
			Map<String, String> paramMap) {
29
		//this.querykey = key;
30
		setScheme("http");
31
		setHost(hostName);
32
		setPath(endpointUrl);		
33
		if(paramMap != null) {
34
			for (Map.Entry<String, String> entry : paramMap.entrySet()) {
35
				setParameter(entry.getKey(), entry.getValue());		    
36
			}
37
		}
38
	}
39
	
40
	public void addQuery(String query) {
41
		addParameter(querykey, query);		 
42
	}
43
	
44
}
(4-4/8)