1515package com .ericsson .eiffel .remrem .protocol ;
1616
1717import java .util .Collection ;
18+ import java .util .HashMap ;
1819
1920import com .google .gson .JsonElement ;
2021import com .google .gson .JsonObject ;
2122
2223public interface MsgService {
24+ String LENIENT_VALIDATION = "lenientValidation" ;
2325
2426 /**
2527 * Generate takes a partial message in JSON format,
@@ -38,11 +40,23 @@ public interface MsgService {
3840 *
3941 * @param msgType
4042 * @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)
4245 * @return the generated and validate Eiffel messages as json String
4346 */
4447 String generateMsg (String msgType , JsonObject jsonMessage , Boolean lenientValidation );
4548
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+
4660 /**
4761 * Returns the Event Id from json formatted eiffel message.
4862 *
@@ -94,17 +108,28 @@ public interface MsgService {
94108 * @param jsonvalidateMessage
95109 * @return ValidationResult with true if validation is success, if validation fails ValidationResult has false and validation message property's.
96110 */
97-
98111 ValidationResult validateMsg (String msgType , JsonObject jsonvalidateMessage );
112+
99113 /**
100114 * Method validates the jsonObject based on the event message type.
101115 * @param JsonObject bodyJson
102116 * @param jsonvalidateMessage
103117 * @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.
105120 */
106121 ValidationResult validateMsg (String msgType , JsonObject jsonvalidateMessage , Boolean lenientValidation );
107122
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+
108133 /**
109134 * Returns Routing key from the messaging library based on the eiffel message eventType.<br>
110135 * In general, Routing key of eiffel message is in the format<br>
0 commit comments