* ============LICENSE_START=======================================================
* ONAP-PAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public BRMSDictionaryController(CommonClassDao commonClassDao){
BRMSDictionaryController.commonClassDao = commonClassDao;
}
+ public static void setCommonClassDao(CommonClassDao commonClassDao2) {
+ BRMSDictionaryController.commonClassDao = commonClassDao2;
+ }
/*
* This is an empty constructor
*/
}
@RequestMapping(value={"/brms_dictionary/set_BRMSParamData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public void SetRuleData(HttpServletRequest request) throws IOException{
+ public static void setRuleData(HttpServletRequest request) throws IOException{
StringWriter writer = new StringWriter();
IOUtils.copy(request.getInputStream() , writer, StandardCharsets.UTF_8);
String cleanStreamBoundary = writer.toString().replaceFirst("------(.*)(?s).*octet-stream", "");
//check if update operation or create, get id for data to be updated
if ((update).equals(request.getParameter(operation))) {
List<Object> duplicateData = commonClassDao.checkDuplicateEntry(brmsDependency.getDependencyName(), dependencyName, BRMSDependency.class);
- int id = 0;
BRMSDependency data = (BRMSDependency) duplicateData.get(0);
- id = data.getId();
+ int id = data.getId();
brmsDependency.setId(id);
brmsDependency.setUserCreatedBy(this.getUserInfo(userId));
}
//check if update operation or create, get id for data to be updated
if ((update).equals(request.getParameter(operation))) {
List<Object> duplicateData = commonClassDao.checkDuplicateEntry(brmsController.getControllerName(), controllerName, BRMSController.class);
- int id = 0;
BRMSController data = (BRMSController) duplicateData.get(0);
- id = data.getId();
+ int id = data.getId();
brmsController.setId(id);
brmsController.setUserCreatedBy(this.getUserInfo(userId));
}