X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ves-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Fvesagent%2Fcontroller%2FVESAgentService.java;fp=ves-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Fvesagent%2Fcontroller%2FVESAgentService.java;h=9a1ec07a04efecfec7003857d516f80a1bb11b40;hb=641a6c47b4ee74412e9386b3c95693adda3cafc9;hp=18361636d370482dabfc07474e265877e18ef62c;hpb=8c7432b8380a355e89df05f070e7d88e599912fd;p=oam%2Ftr069-adapter.git diff --git a/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/controller/VESAgentService.java b/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/controller/VESAgentService.java index 1836163..9a1ec07 100644 --- a/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/controller/VESAgentService.java +++ b/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/controller/VESAgentService.java @@ -20,11 +20,15 @@ package org.commscope.tr069adapter.vesagent.controller; import com.fasterxml.jackson.core.JsonProcessingException; +import org.commscope.tr069adapter.acs.common.DeviceRPCRequest; +import org.commscope.tr069adapter.acs.common.DeviceRPCResponse; import org.commscope.tr069adapter.acs.common.inform.BootstrapInform; +import org.commscope.tr069adapter.acs.common.inform.ConnectionRequestInform; import org.commscope.tr069adapter.acs.common.inform.PeriodicInform; import org.commscope.tr069adapter.acs.common.inform.ValueChangeInform; import org.commscope.tr069adapter.mapper.model.VESNotification; import org.commscope.tr069adapter.mapper.model.VESNotificationResponse; +import org.commscope.tr069adapter.vesagent.async.WaitForNotifications; import org.commscope.tr069adapter.vesagent.exception.InvalidFaultOperationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,6 +53,9 @@ public class VESAgentService { @Autowired HeartBeatMessageHandler hbHandler; + @Autowired + WaitForNotifications waitForNotifications; + @PostMapping(path = "/deviceEvent", consumes = "application/json") public VESNotificationResponse processDeviceNotificationAsVESEvent( @RequestBody VESNotification notification) @@ -61,15 +68,20 @@ public class VESAgentService { } else if (notification.getDevnotification() instanceof BootstrapInform) { logger.debug("VES Notification request PnfRegister processing started"); response = pnfHandler.handlePnfRegNotification(notification); + hbHandler.handleRegisterRequest(notification); logger.debug("VES Notification request PnfRegister processing completed"); } else if (notification.getDevnotification() instanceof ValueChangeInform) { logger.debug("VES Notification request Fault processing started"); response = alarmHanler.handleAlarmNotification(notification); + waitForNotifications.notifyDeviceNotification(notification); logger.debug("VES Notification request Fault processing completed"); } else if (notification.getDevnotification() instanceof PeriodicInform) { logger.debug("VES Notification request PI processing started"); - response = hbHandler.handlePINotification(notification); + waitForNotifications.notifyDeviceNotification(notification); logger.debug("VES Notification request PI processing completed"); + } else if (notification.getDevnotification() instanceof ConnectionRequestInform) { + logger.debug("Recieived ConnectionRequest inform from device."); + waitForNotifications.notifyDeviceNotification(notification); } else { logger.error("VES Notification request is unknown"); response = @@ -78,4 +90,36 @@ public class VESAgentService { logger.debug("VES Notification request processing completed"); return response; } + + @PostMapping(path = "/deleteConfig", consumes = "application/json") + public VESNotificationResponse processDeleteConfigRequest( + @RequestBody VESNotification vesNotification) { + VESNotificationResponse response = null; + + logger.debug("Initiating deleteConfig VES Notification request"); + response = hbHandler.handleDeleteConfigRequest(vesNotification); + logger.debug("deleteConfig VES Notification request is completed"); + return response; + } + + @PostMapping(path = "/editConfig", consumes = "application/json") + public DeviceRPCResponse processEditConfigRequest( + @RequestBody DeviceRPCRequest deviceRPCRequest) { + DeviceRPCResponse response = null; + + logger.debug("Initiating setConfig VES Notification request"); + response = hbHandler.handleSetConfigRequest(deviceRPCRequest); + logger.debug("setConfig VES Notification request is compelted"); + return response; + } + + @PostMapping(path = "/getConfig", consumes = "application/json") + public DeviceRPCResponse processGetConfigRequest(@RequestBody DeviceRPCRequest deviceRPCRequest) { + DeviceRPCResponse response = null; + + logger.debug("Initiating getConfig VES Notification request"); + response = hbHandler.handleGetConfigRequest(deviceRPCRequest); + logger.debug("getConfig VES Notification request is compelted"); + return response; + } }