aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java13
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java11
-rw-r--r--standalone/src/main/assembly/config/slicing.properties (renamed from server/src/main/resources/slicing.properties)0
3 files changed, 18 insertions, 6 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java
index f1301182..0e215b5c 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java
@@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;
@@ -120,11 +122,16 @@ public class SlicingServiceImpl implements SlicingService {
CreationService creationService = new CreationService();
creationService.setName(slicingOrder.getSlicing_order_info().getName());
creationService.setDescription(CommonConstant.BLANK);
- InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("slicing.properties");
+ String slicingPath = System.getProperty("user.dir") + File.separator + "config" + File.separator + "slicing.properties";
+ InputStream inputStream = new FileInputStream(new File(slicingPath));
Properties environment = new Properties();
environment.load(inputStream);
- creationService.setServiceInvariantUuid(environment.getProperty("slicing.serviceInvariantUuid"));
- creationService.setServiceUuid(environment.getProperty("slicing.serviceUuid"));
+ String serviceInvariantUuid = environment.getProperty("slicing.serviceInvariantUuid");
+ creationService.setServiceInvariantUuid(serviceInvariantUuid);
+ String serviceUuid = environment.getProperty("slicing.serviceUuid");
+ creationService.setServiceUuid(serviceUuid);
+ logger.info("serviceInvariantUuid is {}, serviceUuid is {}.", serviceInvariantUuid, serviceUuid);
+
creationService.setGlobalSubscriberId(environment.getProperty("slicing.globalSubscriberId"));
creationService.setServiceType(environment.getProperty("slicing.serviceType"));
creationService.setParameters(parameters);
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java
index bebab943..6fd9cb03 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java
@@ -17,6 +17,8 @@ package org.onap.usecaseui.server.service.nsmf.impl;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -73,16 +75,17 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
public ResourceMonitorServiceImpl(KpiSliceService kpiSliceService) {
this.kpiSliceService = kpiSliceService;
- initConfig();
}
public void initConfig() {
- InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("slicing.properties");
+ String slicingPath = System.getProperty("user.dir") + File.separator + "config" + File.separator + "slicing.properties";
Properties p = new Properties();
try {
+ InputStream inputStream = new FileInputStream(new File(slicingPath));
p.load(inputStream);
String strKpiHours = p.getProperty("slicing.kpi.hours");
this.kpiHours = Integer.parseInt(strKpiHours);
+ logger.info("kpiHours configuration is :{}", this.kpiHours);
} catch (IOException e1) {
logger.error("get configuration file arise error :{}", e1);
}
@@ -92,7 +95,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
public ServiceResult querySlicingUsageTraffic(String queryTimestamp, ServiceList serviceList) {
ServiceResult serviceResult = new ServiceResult();
ResultHeader resultHeader = new ResultHeader();
-
+ initConfig();
UsageTrafficList usageTrafficList = new UsageTrafficList();
List<UsageTrafficInfo> usageTrafficInfoList = new ArrayList<>();
List<ServiceInfo> serviceInfoList = serviceList.getServiceInfoList();
@@ -143,6 +146,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
public ServiceResult querySlicingOnlineUserNumber(String queryTimestamp, ServiceList serviceList) {
ServiceResult serviceResult = new ServiceResult();
ResultHeader resultHeader = new ResultHeader();
+ initConfig();
ServiceOnlineUserList serviceOnlineUserList = new ServiceOnlineUserList();
List<ServiceOnlineUserInfo> serviceOnlineUserInfoList = new ArrayList<>();
List<ServiceInfo> serviceInfoList = serviceList.getServiceInfoList();
@@ -196,6 +200,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
public ServiceResult querySlicingTotalBandwidth(String queryTimestamp, ServiceList serviceList) {
ServiceResult serviceResult = new ServiceResult();
ResultHeader resultHeader = new ResultHeader();
+ initConfig();
ServiceTotalBandwidthList serviceTotalBandwidthList = new ServiceTotalBandwidthList();
List<ServiceTotalBandwidthInfo> serviceTotalBandwidthInfoList = new ArrayList<>();
diff --git a/server/src/main/resources/slicing.properties b/standalone/src/main/assembly/config/slicing.properties
index e9363c27..e9363c27 100644
--- a/server/src/main/resources/slicing.properties
+++ b/standalone/src/main/assembly/config/slicing.properties