From 2dbcd2c60cb63448f829b72470430cff616abace Mon Sep 17 00:00:00 2001 From: yangyan Date: Tue, 17 Apr 2018 15:52:33 +0800 Subject: Update ves-agent dependency Issue-ID: VFC-882 Change-Id: Ia8da8a18d59d599376d4e9c6524edf287b575e92 Signed-off-by: yangyan --- ems/boco/3rdParty/evel_javalib2-0.0.1.jar | Bin 106575 -> 0 bytes ems/boco/pom.xml | 191 ++++----------------- .../vfc/nfvo/emsdriver/EmsDriverApplication.java | 17 +- .../collector/CollectMsgReceiverThread.java | 6 +- .../vfc/nfvo/emsdriver/collector/TaskThread.java | 6 +- .../emsdriver/collector/TaskThreadService.java | 6 +- .../emsdriver/collector/alarm/AlarmManager.java | 6 +- .../emsdriver/collector/alarm/AlarmTaskThread.java | 6 +- .../nfvo/emsdriver/collector/alarm/HeartBeat.java | 6 +- .../vfc/nfvo/emsdriver/commons/ftp/FTPSrv.java | 6 +- .../nfvo/emsdriver/commons/utils/DriverThread.java | 6 +- .../nfvo/emsdriver/commons/utils/StringUtil.java | 6 +- .../emsdriver/commons/utils/VarExprParser.java | 7 +- .../nfvo/emsdriver/configmgr/ConfigurationImp.java | 6 +- .../emsdriver/configmgr/ConfigurationManager.java | 6 +- .../northbound/client/HttpClientUtil.java | 6 +- .../northbound/client/NorthMessageMgr.java | 40 +++-- .../northbound/service/CommandResource.java | 6 +- .../emsdriver/taskscheduler/CollectOderJob.java | 6 +- .../emsdriver/taskscheduler/QuartzManager.java | 6 +- .../collector/alarm/AlarmTaskThreadTest.java | 4 +- .../emsdriver/configmgr/ConfigurationImpTest.java | 6 +- .../main/assembly/3rdParty/evel_javalib2-0.0.1.jar | Bin 106575 -> 0 bytes .../src/main/assembly/conf/emsdriver.yml | 33 +--- .../src/main/assembly/conf/log4j.properties | 4 +- .../src/main/assembly/run.bat | 3 +- .../src/main/assembly/run.sh | 3 +- 27 files changed, 138 insertions(+), 260 deletions(-) delete mode 100644 ems/boco/3rdParty/evel_javalib2-0.0.1.jar delete mode 100644 ems/microservice-standalone/src/main/assembly/3rdParty/evel_javalib2-0.0.1.jar diff --git a/ems/boco/3rdParty/evel_javalib2-0.0.1.jar b/ems/boco/3rdParty/evel_javalib2-0.0.1.jar deleted file mode 100644 index 1ad1d84..0000000 Binary files a/ems/boco/3rdParty/evel_javalib2-0.0.1.jar and /dev/null differ diff --git a/ems/boco/pom.xml b/ems/boco/pom.xml index fc726c6..f7ebf5b 100644 --- a/ems/boco/pom.xml +++ b/ems/boco/pom.xml @@ -161,12 +161,30 @@ io.dropwizard dropwizard-core - 1.2.3 + 1.2.4 + + + ch.qos.logback + logback-core + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-access + + + org.slf4j + log4j-over-slf4j + + io.dropwizard dropwizard-assets - 1.2.3 + 1.2.4 org.apache.httpcomponents @@ -211,12 +229,17 @@ swagger-jersey2-jaxrs ${swagger.version} - + + + org.onap.vnfsdk.ves-agent + evel_javalib2 + 1.1.0 javax.json @@ -241,7 +264,17 @@ mockserver-netty 5.3.0 test - + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + org.eclipse.jetty jetty-server @@ -252,21 +285,11 @@ commons-collections 3.2.2 - - com.fasterxml.jackson.core - jackson-databind - 2.9.4 - io.netty netty-handler 4.1.22.Final - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - 2.9.3 - org.bouncycastle bcprov-jdk15on @@ -287,146 +310,6 @@ jetty-util 9.4.8.v20171121 - - - io.dropwizard - dropwizard-lifecycle - 1.2.3 - - - com.fasterxml.jackson.module - jackson-module-afterburner - 2.9.3 - - - io.dropwizard - dropwizard-configuration - 1.2.3 - - - io.dropwizard - dropwizard-validation - 1.2.3 - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - 2.9.3 - - - io.dropwizard - dropwizard-servlets - 1.2.3 - - - io.dropwizard - dropwizard-logging - 1.2.3 - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - 2.9.3 - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - 2.9.3 - - - io.dropwizard - dropwizard-jersey - 1.2.3 - - - io.dropwizard - dropwizard-metrics - 1.2.3 - - - com.fasterxml.jackson.datatype - jackson-datatype-guava - 2.9.3 - - - io.dropwizard - dropwizard-request-logging - 1.2.3 - - - io.dropwizard - dropwizard-util - 1.2.3 - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base - 2.9.3 - - - javax.validation - validation-api - 1.1.0.Final - - - io.dropwizard - dropwizard-jackson - 1.2.3 - - - ch.qos.logback - logback-classic - 1.2.3 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - 2.9.4 - - - org.bouncycastle - bcpkix-jdk15on - 1.57 - - - org.eclipse.jetty - jetty-security - 9.4.8.v20171121 - - - org.eclipse.jetty - jetty-xml - 9.4.8.v20171121 - - - org.eclipse.jetty - jetty-servlets - 9.4.8.v20171121 - - - org.eclipse.jetty - jetty-webapp - 9.4.8.v20171121 - - - org.eclipse.jetty - jetty-continuation - 9.4.8.v20171121 - - - logkit - logkit - 2.0 - - - org.slf4j - slf4j-api - 1.7.5 - com.google.guava guava diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java index 952ac5f..8d13d18 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/EmsDriverApplication.java @@ -24,8 +24,9 @@ import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import io.swagger.jaxrs.config.BeanConfig; import io.swagger.jaxrs.listing.ApiListingResource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.log4j.PropertyConfigurator; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.utils.DriverThread; import org.onap.vfc.nfvo.emsdriver.northbound.service.CommandResource; @@ -43,15 +44,25 @@ import java.util.List; public class EmsDriverApplication extends Application { - protected static Log log = LogFactory.getLog(EmsDriverApplication.class); + protected static Logger log = LoggerFactory.getLogger(EmsDriverApplication.class); + public static String LOGCONFIG_PROPERTIES_LOCATION = Constant.SYS_CFG + "log4j.properties"; private ApplicationContext context = null; public static void main(String[] args) throws Exception { + logConfig(); log.info("EmsDriverApplication start"); new EmsDriverApplication().run(args); log.info("EmsDriverApplication start sucess"); } + @Override + protected void bootstrapLogging() { + } + + public static void logConfig(){ + PropertyConfigurator.configure(LOGCONFIG_PROPERTIES_LOCATION); + } + @Override public String getName() { return "ems-driver"; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/CollectMsgReceiverThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/CollectMsgReceiverThread.java index c8ba21c..f9edf1c 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/CollectMsgReceiverThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/CollectMsgReceiverThread.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.collector; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectMsg; import org.onap.vfc.nfvo.emsdriver.commons.utils.DriverThread; @@ -25,7 +25,7 @@ import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannel; import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannelFactory; public class CollectMsgReceiverThread extends DriverThread { - protected static final Log logger = LogFactory.getLog(CollectMsgReceiverThread.class); + protected static final Logger logger = LoggerFactory.getLogger(CollectMsgReceiverThread.class); private long timeStamp = System.currentTimeMillis(); diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java index 9b38c9c..2e8656d 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java @@ -16,8 +16,8 @@ package org.onap.vfc.nfvo.emsdriver.collector; import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.ftp.AFtpRemoteFile; import org.onap.vfc.nfvo.emsdriver.commons.ftp.FTPInterface; @@ -42,7 +42,7 @@ import java.util.regex.Pattern; public class TaskThread implements Runnable { - private static final Log log = LogFactory.getLog(TaskThread.class); + private static final Logger log = LoggerFactory.getLogger(TaskThread.class); private MessageChannel pmResultChannel; private MessageChannel cmResultChannel; private CollectMsg data; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java index 566da0f..fbc1ed3 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThreadService.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.collector; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectMsg; import org.onap.vfc.nfvo.emsdriver.commons.utils.StringUtil; @@ -26,7 +26,7 @@ import java.util.concurrent.*; public class TaskThreadService extends Thread { private final ExecutorService pool; - private static final Log log = LogFactory.getLog(TaskThreadService.class); + private static final Logger log = LoggerFactory.getLogger(TaskThreadService.class); private BlockingQueue queue = new LinkedBlockingQueue<>(); private boolean startFlag = true; private long timeStamp = System.currentTimeMillis(); diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java index de0da91..b14645b 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmManager.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.collector.alarm; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.collector.CollectMsgReceiverThread; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectVo; @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.List; public class AlarmManager extends DriverThread { - protected static final Log logger = LogFactory.getLog(AlarmManager.class); + protected static final Logger logger = LoggerFactory.getLogger(AlarmManager.class); private ConfigurationInterface configurationInterface; @Override diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThread.java index f90de5f..2a9720f 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThread.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.collector.alarm; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectVo; import org.onap.vfc.nfvo.emsdriver.commons.utils.StringUtil; @@ -31,7 +31,7 @@ import java.net.SocketException; import java.net.UnknownHostException; public class AlarmTaskThread extends Thread { - private static final Log log = LogFactory.getLog(AlarmTaskThread.class); + private static final Logger log = LoggerFactory.getLogger(AlarmTaskThread.class); private HeartBeat heartBeat = null; private boolean isStop = false; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/HeartBeat.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/HeartBeat.java index b9b6f1a..dc7d7c9 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/HeartBeat.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/HeartBeat.java @@ -15,15 +15,15 @@ */ package org.onap.vfc.nfvo.emsdriver.collector.alarm; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import java.io.BufferedOutputStream; import java.net.Socket; public class HeartBeat extends Thread { - private static final Log log = LogFactory.getLog(HeartBeat.class); + private static final Logger log = LoggerFactory.getLogger(HeartBeat.class); private BufferedOutputStream out = null; private Socket socket = null; private Msg heartStr; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/ftp/FTPSrv.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/ftp/FTPSrv.java index 34baa30..43c7ca8 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/ftp/FTPSrv.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/ftp/FTPSrv.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.commons.ftp; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.commons.net.ftp.*; import org.onap.vfc.nfvo.emsdriver.commons.utils.StringUtil; @@ -27,7 +27,7 @@ import java.util.TimeZone; public class FTPSrv implements FTPInterface { - private Log log = LogFactory.getLog(FTPSrv.class); + private Logger log = LoggerFactory.getLogger(FTPSrv.class); private FTPClient ftpClient = null; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java index 8e57d5e..d6be602 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/DriverThread.java @@ -15,11 +15,11 @@ */ package org.onap.vfc.nfvo.emsdriver.commons.utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class DriverThread implements Runnable { - protected Log log = LogFactory.getLog(this.getClass()); + protected Logger log = LoggerFactory.getLogger(this.getClass()); private String name = null; private Thread t = null; private boolean run = false; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/StringUtil.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/StringUtil.java index 5fa0f9a..8267ef3 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/StringUtil.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/StringUtil.java @@ -18,12 +18,12 @@ package org.onap.vfc.nfvo.emsdriver.commons.utils; import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StringUtil { - private static final Log log = LogFactory.getLog(StringUtil.class); + private static final Logger log = LoggerFactory.getLogger(StringUtil.class); public static String getStackTrace(Throwable t) { try( diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/VarExprParser.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/VarExprParser.java index 4a18e85..0d8bbbd 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/VarExprParser.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/commons/utils/VarExprParser.java @@ -16,8 +16,8 @@ package org.onap.vfc.nfvo.emsdriver.commons.utils; import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -26,7 +26,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public final class VarExprParser { - private static Log log = LogFactory.getFactory().getInstance(VarExprParser.class); + private static Logger log = LoggerFactory.getLogger(VarExprParser.class); + private static Pattern varPattern = Pattern.compile("(\\$\\{([^\\}]+)\\})", Pattern.CASE_INSENSITIVE); diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImp.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImp.java index aaded64..da4af9b 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImp.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImp.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.configmgr; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectVo; import org.onap.vfc.nfvo.emsdriver.commons.model.EMSInfo; @@ -26,7 +26,7 @@ import java.util.Properties; public class ConfigurationImp implements ConfigurationInterface { - private Log log = LogFactory.getLog(ConfigurationImp.class); + private Logger log = LoggerFactory.getLogger(ConfigurationImp.class); @Override public List getAllEMSInfo() { diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationManager.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationManager.java index f775d92..ec99cc8 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationManager.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationManager.java @@ -19,8 +19,8 @@ package org.onap.vfc.nfvo.emsdriver.configmgr; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.common.annotations.VisibleForTesting; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.jdom.Document; import org.jdom.Element; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; @@ -42,7 +42,7 @@ import java.util.concurrent.ConcurrentHashMap; public class ConfigurationManager extends DriverThread { public static final String CONFIG_PROPERTIES_LOCATION = Constant.SYS_CFG + "config.properties"; - protected static final Log logger = LogFactory.getLog(ConfigurationManager.class); + protected static final Logger logger = LoggerFactory.getLogger(ConfigurationManager.class); /** * ESM Cache */ diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/HttpClientUtil.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/HttpClientUtil.java index 5c844c6..e4bcae9 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/HttpClientUtil.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/HttpClientUtil.java @@ -16,8 +16,8 @@ package org.onap.vfc.nfvo.emsdriver.northbound.client; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpDelete; @@ -34,7 +34,7 @@ import org.apache.http.util.EntityUtils; */ public class HttpClientUtil { - private static final Log log = LogFactory.getLog(HttpClientUtil.class); + private static final Logger log = LoggerFactory.getLogger(HttpClientUtil.class); public static String doPost(String url, String json, String charset) { String result = null; diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java index 967447b..4836f60 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java @@ -15,7 +15,23 @@ */ package org.onap.vfc.nfvo.emsdriver.northbound.client; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Map; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.log4j.Level; +import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; +import org.onap.vfc.nfvo.emsdriver.commons.utils.DriverThread; +import org.onap.vfc.nfvo.emsdriver.configmgr.ConfigurationInterface; +import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannel; +import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannelFactory; + import com.alibaba.fastjson.JSONObject; + import evel_javalibrary.att.com.AgentMain; import evel_javalibrary.att.com.AgentMain.EVEL_ERR_CODES; import evel_javalibrary.att.com.EvelFault; @@ -25,24 +41,8 @@ import evel_javalibrary.att.com.EvelFault.EVEL_VF_STATUSES; import evel_javalibrary.att.com.EvelHeader; import evel_javalibrary.att.com.EvelScalingMeasurement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.log4j.Level; -import org.onap.vfc.nfvo.emsdriver.collector.alarm.AlarmManager; -import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; -import org.onap.vfc.nfvo.emsdriver.commons.utils.DriverThread; -import org.onap.vfc.nfvo.emsdriver.configmgr.ConfigurationInterface; -import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannel; -import org.onap.vfc.nfvo.emsdriver.messagemgr.MessageChannelFactory; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Map; -import java.util.Properties; - public class NorthMessageMgr extends DriverThread { - protected static final Log logger = LogFactory.getLog(NorthMessageMgr.class); + protected static final Logger logger = LoggerFactory.getLogger(NorthMessageMgr.class); private MessageChannel alarmChannel = MessageChannelFactory.getMessageChannel(Constant.RESULT_CHANNEL_KEY); private MessageChannel collectResultPMChannel = MessageChannelFactory.getMessageChannel(Constant.COLLECT_RESULT_PM_CHANNEL_KEY); private MessageChannel collectResultChannel = MessageChannelFactory.getMessageChannel(Constant.COLLECT_RESULT_CHANNEL_KEY); @@ -62,6 +62,9 @@ public class NorthMessageMgr extends DriverThread { String topic = properties.getProperty("topic"); String username = properties.getProperty("username"); String password = properties.getProperty("password"); + String keystore_path ="" ; + String jks_password = ""; + String key_password = ""; String levelStr = properties.getProperty("level"); if ("debug".equals(levelStr)) { level = Level.DEBUG; @@ -78,6 +81,9 @@ public class NorthMessageMgr extends DriverThread { path, topic, username, password, + keystore_path, + jks_password, + key_password, level); logger.info("AgentMain.evel_initialize sucess EVEL_ERR_CODES=" + evecode); } catch (Exception e) { diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/service/CommandResource.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/service/CommandResource.java index 692048b..1a8c4f3 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/service/CommandResource.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/service/CommandResource.java @@ -25,15 +25,15 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @Path("/ems-driver") @Produces(MediaType.APPLICATION_JSON) @Api(tags = {"ems-driver TestResource"}) public class CommandResource { - private Log log = LogFactory.getLog(CommandResource.class); + private Logger log = LoggerFactory.getLogger(CommandResource.class); @GET @Timed diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java index 9a27750..9465940 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/CollectOderJob.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.taskscheduler; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.constant.Constant; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectMsg; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectVo; @@ -30,7 +30,7 @@ import org.quartz.JobExecutionException; public class CollectOderJob implements Job { - private Log log = LogFactory.getLog(DriverThread.class); + private Logger log = LoggerFactory.getLogger(DriverThread.class); private MessageChannel collectChannel = MessageChannelFactory.getMessageChannel(Constant.COLLECT_CHANNEL_KEY); public void execute(JobExecutionContext context) throws JobExecutionException { diff --git a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/QuartzManager.java b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/QuartzManager.java index cd1e4af..5b05828 100644 --- a/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/QuartzManager.java +++ b/ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/taskscheduler/QuartzManager.java @@ -16,8 +16,8 @@ package org.onap.vfc.nfvo.emsdriver.taskscheduler; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.vfc.nfvo.emsdriver.commons.model.CollectVo; import org.quartz.*; import org.quartz.impl.StdSchedulerFactory; @@ -27,7 +27,7 @@ import java.text.ParseException; public class QuartzManager { - private static Log log = LogFactory.getFactory().getInstance(QuartzManager.class); + private static Logger log = LoggerFactory.getLogger(QuartzManager.class); private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory(); private static String jobGroupName = "EXTJWEB_JOBGROUP_NAME"; private static String triggerGroupName = "EXTJWEB_TRIGGERGROUP_NAME"; diff --git a/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThreadTest.java b/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThreadTest.java index 1031ff9..ed83c12 100644 --- a/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThreadTest.java +++ b/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/collector/alarm/AlarmTaskThreadTest.java @@ -77,7 +77,9 @@ public class AlarmTaskThreadTest { public void runAlarmTaskThread() { taskThread.start(); //Thread.sleep(3000); - server.stop(); + if(server!=null){ + server.stop(); + } severThread.stop(); taskThread.setStop(true); taskThread.close(); diff --git a/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImpTest.java b/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImpTest.java index d42a92a..cd45ef3 100644 --- a/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImpTest.java +++ b/ems/boco/src/test/java/org/onap/vfc/nfvo/emsdriver/configmgr/ConfigurationImpTest.java @@ -15,8 +15,8 @@ */ package org.onap.vfc.nfvo.emsdriver.configmgr; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.jdom.Document; import org.jdom.Element; import org.junit.Before; @@ -38,7 +38,7 @@ import static org.junit.Assert.assertTrue; public class ConfigurationImpTest { //normally an unit test should not log - protected static Log log = LogFactory.getLog(ConfigurationImpTest.class); + protected static Logger log = LoggerFactory.getLogger(ConfigurationImpTest.class); private ConfigurationManager configurationManager; private ConfigurationImp configurationImp; diff --git a/ems/microservice-standalone/src/main/assembly/3rdParty/evel_javalib2-0.0.1.jar b/ems/microservice-standalone/src/main/assembly/3rdParty/evel_javalib2-0.0.1.jar deleted file mode 100644 index 1ad1d84..0000000 Binary files a/ems/microservice-standalone/src/main/assembly/3rdParty/evel_javalib2-0.0.1.jar and /dev/null differ diff --git a/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml b/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml index 5660fcd..4259c54 100644 --- a/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml +++ b/ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml @@ -28,38 +28,11 @@ server: connector: type: http port: 8206 + requestLog: + type: external -# Logging settings. logging: - - # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL. - level: INFO - - # Logger-specific levels. - loggers: - - # Sets the level for 'org.onap.vfc.nfvo.emsdriver' to INFO. - org.onap.vfc.nfvo.emsdriver.EmsDriverApplication: INFO - - appenders: - - type: console - threshold: WARN - timeZone: PRC - logFormat: "%-4level [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %logger{5} - %X{code} %msg %n" - - type: file - threshold: INFO - logFormat: "%-4level [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %logger{5} - %X{code} %msg %n" - currentLogFilename: ./logs/emsdriver.log - archivedLogFilenamePattern: ./logs/emsdriver-%d{yyyyMMdd}-%d{HHmm}-%d{ssSSS}.log.gz - archivedFileCount: 7 - timeZone: PRC - - type: file - threshold: ERROR - logFormat: "%-4level [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %logger{5} - %X{code} %msg %n" - currentLogFilename: ./logs/error.log - archivedLogFilenamePattern: ./logs/error-%d{yyyyMMdd}-%d{HHmm}-%d{ssSSS}.log.gz - archivedFileCount: 7 - timeZone: PRC + type: external diff --git a/ems/microservice-standalone/src/main/assembly/conf/log4j.properties b/ems/microservice-standalone/src/main/assembly/conf/log4j.properties index f9edd80..2a96480 100644 --- a/ems/microservice-standalone/src/main/assembly/conf/log4j.properties +++ b/ems/microservice-standalone/src/main/assembly/conf/log4j.properties @@ -23,7 +23,7 @@ log4j.appender.stdout.Threshold=INFO #### \u7b2c\u4e8c\u4e2a appender \u5c06\u5168\u90e8log\u5199\u5230\u6587\u4ef6 log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=../log/monitor.log +log4j.appender.R.File=./logs/emsdriver.log log4j.appender.R.MaxFileSize=20MB log4j.appender.R.MaxBackupIndex=50 log4j.appender.R.layout=org.apache.log4j.PatternLayout @@ -32,7 +32,7 @@ log4j.appender.R.Threshold=INFO #### \u7b2c\u4e09\u4e2a appender \u5c06\u9519\u8beflog\u5199\u5230\u6587\u4ef6 log4j.appender.E=org.apache.log4j.RollingFileAppender -log4j.appender.E.File=../log/error.log +log4j.appender.E.File=./logs/error.log log4j.appender.E.MaxFileSize=20MB log4j.appender.E.MaxBackupIndex=10 log4j.appender.E.layout=org.apache.log4j.PatternLayout diff --git a/ems/microservice-standalone/src/main/assembly/run.bat b/ems/microservice-standalone/src/main/assembly/run.bat index 255400a..f4da860 100755 --- a/ems/microservice-standalone/src/main/assembly/run.bat +++ b/ems/microservice-standalone/src/main/assembly/run.bat @@ -47,7 +47,8 @@ set date_time_string=%date_time_string:|=-% set jvm_opts=%jvm_opts% -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%RUNHOME%logs\dump-dac-%date_time_string%.hprof -set class_path=%RUNHOME%;%RUNHOME%boco-driver.jar;%RUNHOME%/3rdParty/evel_javalib2-0.0.1.jar +rem set class_path=%RUNHOME%;%RUNHOME%boco-driver.jar;%RUNHOME%/3rdParty/evel_javalib2-0.0.1.jar +set class_path=%RUNHOME%;%RUNHOME%boco-driver.jar echo ### jvm_opts: %jvm_opts% echo ### class_path: %class_path% diff --git a/ems/microservice-standalone/src/main/assembly/run.sh b/ems/microservice-standalone/src/main/assembly/run.sh index 44e204f..93992f9 100755 --- a/ems/microservice-standalone/src/main/assembly/run.sh +++ b/ems/microservice-standalone/src/main/assembly/run.sh @@ -88,7 +88,8 @@ fi # JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" echo @JAVA_OPTS@ $JAVA_OPTS -class_path="$RUNHOME/:$RUNHOME/boco-driver.jar:$RUNHOME/3rdParty/evel_javalib2-0.0.1.jar" +#class_path="$RUNHOME/:$RUNHOME/boco-driver.jar:$RUNHOME/3rdParty/evel_javalib2-0.0.1.jar" +class_path="$RUNHOME/:$RUNHOME/boco-driver.jar" echo @class_path@ $class_path # Start "$JAVA" $JAVA_OPTS -classpath "$class_path" org.onap.vfc.nfvo.emsdriver.EmsDriverApplication server "$RUNHOME/conf/emsdriver.yml" -- cgit 1.2.3-korg