aboutsummaryrefslogtreecommitdiffstats
path: root/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java
diff options
context:
space:
mode:
Diffstat (limited to 'UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java')
-rw-r--r--UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java
index 14c5a83..1e6006a 100644
--- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java
+++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/AdapterService.java
@@ -17,16 +17,17 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+package org.onap.universalvesadapter.service;
-package org.onap.universalvesadapter.service;
-
+import org.onap.universalvesadapter.exception.MapperConfigException;
+import org.onap.universalvesadapter.utils.MapperConfigUtils;
//import org.onap.universalvesadapter.adapter.GenericAdapter;
//import org.onap.universalvesadapter.adapter.UniversalEventAdapter;
//import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
- * This service is written to identify the different type of events
+ * This service is written to identify the different type of events
*
* @author kmalbari
*
@@ -34,12 +35,11 @@ import org.springframework.stereotype.Component;
@Component
public class AdapterService {
- /*@Autowired
- private UniversalEventAdapter snmpTrapEventAdapter;
- public GenericAdapter identifyIncomingJsonFormatAndReturnAdapter() {
- return snmpTrapEventAdapter;
- }*/
-
+ /*
+ * @Autowired private UniversalEventAdapter snmpTrapEventAdapter; public
+ * GenericAdapter identifyIncomingJsonFormatAndReturnAdapter() { return
+ * snmpTrapEventAdapter; }
+ */
/**
* Identifies eventype by parsing the incoming json file.
@@ -47,11 +47,13 @@ public class AdapterService {
* @param incomingJsonString
*
* @return the event type
+ * @throws MapperConfigException
+ * if mapper config did not perform correctly
*/
- public String identifyEventTypeFromIncomingJson(String incomingJsonString) {
-
- //TODO A proper logic to identify diffeent events is needed here
- return "snmp";
+ public String identifyEventTypeFromIncomingJson(String incomingJsonString) throws MapperConfigException {
+
+ // TODO A proper logic to identify diffeent events is needed here
+ return MapperConfigUtils.checkIncomingJsonForMatchingDomain(incomingJsonString);
}
}