Delete temp file 23/21423/1
authorwangguirong <wangguirong@boco.com.cn>
Tue, 31 Oct 2017 07:08:11 +0000 (15:08 +0800)
committerwangguirong <wangguirong@boco.com.cn>
Tue, 31 Oct 2017 07:08:59 +0000 (15:08 +0800)
Change-Id: I0dcc6f771ae75f88de578762dcad5dde1fa531ed
Issue-Id: VFC-548
Signed-off-by: wangguirong <wangguirong@boco.com.cn>
ems/boco/.classpath [new file with mode: 0644]
ems/boco/pom.xml
ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/collector/TaskThread.java
ems/boco/src/main/java/org/onap/vfc/nfvo/emsdriver/northbound/client/NorthMessageMgr.java
ems/microservice-standalone/src/main/assembly/conf/emsdriver.yml

diff --git a/ems/boco/.classpath b/ems/boco/.classpath
new file mode 100644 (file)
index 0000000..68d3e86
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_144">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index a311d85..5d2b3a4 100644 (file)
                <artifactId>javax.json</artifactId>
                <version>1.0.4</version>
        </dependency>
+       <dependency>
+               <groupId>org.slf4j</groupId>
+               <artifactId>slf4j-log4j12</artifactId>
+               <version>1.7.5</version>
+       </dependency>
   </dependencies>
 </project>
index b4cec85..d250378 100644 (file)
@@ -142,6 +142,7 @@ public class TaskThread implements Runnable{
                        
                        if (parseResult){
                                log.info("parser "+tempfile+" sucess");
+                               tempfile.delete();
                        }else {
                                log.info("parser "+tempfile+" fail");
                        }
@@ -811,6 +812,7 @@ public class TaskThread implements Runnable{
                try {
                                File decompressFile = deGz(fileName);
                                filelist.add(decompressFile);
+                               new File(fileName).delete();
                        } catch (IOException e) {
                                log.error("decompressed is fail "+StringUtil.getStackTrace(e));
                        }
@@ -818,6 +820,7 @@ public class TaskThread implements Runnable{
            {
                try {
                                File[] files = deZip(new File(fileName));
+                               new File(fileName).delete();
                                for(File temp :files){
                                        filelist.add(temp);
                                }
index 9c8802f..4a3ec75 100644 (file)
@@ -31,6 +31,7 @@ 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;
 import evel_javalibrary.att.com.EvelFault.EVEL_SEVERITIES;
 import evel_javalibrary.att.com.EvelFault.EVEL_SOURCE_TYPES;
@@ -71,12 +72,12 @@ public class NorthMessageMgr extends DriverThread{
                        log.info("AgentMain.evel_initialize start event_api_url=["+event_api_url+"]port=["+port+"]path=["+path+"]"
                                        + "topic=["+topic+"]username=["+username+"]password=["+password+"]level=["+level+"]");
                        try{
-                               AgentMain.evel_initialize(event_api_url, Integer.parseInt(port),
+                               EVEL_ERR_CODES evecode = AgentMain.evel_initialize(event_api_url, Integer.parseInt(port),
                                                path,topic,
                                                username,
                                                password,
                                                level);
-                               log.info("AgentMain.evel_initialize sucess ");
+                               log.info("AgentMain.evel_initialize sucess EVEL_ERR_CODES="+evecode);
                        } catch( Exception e ){
                                log.error("AgentMain.evel_initialize fail ",e);
                        }catch( Error e1 ){
@@ -94,7 +95,7 @@ public class NorthMessageMgr extends DriverThread{
                
                new CollectMessageRecv().start();
                
-               log.error("NorthMessageMgr start sucess ");
+               log.info("NorthMessageMgr start sucess ");
        }
        
        
@@ -309,7 +310,7 @@ public class NorthMessageMgr extends DriverThread{
 
                private EvelScalingMeasurement resultEvelScalingMeasurement(Map<String,String> reMap) {
                        String evname = "Mfvs_"+reMap.get("ElementType")+reMap.get("ObjectType");
-                       String evid = reMap.get("startTime")+reMap.get("ObjectType")+reMap.get("rmUID");
+                       String evid = reMap.get("StartTime")+reMap.get("ObjectType")+reMap.get("rmUID");
                        int Period = Integer.parseInt(reMap.get("Period")!=null?reMap.get("Period"):"15");
                        EvelScalingMeasurement sm  = new EvelScalingMeasurement(Period,evname, evid);
 
index 5b82754..5660fcd 100644 (file)
@@ -1,5 +1,5 @@
 
-# Copyright 2017 CMCC Technologies Co., Ltd
+# Copyright 2017 CMCC Technologies Co. Ltd
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -53,6 +53,13 @@ logging:
       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