* turn debug model
*/
private static boolean debugModel = false;
- public static String vnfmServiceUrl = null;
+ private static String vnfmServiceUrl = null;
public SwitchController() { //NOSONAR
//Constructor
SwitchController.debugModel = debugModel;
}
+ public static void setVnfmServiceUrl(String inVnfmServiceUrl) {
+ SwitchController.vnfmServiceUrl = inVnfmServiceUrl;
+ }
+ public static String getVnfmServiceUrl() {
+ return SwitchController.vnfmServiceUrl;
+ }
}
LOG.warn("the value 'vnfmServiceUrl' not exist."+e.getMessage());
}
if (StringUtils.isBlank(url)) {
- url = SwitchController.vnfmServiceUrl;
+ url = SwitchController.getVnfmServiceUrl();
}
if (StringUtils.isBlank(url)) {
JSONObject vnfmObject = VnfmUtil.getVnfmById(vnfmId);
JSONObject restJson = new JSONObject();
restJson.put(EntityUtils.RESULT_CODE_KEY, Constant.REST_FAIL);
try {
- String url = SwitchController.vnfmServiceUrl;
+ String url = SwitchController.getVnfmServiceUrl();
if (StringUtils.isBlank(url)) {
JSONObject vnfmObject = VnfmUtil.getVnfmById(vnfmId);
JSONObject restJson = new JSONObject();
restJson.put(EntityUtils.RESULT_CODE_KEY, Constant.REST_FAIL);
try {
- String url = SwitchController.vnfmServiceUrl;
+ String url = SwitchController.getVnfmServiceUrl();
JSONObject vnfmObject = null;
if (StringUtils.isBlank(url)) {
// call the ESR to get jujuvnfm server url
result.put("retCode", Constant.REST_SUCCESS);
JSONObject reqJsonObject = StringUtil.getJsonFromContexts(context);
String vnfmServiceUrl = reqJsonObject.getString("url");
- SwitchController.vnfmServiceUrl = vnfmServiceUrl;
+ SwitchController.setVnfmServiceUrl(vnfmServiceUrl);
LOG.info(reqJsonObject + ":setVNFMInfo success!");
return result.toString();
}