-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCombinedPropertyDataLoader.java
More file actions
49 lines (37 loc) · 1.19 KB
/
CombinedPropertyDataLoader.java
File metadata and controls
49 lines (37 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
*
*/
package com.tangoe.components;
import java.util.HashMap;
import java.util.Map;
/**
* @author ankitkumar
*
*/
public class CombinedPropertyDataLoader implements PropertyDataLoader {
private JDBCPropertyDataLoader jdbcPropertyDataLoader;
private FilePropertyDataLoader filePropertyDataLoader;
public CombinedPropertyDataLoader(JDBCPropertyDataLoader jdbcPropertyDataLoader,
FilePropertyDataLoader filePropertyDataLoader) {
this.jdbcPropertyDataLoader = jdbcPropertyDataLoader;
this.filePropertyDataLoader = filePropertyDataLoader;
}
@Override
public void startLoading() {
jdbcPropertyDataLoader.startLoading();
filePropertyDataLoader.startLoading();
}
@Override
public void stopLoading() {
jdbcPropertyDataLoader.stopLoading();
filePropertyDataLoader.stopLoading();
}
@Override
public Map<String, String> getProps() {
Map<String, String> props = new HashMap<>();
//Database property takes precedence in case of clash.
props.putAll(filePropertyDataLoader.getProps());
props.putAll(jdbcPropertyDataLoader.getProps());
return props;
}
}