/
InitializerService.java
107 lines (89 loc) · 2.97 KB
/
InitializerService.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.module.initializer.api;
import java.io.InputStream;
import java.util.List;
import org.openmrs.Concept;
import org.openmrs.PersonAttributeType;
import org.openmrs.api.OpenmrsService;
import org.openmrs.module.initializer.api.loaders.Loader;
public interface InitializerService extends OpenmrsService {
/**
* @return The path to the configuration folder (with NO trailing forward slash), eg.
* "/opt/openmrs/configuration"
*/
String getConfigDirPath();
/**
* @return The path to the checksum folder (with NO trailing forward slash), eg.
* "/opt/openmrs/configuration_checksums"
*/
String getChecksumsDirPath();
/**
* @return The path to the checksum folder (with NO trailing forward slash), eg.
* "/opt/openmrs/configuration_rejections"
*/
String getRejectionsDirPath();
/**
* @return The list of ordered domain loaders.
*/
List<Loader> getLoaders();
/**
* Loads all domains based on each domain's order.
*
* @param applyFilters Set this to false to ignore the inclusion or exclusion list and the
* domain-specific file name wildcard filters.
*/
void load(boolean applyFilters);
/**
* Add a single key value to the memory store.
*
* @param key
* @param value
*/
void addKeyValue(String key, String value);
/**
* Adds a key values file to the memory store.
*
* @param is A JSON key-values file as input stream.
*/
void addKeyValues(InputStream is) throws Exception;
/**
* Fetches a value from the JSON key-value configuration.
*/
String getValueFromKey(String key);
/**
* Guesses a concept from the JSON key-value configuration.
*/
Concept getConceptFromKey(String key, Concept defaultInstance);
/**
* Guesses a concept from the JSON key-value configuration.
*/
Concept getConceptFromKey(String key);
/**
* Guesses a list of concepts from the JSON key-value configuration.
*/
List<Concept> getConceptsFromKey(String key);
/**
* Guesses a person attribute type from the JSON key-value configuration.
*/
PersonAttributeType getPersonAttributeTypeFromKey(String key, PersonAttributeType defaultInstance);
/**
* Guesses a person attribute type from the JSON key-value configuration.
*/
PersonAttributeType getPersonAttributeTypeFromKey(String key);
/**
* Guesses a boolean from the JSON key-value configuration.
*/
Boolean getBooleanFromKey(String key, Boolean defaultInstance);
/**
* Guesses a boolean from the JSON key-value configuration.
*/
Boolean getBooleanFromKey(String key);
}