summaryrefslogtreecommitdiffstats
path: root/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
diff options
context:
space:
mode:
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java')
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java79
1 files changed, 53 insertions, 26 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
index b6bf3eb0..cb429149 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/controller/VnfmDriverController.java
@@ -18,14 +18,14 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.controller;
import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
-import org.apache.http.client.ClientProtocolException;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.CreateSubscriptionRequest;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.CreateSubscriptionResponse;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfResponse;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest;
@@ -196,30 +196,30 @@ public class VnfmDriverController {
return null;
}
-// @RequestMapping(value = "/notifications", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
-// public CBAMVnfNotificationResponse notificationVnf(@RequestBody CBAMVnfNotificationRequest request, HttpServletResponse httpResponse) throws ClientProtocolException, Exception
- @RequestMapping(value = "/notifications")
-// @ResponseBody
- public void notificationVnf(HttpServletRequest request, HttpServletResponse httpResponse) throws ClientProtocolException, Exception
- {
-
-// String jsonString = gson.toJson(request);
-// logger.info("notificationVnf request: bodyMessage is " + jsonString);
- logger.info("notificationVnf request: bodyMessage is " + request.getMethod() + ",");
-
- try {
-// CBAMVnfNotificationResponse response = cbamMgmr.getNotification(request);
- httpResponse.setStatus(204);
-// logger.info("cbamController --> notificationVnf response is " + gson.toJson(response));
-// return response;
- }
- catch(VnfmDriverException e)
- {
- processControllerException(httpResponse, e);
- }
-
-// return null;
- }
+//// @RequestMapping(value = "/notifications", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
+//// public CBAMVnfNotificationResponse notificationVnf(@RequestBody CBAMVnfNotificationRequest request, HttpServletResponse httpResponse) throws ClientProtocolException, Exception
+// @RequestMapping(value = "/notifications")
+//// @ResponseBody
+// public void notificationVnf(HttpServletRequest request, HttpServletResponse httpResponse) throws ClientProtocolException, Exception
+// {
+//
+//// String jsonString = gson.toJson(request);
+//// logger.info("notificationVnf request: bodyMessage is " + jsonString);
+// logger.info("notificationVnf request: bodyMessage is " + request.getMethod() + ",");
+//
+// try {
+//// CBAMVnfNotificationResponse response = cbamMgmr.getNotification(request);
+// httpResponse.setStatus(204);
+//// logger.info("cbamController --> notificationVnf response is " + gson.toJson(response));
+//// return response;
+// }
+// catch(VnfmDriverException e)
+// {
+// processControllerException(httpResponse, e);
+// }
+//
+//// return null;
+// }
private void processControllerException(HttpServletResponse httpResponse, VnfmDriverException e) {
try {
@@ -230,4 +230,31 @@ public class VnfmDriverController {
logger.error("VnfmDriverController --> processControllerException error to sendError ", e1);
}
}
+
+// -- The following VNFM Driver APIs are compliant to ETSI SOL003 -- Begin
+
+ @RequestMapping(value = "/createSubscripiton", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public CreateSubscriptionResponse createSubscripiton(@RequestBody CreateSubscriptionRequest request, HttpServletResponse httpResponse)
+ {
+ String jsonString = gson.toJson(request);
+ logger.info("VnfmDriverController --> createSubscripiton, bodyMessage is " + jsonString);
+
+ try {
+ request.setCallbackUrl(request.getCallbackUri());
+ CreateSubscriptionResponse response = vnfmDriverMgmr.createSubscription(request);
+ httpResponse.setStatus(HttpStatus.SC_CREATED);
+ logger.info("VnfmDriverController --> createSubscripiton end ");
+ return response;
+ }
+ catch(VnfmDriverException e)
+ {
+ processControllerException(httpResponse, e);
+ }
+
+ return null;
+ }
+
+// -- The following VNFM Driver APIs are compliant to ETSI SOL003 -- End
}
+