summaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/main
diff options
context:
space:
mode:
authorEmmettCox <emmett.cox@est.tech>2019-02-18 12:24:01 +0000
committerEmmettCox <emmett.cox@est.tech>2019-02-18 12:24:01 +0000
commitefa3decef17b55b6ce8226c78c6d8327e0a41896 (patch)
tree6a9357d6bc92ae7be58471b4f427c78dfa08e13d /datarouter-prov/src/main
parentc50374709585766e887f349a139de0a6595c1ca1 (diff)
Allow LogServlet to query based upon Filename
Documentation updates for filename Query on LogServlet Change-Id: I22036c42e202831766a7968bd434340cfcb6c2f5 Issue-ID: DMAAP-1022 Issue-ID: DMAAP-1029 Signed-off-by: EmmettCox <emmett.cox@est.tech>
Diffstat (limited to 'datarouter-prov/src/main')
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java13
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/PublishRecord.java2
2 files changed, 11 insertions, 4 deletions
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
index eceab571..8a1a4ba5 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/LogServlet.java
@@ -69,7 +69,7 @@ public class LogServlet extends BaseServlet {
private static final String FMT_1 = "yyyy-MM-dd'T'HH:mm:ss'Z'";
private static final String FMT_2 = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
- private static boolean isfeedlog;
+ private boolean isfeedlog;
public abstract class RowHandler {
private final ServletOutputStream out;
@@ -281,12 +281,14 @@ public class LogServlet extends BaseServlet {
map.put("err", "bad type");
return map;
}
- } else
+ } else {
map.put("type", "all");
+ }
map.put("publishSQL", "");
map.put("statusSQL", "");
map.put("resultSQL", "");
map.put("reasonSQL", "");
+ map.put("filenameSQL", "");
s = req.getParameter("publishId");
if (s != null) {
@@ -297,6 +299,11 @@ public class LogServlet extends BaseServlet {
map.put("publishSQL", " AND PUBLISH_ID = '"+s+"'");
}
+ s = req.getParameter("filename");
+ if (s != null) {
+ map.put("filenameSQL", " AND FILENAME = '"+s+"'");
+ }
+
s = req.getParameter("statusCode");
if (s != null) {
String sql = null;
@@ -388,7 +395,7 @@ public class LogServlet extends BaseServlet {
if (type.equals("all") || type.equals("pub")) {
String sql = "select * from LOG_RECORDS where FEEDID = "+feedid
+ " AND TYPE = 'pub'"
- + map.get("timeSQL") + map.get("publishSQL") + map.get("statusSQL");
+ + map.get("timeSQL") + map.get("publishSQL") + map.get("statusSQL") + map.get("filenameSQL");
getRecordsForSQL(sql, rh);
}
}
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/PublishRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/PublishRecord.java
index 2cde3971..5e16bac8 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/PublishRecord.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/PublishRecord.java
@@ -68,7 +68,7 @@ public class PublishRecord extends BaseLogRecord {
this.remoteAddr = rs.getString("REMOTE_ADDR");
this.user = rs.getString("USER");
this.status = rs.getInt("STATUS");
- this.fileName = StringUtils.substringAfterLast(this.getRequestUri(), "/");
+ this.fileName = rs.getString("FILENAME");
}
public String getFeedFileid() {