Project

General

Profile

1
package eu.dnetlib.clients.index.client;
2

    
3
import java.util.Map;
4

    
5
import eu.dnetlib.clients.index.query.IndexQueryFactory;
6
import eu.dnetlib.utils.MetadataReference;
7
import eu.dnetlib.index.cql.CqlValueTransformerMap;
8

    
9
public abstract class AbstractIndexClient implements IndexClient {
10

    
11
	protected static String INDEX_HOST = "host";
12
	protected static String INDEX_PORT = "port";
13
	protected static String INDEX_BACKEND_ID = "id";
14
	protected static String ZK_ADDRESS = "address";
15
	protected Map<String, String> serviceProperties;
16
	/**
17
	 * The format.
18
	 */
19
	private String format;
20
	/**
21
	 * The layout.
22
	 */
23
	private String layout;
24
	/**
25
	 * The interpretation.
26
	 */
27
	private String interpretation;
28

    
29
	public AbstractIndexClient(final String format, final String layout, final String interpretation, final Map<String, String> serviceProperties) {
30
		this.format = format;
31
		this.layout = layout;
32
		this.interpretation = interpretation;
33
		this.serviceProperties = serviceProperties;
34
	}
35

    
36
	public abstract CqlValueTransformerMap getCqlValueTransformerMap(MetadataReference mdRef) throws IndexClientException;
37

    
38
	public abstract IndexQueryFactory getIndexQueryFactory();
39

    
40
	/**
41
	 * Gets the format.
42
	 *
43
	 * @return the format
44
	 */
45
	public String getFormat() {
46
		return format;
47
	}
48

    
49
	/**
50
	 * Sets the format.
51
	 *
52
	 * @param format the format
53
	 */
54
	public void setFormat(final String format) {
55
		this.format = format;
56
	}
57

    
58
	/**
59
	 * Gets the layout.
60
	 *
61
	 * @return the layout
62
	 */
63
	public String getLayout() {
64
		return layout;
65
	}
66

    
67
	/**
68
	 * Sets the layout.
69
	 *
70
	 * @param layout the layout
71
	 */
72
	public void setLayout(final String layout) {
73
		this.layout = layout;
74
	}
75

    
76
	/**
77
	 * Gets the interpretation.
78
	 *
79
	 * @return the interpretation
80
	 */
81
	public String getInterpretation() {
82
		return interpretation;
83
	}
84

    
85
	/**
86
	 * Sets the interpretation.
87
	 *
88
	 * @param interpretation the interpretation
89
	 */
90
	public void setInterpretation(final String interpretation) {
91
		this.interpretation = interpretation;
92
	}
93

    
94
	public Map<String, String> getServiceProperties() {
95
		return serviceProperties;
96
	}
97

    
98
	public void setServiceProperties(final Map<String, String> serviceProperties) {
99
		this.serviceProperties = serviceProperties;
100
	}
101

    
102
}
(1-1/6)