diff options
3 files changed, 7 insertions, 13 deletions
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 18cd7175..bebab943 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 @@ -84,7 +84,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { String strKpiHours = p.getProperty("slicing.kpi.hours"); this.kpiHours = Integer.parseInt(strKpiHours); } catch (IOException e1) { - logger.error("get configuration file arise error :{}", e1.getMessage()); + logger.error("get configuration file arise error :{}", e1); } } @@ -99,7 +99,6 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { String resultMsg = ""; try { - // TODO for (ServiceInfo serviceInfo : serviceInfoList) { String newTimestamp = NsmfCommonUtil.time2Timestamp(queryTimestamp) .replace(NsmfParamConstant.SPACE, "T"); @@ -129,7 +128,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { } catch (Exception e) { resultMsg = "5G slicing usage traffic query failed. Unknown exception occurred!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); - logger.error(e.getMessage()); + logger.error("Exception in querySlicingUsageTraffic :{}",e); } usageTrafficList.setUsageTrafficInfoList(usageTrafficInfoList); logger.info(resultMsg); @@ -151,7 +150,6 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { String resultMsg = ""; try { - // TODO for (ServiceInfo serviceInfo : serviceInfoList) { String newTimestamp = NsmfCommonUtil.time2Timestamp(queryTimestamp) .replace(NsmfParamConstant.SPACE, "T"); @@ -182,7 +180,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { } catch (Exception e) { resultMsg = "5G slicing online users query failed. Unknown exception occurred!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); - logger.error(e.getMessage()); + logger.error("Exception in querySlicingOnlineUserNumber :{}",e); } logger.info(resultMsg); @@ -237,7 +235,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService { } catch (Exception e) { resultMsg = "5G slicing total bandwidth query failed. Unknown exception occurred!"; resultHeader.setResult_code(NsmfCodeConstant.ERROR_CODE_UNKNOWN); - logger.error(e.getMessage()); + logger.error("Exception in querySlicingTotalBandwidth :{}",e); } logger.info(resultMsg); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/SlicServiceInstanceService.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/SlicServiceInstanceService.java index fa5977e2..4ccc1430 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/SlicServiceInstanceService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/SlicServiceInstanceService.java @@ -16,14 +16,10 @@ package org.onap.usecaseui.server.service.slicingdomain; +import java.util.List; import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceInstance; - import com.alibaba.fastjson.JSONObject; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - public interface SlicServiceInstanceService { List<AAIServiceInstance> listService(); diff --git a/server/src/main/java/org/onap/usecaseui/server/util/nsmf/NsmfCommonUtil.java b/server/src/main/java/org/onap/usecaseui/server/util/nsmf/NsmfCommonUtil.java index 4a7c5b2b..b7669992 100644 --- a/server/src/main/java/org/onap/usecaseui/server/util/nsmf/NsmfCommonUtil.java +++ b/server/src/main/java/org/onap/usecaseui/server/util/nsmf/NsmfCommonUtil.java @@ -37,14 +37,14 @@ public class NsmfCommonUtil { public static String time2Timestamp(String time) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(NsmfParamConstant.DATE_FORMAT); - long longTime = new Long(time); + long longTime = Long.parseLong(time); Date date = new Date(longTime); return simpleDateFormat.format(date); } public static <T> PagedResult getPagedList(List<T> list, int pageNo, int pageSize) { if (list == null || pageNo < 1 || (pageNo - 1) * pageSize > list.size()) { - return new PagedResult(0, Collections.EMPTY_LIST); + return new PagedResult(0, Collections.emptyList()); } list = list.stream().skip((pageNo - 1) * (long)pageSize).limit(pageSize).collect(Collectors.toList()); return new PagedResult(list.size(), list ); |