diff --git a/edexOsgi/build.edex/edex/common.properties b/edexOsgi/build.edex/edex/common.properties
index 8f818c6f25..735e3693d4 100644
--- a/edexOsgi/build.edex/edex/common.properties
+++ b/edexOsgi/build.edex/edex/common.properties
@@ -4,7 +4,7 @@ architecture=x86_64
includegen.filter=raytheon|noaa\.nws|noaa\.gsd
# AWIPSII core repositores required for build
-core.repositories=ufcore,ufcore-foss
+core.repositories=ufcore,ufcore-foss,AWIPS2_foss
# Note: currently, there is a limit of 99 plugin directories.
dir.01=cave
diff --git a/edexOsgi/com.raytheon.uf.edex.cots.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.cots.feature/feature.xml
index a851809667..c1c3303419 100644
--- a/edexOsgi/com.raytheon.uf.edex.cots.feature/feature.xml
+++ b/edexOsgi/com.raytheon.uf.edex.cots.feature/feature.xml
@@ -102,4 +102,10 @@
install-size="0"
version="0.0.0"/>
+
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * September, 2013 behemmi Initial creation + * May 23, 2014 3199 bclement moved to edex.soap from edex.log + * + *+ * + * @author behemmi + * @version 1.0 + */ +public class CXFLogger extends org.apache.cxf.interceptor.LoggingInInterceptor { + + protected IUFStatusHandler log = UFStatus.getHandler(this.getClass()); + + @Override + public void handleMessage(Message message) throws Fault { + if (writer != null || + RequestLogController.getInstance().shouldLogRequestsInfo() && + log.isPriorityEnabled(RequestLogController.getInstance().getRequestLogLevel())) { + logging(message); + } + } + + /** + * implement custom content for incoming requests in our own log format + * @param message + * @throws Fault + */ + protected void logging(Message message) throws Fault { + if (message.containsKey(LoggingMessage.ID_KEY)) { + return; + } + String id = (String)message.getExchange().get(LoggingMessage.ID_KEY); + if (id == null) { + id = LoggingMessage.nextId(); + message.getExchange().put(LoggingMessage.ID_KEY, id); + } + message.put(LoggingMessage.ID_KEY, id); + final LoggingMessage buffer + = new LoggingMessage("Inbound Message\n--------------------------", id); + + Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); + if (responseCode != null) { + buffer.getResponseCode().append(responseCode); + } + + String encoding = (String)message.get(Message.ENCODING); + + if (encoding != null) { + buffer.getEncoding().append(encoding); + } + String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD); + if (httpMethod != null) { + buffer.getHttpMethod().append(httpMethod); + } + String ct = (String)message.get(Message.CONTENT_TYPE); + if (ct != null) { + buffer.getContentType().append(ct); + } + Object headers = message.get(Message.PROTOCOL_HEADERS); + + if (headers != null) { + buffer.getHeader().append(headers); + } + String uri = (String)message.get(Message.REQUEST_URL); + if (uri != null) { + buffer.getAddress().append(uri); + String query = (String)message.get(Message.QUERY_STRING); + if (query != null) { + buffer.getAddress().append("?").append(query); + } + } + + if (!isShowBinaryContent() && isBinaryContent(ct)) { + buffer.getMessage().append(BINARY_CONTENT_MESSAGE).append('\n'); + log.handle(RequestLogController.getInstance().getRequestLogLevel(), + buffer.toString()); + return; + } + + InputStream is = message.getContent(InputStream.class); + if (is != null) { + CachedOutputStream bos = new CachedOutputStream(); + if (threshold > 0) { + bos.setThreshold(threshold); + } + try { + // use the appropriate input stream and restore it later + InputStream bis = is instanceof DelegatingInputStream + ? ((DelegatingInputStream)is).getInputStream() : is; + + IOUtils.copyAndCloseInput(bis, bos); + bos.flush(); + bis = bos.getInputStream(); + + // restore the delegating input stream or the input stream + if (is instanceof DelegatingInputStream) { + ((DelegatingInputStream)is).setInputStream(bis); + } else { + message.setContent(InputStream.class, bis); + } + + if (bos.getTempFile() != null) { + //large thing on disk... + buffer.getMessage().append("\nMessage (saved to tmp file):\n"); + buffer.getMessage().append("Filename: " + bos.getTempFile().getAbsolutePath() + "\n"); + } + if (bos.size() > limit) { + buffer.getMessage().append("(message truncated to " + limit + " bytes)\n"); + } + writePayload(buffer.getPayload(), bos, encoding, ct); + + bos.close(); + } catch (Exception e) { + throw new Fault(e); + } + } + log.handle(RequestLogController.getInstance().getRequestLogLevel(), + buffer.toString()); + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/CustomWsdlInterceptor.java similarity index 97% rename from edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java rename to edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/CustomWsdlInterceptor.java index 501af5428e..bbc31b088e 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java +++ b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/CustomWsdlInterceptor.java @@ -7,7 +7,7 @@ * in and to this copyrighted software are as specified in DFARS * 252.227-7014 which was made part of the above contract. */ -package com.raytheon.uf.edex.ogc.common.soap; +package com.raytheon.uf.edex.soap; import java.io.IOException; import java.io.InputStream; @@ -41,6 +41,7 @@ import com.raytheon.uf.common.status.UFStatus; * ------------ ---------- ----------- -------------------------- * Jan 28, 2013 bclement Initial creation * 5/2/2014 #3192 bhillip Minor fix for CXF upgrade to 2.7.10 + * May 23, 2014 3199 bclement moved to edex.soap from edex.ogc.common * * * diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/JaxWsConfigServerFactoryBean.java b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/JaxWsConfigServerFactoryBean.java similarity index 97% rename from edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/JaxWsConfigServerFactoryBean.java rename to edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/JaxWsConfigServerFactoryBean.java index a6831fff94..dec9a1b53b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/JaxWsConfigServerFactoryBean.java +++ b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/JaxWsConfigServerFactoryBean.java @@ -7,7 +7,7 @@ * in and to this copyrighted software are as specified in DFARS * 252.227-7014 which was made part of the above contract. */ -package com.raytheon.uf.edex.ogc.common.soap; +package com.raytheon.uf.edex.soap; import java.util.Arrays; import java.util.HashMap; @@ -34,6 +34,7 @@ import com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 21, 2012 bclement Initial creation + * May 23, 2014 3199 bclement moved to edex.soap from edex.ogc.common * * * diff --git a/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/RequestLogController.java b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/RequestLogController.java new file mode 100644 index 0000000000..6f4aed4a91 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.soap/src/com/raytheon/uf/edex/soap/RequestLogController.java @@ -0,0 +1,75 @@ +/** + * Copyright 09/24/12 Raytheon Company. + * + * Unlimited Rights + * This software was developed pursuant to Contract Number + * DTFAWA-10-D-00028 with the US Government. The US Government’s rights + * in and to this copyrighted software are as specified in DFARS + * 252.227-7014 which was made part of the above contract. + */ +package com.raytheon.uf.edex.soap; + +import com.raytheon.uf.common.status.UFStatus.Priority; + +/** + * Singleton to control how incoming request information is logged. Implemented + * as a singleton to allow runtime control from a Web Client + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * September, 2013 behemmi Initial creation + * May 23, 2014 3199 bclement moved to edex.soap from edex.log + * + *+ * + * @author behemmi + * @version 1.0 + */ +public class RequestLogController { + + private static RequestLogController instance = null; + + private Priority requestLogLevel; + private boolean shouldLogRequestsInfo; + + private RequestLogController(){ + requestLogLevel = Priority.DEBUG; + shouldLogRequestsInfo = true; + } + + public static RequestLogController getInstance() { + if(instance == null) { + instance = new RequestLogController(); + } + return instance; + } + + public Priority getRequestLogLevel() { + return requestLogLevel; + } + + public void setRequestLogLevel(Priority requestLogLevel) { + this.requestLogLevel = requestLogLevel; + } + + public boolean shouldLogRequestsInfo() { + return getShouldLogRequestsInfo(); + } + + /** + * Traditional getter for Jackson serialization. + * + * @return shouldLogRequestsInfo - if this logger is enabled + */ + public boolean getShouldLogRequestsInfo() { + return shouldLogRequestsInfo; + } + + public void setShouldLogRequestsInfo(boolean shouldLogRequestsInfo) { + this.shouldLogRequestsInfo = shouldLogRequestsInfo; + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF index 39d1159740..2ab77c5fbb 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF @@ -23,7 +23,8 @@ Require-Bundle: org.geotools;bundle-version="2.6.4", com.raytheon.uf.common.pointdata;bundle-version="1.12.1174", org.apache.commons.collections;bundle-version="3.2.0", org.apache.commons.cxf;bundle-version="1.0.0", - com.raytheon.uf.common.http + com.raytheon.uf.common.http, + com.raytheon.uf.edex.soap;bundle-version="1.14.0" Export-Package: com.raytheon.uf.edex.wfs, com.raytheon.uf.edex.wfs.feature, com.raytheon.uf.edex.wfs.filter, diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/res/spring/wfs-ogc-soap-request.xml b/edexOsgi/com.raytheon.uf.edex.wfs/res/spring/wfs-ogc-soap-request.xml index dc7b1299f8..9d8bae257e 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/res/spring/wfs-ogc-soap-request.xml +++ b/edexOsgi/com.raytheon.uf.edex.wfs/res/spring/wfs-ogc-soap-request.xml @@ -9,7 +9,7 @@