mw.write("X-DMAAP-DR-ROUTING\t" + t.getRouting() + "\n");
}
mw.close();
- meta.renameTo(new File(dbase + ".M"));
+ if (!meta.renameTo(new File(dbase + ".M"))) {
+ eelfLogger.error("Rename of file " + dbase + " failed.");
+ }
}
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
try {
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
- <dependency>
- <groupId>org.dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>2.1.1</version>
- </dependency>
<dependency>
<groupId>org.sonatype.http-testing-harness</groupId>
<artifactId>junit-runner</artifactId>
-#-------------------------------------------------------------------------------\r
+<!------------------------------------------------------------------------------\r
# ============LICENSE_START==================================================\r
# * org.onap.dmaap\r
# * ===========================================================================\r
# *\r
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
# *\r
-#-------------------------------------------------------------------------------\r
+#------------------------------------------------------------------------------->\r
\r
-<html>\r
+<!DOCTYPE html>\r
+<html lang="en">\r
<head>\r
+ <title>DMaaP DR Authz Impl package</title>\r
</head>\r
<body>\r
<p>\r
implementation.\r
</li>\r
</ul>\r
-</p>\r
-<p>\r
Example:\r
<pre>\r
<code>\r
-#-------------------------------------------------------------------------------\r
+<!-------------------------------------------------------------------------------\r
# ============LICENSE_START==================================================\r
# * org.onap.dmaap\r
# * ===========================================================================\r
# *\r
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
# *\r
-#-------------------------------------------------------------------------------\r
+#------------------------------------------------------------------------------->\r
\r
-<html>\r
+<!DOCTYPE html>\r
+<html lang="en">\r
<head>\r
+ <title>DMaaP DR Authz package</title>\r
</head>\r
<body>\r
<p>\r
import java.sql.SQLException;\r
import java.text.ParseException;\r
import java.text.SimpleDateFormat;\r
+import java.time.LocalDateTime;\r
+import java.time.format.DateTimeFormatter;\r
import java.util.Calendar;\r
import java.util.Date;\r
import java.util.HashMap;\r
ResultSet rs = ps.executeQuery()) {\r
if ("csv".equals(outputType)) {\r
resp.setContentType("application/octet-stream");\r
- Date date = new Date();\r
- SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-YYYY HH:mm:ss");\r
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss");\r
resp.setHeader("Content-Disposition",\r
- "attachment; filename=\"result:" + dateFormat.format(date) + ".csv\"");\r
+ "attachment; filename=\"result:" + LocalDateTime.now().format(formatter) + ".csv\"");\r
eventlogger.info("Generating CSV file from Statistics resultset");\r
rsToCSV(rs, out);\r
} else {\r
-#-------------------------------------------------------------------------------\r
+<!-------------------------------------------------------------------------------\r
# ============LICENSE_START==================================================\r
# * org.onap.dmaap\r
# * ===========================================================================\r
# *\r
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
# *\r
-#-------------------------------------------------------------------------------\r
+#------------------------------------------------------------------------------->\r
\r
-<html>\r
+<!DOCTYPE html>\r
+<html lang="en">\r
+<head>\r
+ <title>DMaaP DR Provisioning Beans</title>\r
+</head>\r
<body>\r
<p>\r
This package provides beans to represent the basic provisioning objects of the Data Router application.\r
-These objects are defined by the document <b>Data Router Release 1 Provisioning API</b> <i>Version 1.2</i>.\r
+These objects are defined by the document <strong>Data Router Release 1 Provisioning API</strong> <em>Version 1.2</em>.\r
</p>\r
</body>\r
</html>\r
-#-------------------------------------------------------------------------------
+<!-------------------------------------------------------------------------------
# ============LICENSE_START==================================================
# * org.onap.dmaap
# * ===========================================================================
# *
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
# *
-#-------------------------------------------------------------------------------
+#------------------------------------------------------------------------------->
-<html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>DMaaP DR Provisioning Servlets</title>
+</head>
<body>
<p>
This package provides the servlets used by the provisioning server for the Data Router application.
-URLs are from the document <b>URLs for DR Release 1</b> <i>Version 1.2</i>.
+URLs are from the document <strong>URLs for DR Release 1</strong> <em>Version 1.2</em>.
</p>
<div class="contentContainer">
-<table class="packageSummary" border="0" cellpadding="3" cellspacing="0">
+<table class="packageSummary" border="0">
<caption><span>URL Path Summary</span><span class="tabEnd"> </span></caption>
<tr class="altColor">
- <th class="colFirst">URL Path</th>
- <th class="colOne">Symbolic Name</th>
- <th class="colLast">Servlet Name</th>
- <th class="colLast" colspan="4">Allowed Methods</th>
+ <th class="colFirst" scope="col">URL Path</th>
+ <th class="colOne" scope="col">Symbolic Name</th>
+ <th class="colLast" scope="col">Servlet Name</th>
+ <th class="colLast" colspan="4" scope="col">Allowed Methods</th>
</tr>
<tr>
<td class="colFirst" class="colOne">/</td>
-#-------------------------------------------------------------------------------\r
+<!-------------------------------------------------------------------------------\r
# ============LICENSE_START==================================================\r
# * org.onap.dmaap\r
# * ===========================================================================\r
# *\r
# * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
# *\r
-#-------------------------------------------------------------------------------\r
+#------------------------------------------------------------------------------->\r
\r
-<html>\r
+<!DOCTYPE html>\r
+<html lang="en">\r
+<head>\r
+ <title>DMaaP DR Provisioning Utils</title>\r
+</head>\r
<body>\r
<p>\r
This package provide various helper classes used by the provisioning server.\r
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- <scope>compile</scope>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>powermock-api-mockito</artifactId>
+ <groupId>org.powermock</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
<profiles>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
+ <include>**/logback.xml</include>
</includes>
</resource>
</resources>
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
public class SampleSubscriberServlet extends HttpServlet {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.SampleSubscriberServlet");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SampleSubscriberServlet.class);
private static String outputDirectory;
private static String basicAuth;
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.Arrays;
-import org.apache.log4j.Logger;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration;
public class SubscriberMain {
- private static Logger logger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.SubscriberMain");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SubscriberMain.class);
/**
* Main class for Subscriber.
package org.onap.dmaap.datarouter.subscriber;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.IOException;
import java.util.Properties;
-import org.apache.log4j.Logger;
public class SubscriberProps {
private static SubscriberProps instance = null;
- private static Logger subLogger = Logger.getLogger("org.onap.dmaap.datarouter.subscriber.internal");
+ private static EELFLogger logger = EELFManager.getInstance().getLogger(SubscriberProps.class);
private Properties properties;
private SubscriberProps(String propsPath) throws IOException {
try {
instance = new SubscriberProps(propsPath);
} catch (IOException ioe) {
- subLogger.error("IO Exception: " + ioe.getMessage(), ioe);
+ logger.error("IO Exception: " + ioe.getMessage(), ioe);
}
}
return instance;
ENTRYPOINT ["sh", "startup.sh"]
RUN groupadd -g 1001 onap \
- && useradd -u 1000 datarouter -g onap \
- && chown -R datarouter:onap /opt/
+ && useradd -u 1000 dradmin -g onap \
+ && chown -R dradmin:onap /opt/ /var/
-USER datarouter
\ No newline at end of file
+USER dradmin
\ No newline at end of file
+++ /dev/null
-#-------------------------------------------------------------------------------
-# ============LICENSE_START==================================================
-# * org.onap.dmaap
-# * ===========================================================================
-# * Copyright � 2017 AT&T Intellectual Property. All rights reserved.
-# * ===========================================================================
-# * Licensed under the Apache License, Version 2.0 (the "License");
-# * you may not use this file except in compliance with the License.
-# * You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# * ============LICENSE_END====================================================
-# *
-# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# *
-#-------------------------------------------------------------------------------
-
-log4j.rootLogger=info,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=/opt/app/subscriber/logs/subscriber.log
-log4j.appender.Root.datePattern='.'yyyyMMdd
-log4j.appender.Root.append=true
-log4j.appender.Root.layout=org.apache.log4j.PatternLayout
-log4j.appender.Root.layout.ConversionPattern=%d %p %t %m%n
--- /dev/null
+<!--
+ ============LICENSE_START==================================================
+ * org.onap.dmaap
+ * ===========================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
+-->
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+ <property name="logDir" value="/var/log/onap/datarouter" />
+ <property name="generalLogName" value="application" />
+ <property name="errorLogName" value="errors" />
+ <property name="defaultPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%msg%n" />
+ <property name="logDirectory" value="${logDir}" />
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+
+ <!-- The EELFAppender is used to record events to the general application
+ log -->
+
+
+ <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELF" />
+ </appender>
+
+ <appender name="EELFError"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${errorLogName}.log</file>
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFError"/>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+ <logger name="com.att.eelf" level="info" additivity="false">
+ <appender-ref ref="asyncEELF" />
+ </logger>
+
+ <logger name="com.att.eelf.error" level="error" additivity="false">
+ <appender-ref ref="asyncEELFError" />
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="asyncEELF" />
+ <appender-ref ref="asyncEELFError" />
+ </root>
+
+</configuration>
+++ /dev/null
-#-------------------------------------------------------------------------------
-# ============LICENSE_START==================================================
-# * org.onap.dmaap
-# * ===========================================================================
-# * Copyright � 2017 AT&T Intellectual Property. All rights reserved.
-# * ===========================================================================
-# * Licensed under the Apache License, Version 2.0 (the "License");
-# * you may not use this file except in compliance with the License.
-# * You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# * ============LICENSE_END====================================================
-# *
-# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# *
-#-------------------------------------------------------------------------------
-
-log4j.rootLogger=info,Root
-
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=./logs/subscriber.log
-log4j.appender.Root.datePattern='.'yyyyMMdd
-log4j.appender.Root.append=true
-log4j.appender.Root.layout=org.apache.log4j.PatternLayout
-log4j.appender.Root.layout.ConversionPattern=%d %p %t %m%n
--- /dev/null
+<!--
+ ============LICENSE_START==================================================
+ * org.onap.dmaap
+ * ===========================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
+-->
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+ <property name="logDir" value="logs/EELF" />
+ <property name="generalLogName" value="application" />
+ <property name="errorLogName" value="errors" />
+ <property name="defaultPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{InvocationId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%msg%n" />
+ <property name="logDirectory" value="${logDir}" />
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+
+ <!-- The EELFAppender is used to record events to the general application
+ log -->
+
+
+ <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELF" />
+ </appender>
+
+ <appender name="EELFError"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${errorLogName}.log</file>
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFError"/>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+ <logger name="com.att.eelf" level="info" additivity="false">
+ <appender-ref ref="asyncEELF" />
+ </logger>
+
+ <logger name="com.att.eelf.error" level="error" additivity="false">
+ <appender-ref ref="asyncEELFError" />
+ </logger>
+
+ <root level="DEBUG">
+ <appender-ref ref="asyncEELF" />
+ <appender-ref ref="asyncEELFError" />
+ </root>
+
+</configuration>
<exclude>IntegrationSuite.java</exclude>
</excludes>
<argLine>
- --illegal-access=permit
+ ${surefireArgLine} --illegal-access=permit
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>3.0.1</version>
+ <version>3.2.0</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <dataFile>${project.build.directory}/code-coverage/jacoco.exec</dataFile>
- <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</pluginManagement>
</build>