Project

General

Profile

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

    
3
import java.util.Map;
4

    
5
import eu.dnetlib.functionality.index.cql.CqlValueTransformerMap;
6
import eu.dnetlib.functionality.index.query.IndexQueryFactory;
7
import eu.dnetlib.functionality.index.utils.MetadataReference;
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

    
16
	/** The format. */
17
	private String format;
18

    
19
	/** The layout. */
20
	private String layout;
21

    
22
	/** The interpretation. */
23
	private String interpretation;
24

    
25
	protected Map<String, String> serviceProperties;
26

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

    
34
	public abstract CqlValueTransformerMap getCqlValueTransformerMap(MetadataReference mdRef) throws IndexClientException;
35

    
36
	public abstract IndexQueryFactory getIndexQueryFactory();
37

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

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

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

    
66
	/**
67
	 * Sets the layout.
68
	 *
69
	 * @param layout
70
	 *            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
89
	 *            the interpretation
90
	 */
91
	public void setInterpretation(final String interpretation) {
92
		this.interpretation = interpretation;
93
	}
94

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

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

    
103
}
(1-1/6)