aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatesh Kumar, Vijay (vv770d) <vv770d@att.com>2017-05-03 13:52:30 -0400
committerVenkatesh Kumar, Vijay (vv770d) <vv770d@att.com>2017-05-03 13:54:06 -0400
commit5e759d1a8c83f3ee9d7bcf91249e82ef36dec35a (patch)
treee9040bedceae441b5a73e647443cb8025a9c9791
parentd9b4368b020b455e6fe1ffb12cb06236edff0e4b (diff)
[DCAE-14]VES op format & dynamic config
Change-Id: I0ed0cada8c3d6276f8e4adda8ad4451b2222bc76 Signed-off-by: Venkatesh Kumar, Vijay (vv770d) <vv770d@att.com>
-rw-r--r--etc/log4j.xml20
-rw-r--r--pom.xml30
-rw-r--r--src/main/java/org/openecomp/dcae/commonFunction/EventProcessor.java7
-rw-r--r--src/main/java/org/openecomp/dcae/commonFunction/VESLogger.java2
-rw-r--r--src/main/scripts/VESrestfulCollector.sh37
5 files changed, 60 insertions, 36 deletions
diff --git a/etc/log4j.xml b/etc/log4j.xml
index 19023b6..247dbab 100644
--- a/etc/log4j.xml
+++ b/etc/log4j.xml
@@ -97,16 +97,6 @@
<layout class="com.att.nsa.logging.log4j.EcompLayout"><param name="ConversionPattern" value="ECOMP_DEBUG" /></layout>
</appender>
-
- <root>
- <level value="DEBUG" />
- <appender-ref ref="FILE" />
- <appender-ref ref="CONSOLE" />
- <appender-ref ref="ECOMP_AUDIT" />
- <appender-ref ref="ECOMP_DEBUG" />
- <appender-ref ref="ECOMP_ERROR" />
- </root>
-
<logger name="org.openecomp.dcae.commonFunction.input" additivity="false">
<level value="INFO"/>
<appender-ref ref="IFILE"/>
@@ -169,5 +159,15 @@
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</logger>
+
+
+ <root>
+ <level value="DEBUG" />
+ <appender-ref ref="FILE" />
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="ECOMP_AUDIT" />
+ <appender-ref ref="ECOMP_DEBUG" />
+ <appender-ref ref="ECOMP_ERROR" />
+ </root>
</log4j:configuration>
diff --git a/pom.xml b/pom.xml
index 18206fa..7f76f77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,14 +90,14 @@
<dependency>
<groupId>com.att.nsa</groupId>
<artifactId>nsaServerLibrary</artifactId>
- <version>1.0.10</version>
- </dependency>
+ <version>1.0.10</version> </dependency>
+
<!--<dependency>
<groupId>com.att.nsa</groupId>
<artifactId>saToolkit</artifactId>
<version>1.1.3</version>
- </dependency> -->
+ </dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
@@ -117,9 +117,17 @@
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.10</version>
+ </dependency>
+
</dependencies>
+
<!-- <repositories>
<repository>
<id>external-repository</id>
@@ -127,7 +135,6 @@
</repository>
</repositories> -->
-
<build>
<pluginManagement>
<plugins>
@@ -500,7 +507,8 @@
</plugin>
<!-- blackduck maven plugin -->
- <!-- <plugin>
+ <!--
+ <plugin>
<groupId>com.blackducksoftware.integration</groupId>
<artifactId>hub-maven-plugin</artifactId>
<version>1.4.0</version>
@@ -581,9 +589,10 @@
<artifactId>maven-site-plugin</artifactId>
</plugin>
- <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId>
+ <!--
+ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId>
</plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin> -->
+ </plugin> -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
@@ -597,13 +606,17 @@
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
- <executions>
+ <executions>
<execution>
<id>copy</id>
<phase>compile</phase>
@@ -615,7 +628,6 @@
<artifactItem>
<groupId>org.openecomp.dcae.controller</groupId>
<artifactId>dcae-controller-service-standardeventcollector-manager</artifactId>
-
<version>${project.version}</version>
<type>zip</type>
<classifier>runtime</classifier>
diff --git a/src/main/java/org/openecomp/dcae/commonFunction/EventProcessor.java b/src/main/java/org/openecomp/dcae/commonFunction/EventProcessor.java
index a5e90b9..5f27217 100644
--- a/src/main/java/org/openecomp/dcae/commonFunction/EventProcessor.java
+++ b/src/main/java/org/openecomp/dcae/commonFunction/EventProcessor.java
@@ -69,8 +69,6 @@ public class EventProcessor implements Runnable {
//EventPublisher Ep=new EventPublisher();
while (event != null) {
// As long as the producer is running we remove elements from the queue.
-
- //UUID uuid = UUID.fromString(event.get("VESuniqueId").toString());
String uuid = event.get("VESuniqueId").toString();
LoggingContext localLC = VESLogger.getLoggingContextForThread(uuid.toString());
localLC .put ( EcompFields.kBeginTimestampMs, SaClock.now () );
@@ -110,10 +108,9 @@ public class EventProcessor implements Runnable {
final SimpleDateFormat sdf = new SimpleDateFormat("EEE, MM dd yyyy hh:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
- JSONArray additionalParametersarray = new JSONArray().put(new JSONObject().put("collectorTimeStamp", sdf.format(currentTime)));
- JSONObject additionalParameter = new JSONObject().put("additionalParameters",additionalParametersarray );
+ JSONObject collectorTimeStamp = new JSONObject().put("collectorTimeStamp",sdf.format(currentTime) );
JSONObject commonEventHeaderkey = event.getJSONObject("event").getJSONObject("commonEventHeader");
- commonEventHeaderkey.put("internalHeaderFields", additionalParameter);
+ commonEventHeaderkey.put("internalHeaderFields", collectorTimeStamp);
event.getJSONObject("event").put("commonEventHeader",commonEventHeaderkey);
log.debug("Modified event:" + event);
diff --git a/src/main/java/org/openecomp/dcae/commonFunction/VESLogger.java b/src/main/java/org/openecomp/dcae/commonFunction/VESLogger.java
index 7a70013..9b16d01 100644
--- a/src/main/java/org/openecomp/dcae/commonFunction/VESLogger.java
+++ b/src/main/java/org/openecomp/dcae/commonFunction/VESLogger.java
@@ -116,7 +116,7 @@ public class VESLogger {
build();
// Establish the request-specific UUID, as long as we are here...
threadLC.put("requestId", aUuid);
- threadLC.put ( "statusCode", "COMPLETED" );
+ threadLC.put ( "statusCode", "COMPLETE" );
threadLC.put ( EcompFields.kEndTimestamp, SaClock.now () );
return threadLC;
}
diff --git a/src/main/scripts/VESrestfulCollector.sh b/src/main/scripts/VESrestfulCollector.sh
index a6d2d27..7935cb9 100644
--- a/src/main/scripts/VESrestfulCollector.sh
+++ b/src/main/scripts/VESrestfulCollector.sh
@@ -38,16 +38,6 @@ collector_start() {
BASEDIR=`dirname $0`
cd $BASEDIR/..
- # use JAVA_HOME if provided
- if [ -z "$JAVA_HOME" ]; then
- echo "ERROR: JAVA_HOME not setup"
- echo "Startup Aborted!!"
- exit 1
- #JAVA=java
- else
- JAVA=$JAVA_HOME/bin/java
- fi
-
# run java. The classpath is the etc dir for config files, and the lib dir
# for all the jars.
nohup $JAVA -cp "etc${PATHSEP}lib/*" $JAVA_OPTS -Dhttps.protocols=TLSv1.1,TLSv1.2 $MAINCLASS $* &
@@ -87,9 +77,20 @@ fi
## Pre-setting
+# use JAVA_HOME if provided
+if [ -z "$JAVA_HOME" ]; then
+ echo "ERROR: JAVA_HOME not setup"
+ echo "Startup Aborted!!"
+ exit 1
+ #JAVA=java
+else
+ JAVA=$JAVA_HOME/bin/java
+fi
+
+
MAINCLASS=org.openecomp.dcae.commonFunction.CommonStartup
-# determin a path separator that works for this platform
+# determine a path separator that works for this platform
PATHSEP=":"
case "$(uname -s)" in
@@ -108,6 +109,20 @@ case "$(uname -s)" in
esac
+if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$DOCKER_HOST" ]; then
+ echo "INFO: USING STANDARD CONTROLLER CONFIGURATION"
+else
+
+ echo "INFO: DYNAMIC CONFIG INTERFACE SUPPORTED"
+ CONFIG_UPDATER=org.openecomp.dcae.commonFunction.DynamicPropertyReader
+ $JAVA -cp "etc${PATHSEP}lib/*" $CONFIG_UPDATER $*
+ if [ $? -ne 0 ]; then
+ echo "ERROR: Failed to read dynamic configuration from consul"
+ else
+ echo "INFO: Dynamic config updated successfully!"
+ fi
+fi
+
case $1 in
"start")