summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java6
-rw-r--r--catalog-be/src/main/webapp/WEB-INF/web.xml27
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java14
-rw-r--r--catalog-fe/src/main/webapp/WEB-INF/web.xml26
-rw-r--r--utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java13
5 files changed, 18 insertions, 68 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java
index c60a8d6783..bdee21efc5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/filters/BeServletFilter.java
@@ -148,8 +148,10 @@ public class BeServletFilter implements ContainerRequestFilter, ContainerRespons
log.debug("Close transaction from filter");
TitanDao titanDao = getTitanDao();
if (titanDao != null) {
- if (responseContext.getStatus() == Response.Status.OK.getStatusCode() ||
- responseContext.getStatus() == Response.Status.CREATED.getStatusCode()) {
+ int status = responseContext.getStatus();
+ if (status == Response.Status.OK.getStatusCode() ||
+ status == Response.Status.CREATED.getStatusCode() ||
+ status == Response.Status.NO_CONTENT.getStatusCode()) {
titanDao.commit();
log.debug("Doing commit from filter");
} else {
diff --git a/catalog-be/src/main/webapp/WEB-INF/web.xml b/catalog-be/src/main/webapp/WEB-INF/web.xml
index 93c5194c0c..027601b952 100644
--- a/catalog-be/src/main/webapp/WEB-INF/web.xml
+++ b/catalog-be/src/main/webapp/WEB-INF/web.xml
@@ -148,14 +148,6 @@
<load-on-startup>2</load-on-startup>
</servlet>
- <!-- ECOMP Portal -->
- <servlet>
- <servlet-name>ECOMPServlet</servlet-name>
- <servlet-class>org.onap.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy</servlet-class>
- <load-on-startup>3</load-on-startup>
- <async-supported>true</async-supported>
- </servlet>
-
<servlet>
<servlet-name>ViewStatusMessages</servlet-name>
<servlet-class>ch.qos.logback.classic.ViewStatusMessagesServlet</servlet-class>
@@ -167,25 +159,6 @@
<url-pattern>/lbClassicStatus</url-pattern>
</servlet-mapping>
-<!-- <filter>
- <filter-name>GzipFilter</filter-name>
- <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
- <async-supported>true</async-supported>
- <init-param>
- <param-name>methods</param-name>
- <param-value>GET,POST,PUT,DELETE</param-value>
- </init-param>
- <init-param>
- <param-name>mimeTypes</param-name>
- <param-value>text/html,text/plain,text/css,application/javascript,application/json</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>GzipFilter</filter-name>
- <url-pattern>/sdc2/rest/*</url-pattern>
- </filter-mapping>
--->
-
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application-context.xml</param-value>
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
index 729100a2e8..78d9fe7893 100644
--- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
@@ -24,6 +24,8 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.eclipse.jetty.client.api.Response;
import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.log.enums.EcompLoggerErrorCode;
+import org.openecomp.sdc.common.log.wrappers.Logger;
import org.openecomp.sdc.fe.config.Configuration;
import org.openecomp.sdc.fe.config.ConfigurationManager;
import org.openecomp.sdc.fe.config.FeEcompErrorManager;
@@ -31,8 +33,6 @@ import org.openecomp.sdc.fe.config.PluginsConfiguration;
import org.openecomp.sdc.fe.config.PluginsConfiguration.Plugin;
import org.openecomp.sdc.fe.impl.MdcData;
import org.openecomp.sdc.fe.utils.BeProtocol;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import javax.servlet.http.HttpServletRequest;
@@ -50,7 +50,7 @@ public class FeProxyServlet extends SSLProxyServlet {
private static final String SDC1_FE_PROXY = "/sdc1/feProxy";
private static final String PLUGIN_ID_WORKFLOW = "WORKFLOW";
- private static final Logger log = LoggerFactory.getLogger(FeProxyServlet.class.getName());
+ private static final Logger log = Logger.getLogger(FeProxyServlet.class);
private static Cache<String, MdcData> mdcDataCache = CacheBuilder.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).build();
@@ -67,11 +67,11 @@ public class FeProxyServlet extends SSLProxyServlet {
} catch(MalformedURLException mue){
FeEcompErrorManager.getInstance().logFeHttpLoggingError("FE Request");
- log.error("Unexpected FE request processing error :", mue);
+ log.error(EcompLoggerErrorCode.DATA_ERROR,"FeProxyServlet rewriteTarget", "sdc-FE", "Malformed URL Exception: ", mue);
}
catch (Exception e) {
FeEcompErrorManager.getInstance().logFeHttpLoggingError("FE Request");
- log.error("Unexpected FE request logging error :", e);
+ log.error(EcompLoggerErrorCode.UNKNOWN_ERROR,"FeProxyServlet rewriteTarget", "sdc-FE", "Unexpected FE request processing error: ", e);
}
log.debug("FeProxyServlet Redirecting request from: {} , to: {}", originalUrl, redirectedUrl);
@@ -85,7 +85,7 @@ public class FeProxyServlet extends SSLProxyServlet {
logFeResponse(request, response);
} catch (Exception e) {
FeEcompErrorManager.getInstance().logFeHttpLoggingError("FE Response");
- log.error("Unexpected FE response logging error :", e);
+ log.error(EcompLoggerErrorCode.UNKNOWN_ERROR,"FeProxyServlet onProxyResponseSuccess", "sdc-FE", "Unexpected FE response logging error: ", e);
}
super.onProxyResponseSuccess(request, proxyResponse, response);
}
@@ -158,7 +158,7 @@ public class FeProxyServlet extends SSLProxyServlet {
private String getModifiedUrl(HttpServletRequest request) throws MalformedURLException {
Configuration config = getConfiguration(request);
if (config == null) {
- log.error("failed to retrive configuration.");
+ log.error(EcompLoggerErrorCode.UNKNOWN_ERROR,"FeProxyServlet getModifiedUrl", "sdc-FE", "failed to retrive configuration.");
throw new RuntimeException("failed to read FE configuration");
}
String uri = request.getRequestURI();
diff --git a/catalog-fe/src/main/webapp/WEB-INF/web.xml b/catalog-fe/src/main/webapp/WEB-INF/web.xml
index b217cc0bf4..32680df234 100644
--- a/catalog-fe/src/main/webapp/WEB-INF/web.xml
+++ b/catalog-fe/src/main/webapp/WEB-INF/web.xml
@@ -78,32 +78,6 @@
<servlet-name>KibanaProxy</servlet-name>
<url-pattern>/kibanaProxy/*</url-pattern>
</servlet-mapping>
-
-
-<!-- <filter>
- <filter-name>GzipFilter</filter-name>
- <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
- <async-supported>true</async-supported>
- <init-param>
- <param-name>mimeTypes</param-name>
- <param-value>*/*</param-value>
- </init-param>
- <init-param>
- <param-name>methods</param-name>
- <param-value>GET,POST,PUT,DELETE</param-value>
- </init-param>
- <init-param>
- <param-name>excludePaths</param-name>
- <param-value>/sdc1/feProxy/*</param-value>
- </init-param>
- </filter>
-
-
- <filter-mapping>
- <filter-name>GzipFilter</filter-name>
- <url-pattern>/sdc1/*</url-pattern>
- </filter-mapping>
- -->
<filter>
<filter-name>gzipFilter</filter-name>
diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
index 91e7c555f1..31d52292be 100644
--- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
+++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
@@ -133,13 +133,14 @@ public class SdcProxy extends HttpServlet {
response.setContentType("image/svg+xml");
}
- InputStream responseBodyStream = closeableHttpResponse.getEntity().getContent();
- Header contentEncodingHeader = closeableHttpResponse.getLastHeader("Content-Encoding");
- if (contentEncodingHeader != null && contentEncodingHeader.getValue().equalsIgnoreCase("gzip")) {
- responseBodyStream = new GZIPInputStream(responseBodyStream);
+ if(closeableHttpResponse.getEntity() != null) {
+ InputStream responseBodyStream = closeableHttpResponse.getEntity().getContent();
+ Header contentEncodingHeader = closeableHttpResponse.getLastHeader("Content-Encoding");
+ if (contentEncodingHeader != null && contentEncodingHeader.getValue().equalsIgnoreCase("gzip")) {
+ responseBodyStream = new GZIPInputStream(responseBodyStream);
+ }
+ write(responseBodyStream, response.getOutputStream());
}
- write(responseBodyStream, response.getOutputStream());
-
}
}