15
15
package com .ericsson .eiffel .remrem .protocol ;
16
16
17
17
import java .util .Collection ;
18
+ import java .util .HashMap ;
18
19
19
20
import com .google .gson .JsonElement ;
20
21
import com .google .gson .JsonObject ;
21
22
22
23
public interface MsgService {
24
+ String LENIENT_VALIDATION = "lenientValidation" ;
23
25
24
26
/**
25
27
* Generate takes a partial message in JSON format,
@@ -38,11 +40,23 @@ public interface MsgService {
38
40
*
39
41
* @param msgType
40
42
* @param jsonMessage
41
- * @param lenientValidation
43
+ * @param lenientValidation perform the only mandatory field validation and non-mandatory validation failures will
44
+ * place in Eiffel message as a new property(remremGenerateFailures)
42
45
* @return the generated and validate Eiffel messages as json String
43
46
*/
44
47
String generateMsg (String msgType , JsonObject jsonMessage , Boolean lenientValidation );
45
48
49
+ /**
50
+ * Generate takes a partial message in JSON format,
51
+ * validates it and adds mandatory fields before outputting a complete, valid Eiffel message.
52
+ *
53
+ * @param msgType
54
+ * @param jsonMessage
55
+ * @param validationProperties Available properties are implementation-specific.
56
+ * @return the generated and validate Eiffel messages as json String
57
+ */
58
+ String generateMsg (String msgType , JsonObject jsonMessage , HashMap <String , Object > validationProperties );
59
+
46
60
/**
47
61
* Returns the Event Id from json formatted eiffel message.
48
62
*
@@ -94,17 +108,28 @@ public interface MsgService {
94
108
* @param jsonvalidateMessage
95
109
* @return ValidationResult with true if validation is success, if validation fails ValidationResult has false and validation message property's.
96
110
*/
97
-
98
111
ValidationResult validateMsg (String msgType , JsonObject jsonvalidateMessage );
112
+
99
113
/**
100
114
* Method validates the jsonObject based on the event message type.
101
115
* @param JsonObject bodyJson
102
116
* @param jsonvalidateMessage
103
117
* @param lenientValidation
104
- * @return ValidationResult with true if validation is success, if validation fails ValidationResult has false and validation message property's.
118
+ * @return ValidationResult with true if validation is success, if validation fails ValidationResult has false
119
+ * and validation message property's.
105
120
*/
106
121
ValidationResult validateMsg (String msgType , JsonObject jsonvalidateMessage , Boolean lenientValidation );
107
122
123
+ /**
124
+ * Method validates the jsonObject based on the event message type.
125
+ * @param JsonObject bodyJson
126
+ * @param jsonvalidateMessage
127
+ * @param validationProperties Available properties are implementation-specific.
128
+ * @return ValidationResult with true if validation is success, if validation fails ValidationResult has false
129
+ * and validation message property's.
130
+ */
131
+ ValidationResult validateMsg (String msgType , JsonObject jsonvalidateMessage , HashMap <String , Object > validationProperties );
132
+
108
133
/**
109
134
* Returns Routing key from the messaging library based on the eiffel message eventType.<br>
110
135
* In general, Routing key of eiffel message is in the format<br>
0 commit comments