Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.1
- Added support to pass validation properties.

## 2.2.0
- Added a new abstract method to support new routing key template of Sepia.

Expand Down
9 changes: 7 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
<parent>
<groupId>com.github.eiffel-community</groupId>
<artifactId>eiffel-remrem-parent</artifactId>
<version>2.0.8</version>
<version>2.0.18</version>
</parent>
<artifactId>eiffel-remrem-protocol-interface</artifactId>
<version>2.2.0</version>
<version>2.2.1</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<repositories>
<repository>
<id>jitpack.io</id>
Expand Down
31 changes: 28 additions & 3 deletions src/main/java/com/ericsson/eiffel/remrem/protocol/MsgService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
package com.ericsson.eiffel.remrem.protocol;

import java.util.Collection;
import java.util.HashMap;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

public interface MsgService {
String LENIENT_VALIDATION = "lenientValidation";

/**
* Generate takes a partial message in JSON format,
Expand All @@ -38,11 +40,23 @@ public interface MsgService {
*
* @param msgType
* @param jsonMessage
* @param lenientValidation
* @param lenientValidation perform the only mandatory field validation and non-mandatory validation failures will
* place in Eiffel message as a new property(remremGenerateFailures)
* @return the generated and validate Eiffel messages as json String
*/
String generateMsg(String msgType, JsonObject jsonMessage, Boolean lenientValidation);

/**
* Generate takes a partial message in JSON format,
* validates it and adds mandatory fields before outputting a complete, valid Eiffel message.
*
* @param msgType
* @param jsonMessage
* @param validationProperties Available properties are implementation-specific.
* @return the generated and validate Eiffel messages as json String
*/
String generateMsg(String msgType, JsonObject jsonMessage, HashMap<String, Object> validationProperties);

/**
* Returns the Event Id from json formatted eiffel message.
*
Expand Down Expand Up @@ -94,17 +108,28 @@ public interface MsgService {
* @param jsonvalidateMessage
* @return ValidationResult with true if validation is success, if validation fails ValidationResult has false and validation message property's.
*/

ValidationResult validateMsg(String msgType, JsonObject jsonvalidateMessage);

/**
* Method validates the jsonObject based on the event message type.
* @param JsonObject bodyJson
* @param jsonvalidateMessage
* @param lenientValidation
* @return ValidationResult with true if validation is success, if validation fails ValidationResult has false and validation message property's.
* @return ValidationResult with true if validation is success, if validation fails ValidationResult has false
* and validation message property's.
*/
ValidationResult validateMsg(String msgType, JsonObject jsonvalidateMessage, Boolean lenientValidation);

/**
* Method validates the jsonObject based on the event message type.
* @param JsonObject bodyJson
* @param jsonvalidateMessage
* @param validationProperties Available properties are implementation-specific.
* @return ValidationResult with true if validation is success, if validation fails ValidationResult has false
* and validation message property's.
*/
ValidationResult validateMsg(String msgType, JsonObject jsonvalidateMessage, HashMap<String, Object> validationProperties);

/**
* Returns Routing key from the messaging library based on the eiffel message eventType.<br>
* In general, Routing key of eiffel message is in the format<br>
Expand Down