diff options
author | sunil unnava <sunil.unnava@att.com> | 2018-10-24 15:20:01 -0400 |
---|---|---|
committer | sunil unnava <sunil.unnava@att.com> | 2018-10-24 15:20:23 -0400 |
commit | 357b7483c755ad7e5d67d48c9f6013a64ee3fdd3 (patch) | |
tree | 5ecffaacb3948cbc9bb031c68b197aeed510573a /src/main/java | |
parent | f16b3cfc7dc3fcb0b946643709dc7e738c91008a (diff) |
update the package name
Issue-ID: DMAAP-858
Change-Id: I59c824c2c913de32e59a7300e88fdffcdd7b32ed
Signed-off-by: sunil unnava <sunil.unnava@att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/dmaap/DMaaPCambriaExceptionMapper.java (renamed from src/main/java/com/att/nsa/dmaap/DMaaPCambriaExceptionMapper.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/DMaaPWebExceptionMapper.java (renamed from src/main/java/com/att/nsa/dmaap/DMaaPWebExceptionMapper.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/HelloWorld.java (renamed from src/main/java/com/att/nsa/dmaap/HelloWorld.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/JaxrsEchoService.java (renamed from src/main/java/com/att/nsa/dmaap/JaxrsEchoService.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/JaxrsUserService.java (renamed from src/main/java/com/att/nsa/dmaap/JaxrsUserService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesListener.java (renamed from src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesListener.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesMap.java (renamed from src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/filemonitor/ServicePropertyService.java (renamed from src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/mmagent/CreateMirrorMaker.java (renamed from src/main/java/com/att/nsa/dmaap/mmagent/CreateMirrorMaker.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/mmagent/MMAgentUtil.java (renamed from src/main/java/com/att/nsa/dmaap/mmagent/MMAgentUtil.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/mmagent/MirrorMaker.java (renamed from src/main/java/com/att/nsa/dmaap/mmagent/MirrorMaker.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/mmagent/UpdateMirrorMaker.java (renamed from src/main/java/com/att/nsa/dmaap/mmagent/UpdateMirrorMaker.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/mmagent/UpdateWhiteList.java (renamed from src/main/java/com/att/nsa/dmaap/mmagent/UpdateWhiteList.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/AdminRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/AdminRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/ApiKeysRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/ApiKeysRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/EventsRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/EventsRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/MMRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/MMRestService.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/MetricsRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/MetricsRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/ServiceUtil.java (renamed from src/main/java/com/att/nsa/dmaap/service/ServiceUtil.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/TopicRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/TopicRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/TransactionRestService.java (renamed from src/main/java/com/att/nsa/dmaap/service/TransactionRestService.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/service/UIRestServices.java (renamed from src/main/java/com/att/nsa/dmaap/service/UIRestServices.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/tools/ConfigTool.java (renamed from src/main/java/com/att/nsa/dmaap/tools/ConfigTool.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/tools/ConfigToolContext.java (renamed from src/main/java/com/att/nsa/dmaap/tools/ConfigToolContext.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/util/ContentLengthInterceptor.java (renamed from src/main/java/com/att/nsa/dmaap/util/ContentLengthInterceptor.java) | 222 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/util/DMaaPAuthFilter.java (renamed from src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/util/ServicePropertiesMapBean.java (renamed from src/main/java/com/att/nsa/dmaap/util/ServicePropertiesMapBean.java) | 4 |
27 files changed, 140 insertions, 140 deletions
diff --git a/src/main/java/com/att/nsa/dmaap/DMaaPCambriaExceptionMapper.java b/src/main/java/org/onap/dmaap/DMaaPCambriaExceptionMapper.java index 5408d62..4b9324e 100644 --- a/src/main/java/com/att/nsa/dmaap/DMaaPCambriaExceptionMapper.java +++ b/src/main/java/org/onap/dmaap/DMaaPCambriaExceptionMapper.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap; + package org.onap.dmaap; import javax.inject.Singleton; diff --git a/src/main/java/com/att/nsa/dmaap/DMaaPWebExceptionMapper.java b/src/main/java/org/onap/dmaap/DMaaPWebExceptionMapper.java index a59f8ca..389fb5c 100644 --- a/src/main/java/com/att/nsa/dmaap/DMaaPWebExceptionMapper.java +++ b/src/main/java/org/onap/dmaap/DMaaPWebExceptionMapper.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap; + package org.onap.dmaap; import javax.inject.Singleton; diff --git a/src/main/java/com/att/nsa/dmaap/HelloWorld.java b/src/main/java/org/onap/dmaap/HelloWorld.java index a4cccba..5907e7f 100644 --- a/src/main/java/com/att/nsa/dmaap/HelloWorld.java +++ b/src/main/java/org/onap/dmaap/HelloWorld.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap; + package org.onap.dmaap; import org.apache.camel.Exchange; diff --git a/src/main/java/com/att/nsa/dmaap/JaxrsEchoService.java b/src/main/java/org/onap/dmaap/JaxrsEchoService.java index 72416da..1bebaf8 100644 --- a/src/main/java/com/att/nsa/dmaap/JaxrsEchoService.java +++ b/src/main/java/org/onap/dmaap/JaxrsEchoService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap; + package org.onap.dmaap; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -31,7 +31,7 @@ import com.att.eelf.configuration.EELFManager; import com.att.ajsc.beans.PropertiesMapBean; -import com.att.nsa.dmaap.filemonitor.ServicePropertiesMap; +import org.onap.dmaap.filemonitor.ServicePropertiesMap; /** * Example JAX-RS Service diff --git a/src/main/java/com/att/nsa/dmaap/JaxrsUserService.java b/src/main/java/org/onap/dmaap/JaxrsUserService.java index 0631a13..714a9c1 100644 --- a/src/main/java/com/att/nsa/dmaap/JaxrsUserService.java +++ b/src/main/java/org/onap/dmaap/JaxrsUserService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap; + package org.onap.dmaap; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesListener.java b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesListener.java index edbdadf..56cccca 100644 --- a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesListener.java +++ b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesListener.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.filemonitor; + package org.onap.dmaap.filemonitor; import java.io.File; diff --git a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesMap.java index 219a601..27cf0a2 100644 --- a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java +++ b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertiesMap.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.filemonitor; + package org.onap.dmaap.filemonitor; import java.util.HashMap; diff --git a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertyService.java index 55c1661..fe25e58 100644 --- a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java +++ b/src/main/java/org/onap/dmaap/filemonitor/ServicePropertyService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.filemonitor; + package org.onap.dmaap.filemonitor; import java.io.File; import java.io.FileInputStream; diff --git a/src/main/java/com/att/nsa/dmaap/mmagent/CreateMirrorMaker.java b/src/main/java/org/onap/dmaap/mmagent/CreateMirrorMaker.java index 35b4f03..72df46f 100644 --- a/src/main/java/com/att/nsa/dmaap/mmagent/CreateMirrorMaker.java +++ b/src/main/java/org/onap/dmaap/mmagent/CreateMirrorMaker.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.mmagent; + package org.onap.dmaap.mmagent; import java.util.Date; diff --git a/src/main/java/com/att/nsa/dmaap/mmagent/MMAgentUtil.java b/src/main/java/org/onap/dmaap/mmagent/MMAgentUtil.java index 8b1ec3f..f2ddaed 100644 --- a/src/main/java/com/att/nsa/dmaap/mmagent/MMAgentUtil.java +++ b/src/main/java/org/onap/dmaap/mmagent/MMAgentUtil.java @@ -22,7 +22,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.mmagent; + package org.onap.dmaap.mmagent; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/com/att/nsa/dmaap/mmagent/MirrorMaker.java b/src/main/java/org/onap/dmaap/mmagent/MirrorMaker.java index e3f688e..480c40f 100644 --- a/src/main/java/com/att/nsa/dmaap/mmagent/MirrorMaker.java +++ b/src/main/java/org/onap/dmaap/mmagent/MirrorMaker.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.mmagent; + package org.onap.dmaap.mmagent; public class MirrorMaker { public String name; diff --git a/src/main/java/com/att/nsa/dmaap/mmagent/UpdateMirrorMaker.java b/src/main/java/org/onap/dmaap/mmagent/UpdateMirrorMaker.java index 6e7a0f3..1c2f32c 100644 --- a/src/main/java/com/att/nsa/dmaap/mmagent/UpdateMirrorMaker.java +++ b/src/main/java/org/onap/dmaap/mmagent/UpdateMirrorMaker.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.mmagent; + package org.onap.dmaap.mmagent; import java.util.Date; diff --git a/src/main/java/com/att/nsa/dmaap/mmagent/UpdateWhiteList.java b/src/main/java/org/onap/dmaap/mmagent/UpdateWhiteList.java index a1064a4..dc67298 100644 --- a/src/main/java/com/att/nsa/dmaap/mmagent/UpdateWhiteList.java +++ b/src/main/java/org/onap/dmaap/mmagent/UpdateWhiteList.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.mmagent; + package org.onap.dmaap.mmagent; public class UpdateWhiteList { diff --git a/src/main/java/com/att/nsa/dmaap/service/AdminRestService.java b/src/main/java/org/onap/dmaap/service/AdminRestService.java index d2bf081..61f6a08 100644 --- a/src/main/java/com/att/nsa/dmaap/service/AdminRestService.java +++ b/src/main/java/org/onap/dmaap/service/AdminRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; import java.util.Enumeration; diff --git a/src/main/java/com/att/nsa/dmaap/service/ApiKeysRestService.java b/src/main/java/org/onap/dmaap/service/ApiKeysRestService.java index d44d259..49eddd9 100644 --- a/src/main/java/com/att/nsa/dmaap/service/ApiKeysRestService.java +++ b/src/main/java/org/onap/dmaap/service/ApiKeysRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; diff --git a/src/main/java/com/att/nsa/dmaap/service/EventsRestService.java b/src/main/java/org/onap/dmaap/service/EventsRestService.java index cd28967..2672261 100644 --- a/src/main/java/com/att/nsa/dmaap/service/EventsRestService.java +++ b/src/main/java/org/onap/dmaap/service/EventsRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/com/att/nsa/dmaap/service/MMRestService.java b/src/main/java/org/onap/dmaap/service/MMRestService.java index 853c9ba..fc3c9a1 100644 --- a/src/main/java/com/att/nsa/dmaap/service/MMRestService.java +++ b/src/main/java/org/onap/dmaap/service/MMRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; import java.io.InputStream; @@ -46,7 +46,7 @@ import org.onap.dmaap.dmf.mr.utils.ConfigurationReader; import org.onap.dmaap.dmf.mr.utils.DMaaPResponseBuilder; import org.onap.dmaap.dmf.mr.utils.Utils; import com.att.nsa.configs.ConfigDbException; -import com.att.nsa.dmaap.mmagent.*; +import org.onap.dmaap.mmagent.*; import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting; import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException; import com.google.gson.Gson; diff --git a/src/main/java/com/att/nsa/dmaap/service/MetricsRestService.java b/src/main/java/org/onap/dmaap/service/MetricsRestService.java index 8ff58f3..0a9193b 100644 --- a/src/main/java/com/att/nsa/dmaap/service/MetricsRestService.java +++ b/src/main/java/org/onap/dmaap/service/MetricsRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; diff --git a/src/main/java/com/att/nsa/dmaap/service/ServiceUtil.java b/src/main/java/org/onap/dmaap/service/ServiceUtil.java index d73bcaf..7384e54 100644 --- a/src/main/java/com/att/nsa/dmaap/service/ServiceUtil.java +++ b/src/main/java/org/onap/dmaap/service/ServiceUtil.java @@ -17,7 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import org.onap.dmaap.dmf.mr.beans.DMaaPContext; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/java/com/att/nsa/dmaap/service/TopicRestService.java b/src/main/java/org/onap/dmaap/service/TopicRestService.java index 42049d2..bbf2708 100644 --- a/src/main/java/com/att/nsa/dmaap/service/TopicRestService.java +++ b/src/main/java/org/onap/dmaap/service/TopicRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/java/com/att/nsa/dmaap/service/TransactionRestService.java b/src/main/java/org/onap/dmaap/service/TransactionRestService.java index 9354f5c..8b806b0 100644 --- a/src/main/java/com/att/nsa/dmaap/service/TransactionRestService.java +++ b/src/main/java/org/onap/dmaap/service/TransactionRestService.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; diff --git a/src/main/java/com/att/nsa/dmaap/service/UIRestServices.java b/src/main/java/org/onap/dmaap/service/UIRestServices.java index f82d0a1..bca64c4 100644 --- a/src/main/java/com/att/nsa/dmaap/service/UIRestServices.java +++ b/src/main/java/org/onap/dmaap/service/UIRestServices.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.service; + package org.onap.dmaap.service; import java.io.IOException; diff --git a/src/main/java/com/att/nsa/dmaap/tools/ConfigTool.java b/src/main/java/org/onap/dmaap/tools/ConfigTool.java index d896bdd..2531318 100644 --- a/src/main/java/com/att/nsa/dmaap/tools/ConfigTool.java +++ b/src/main/java/org/onap/dmaap/tools/ConfigTool.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.tools; + package org.onap.dmaap.tools; import java.io.IOException; import java.io.PrintStream; diff --git a/src/main/java/com/att/nsa/dmaap/tools/ConfigToolContext.java b/src/main/java/org/onap/dmaap/tools/ConfigToolContext.java index f61d179..0e89098 100644 --- a/src/main/java/com/att/nsa/dmaap/tools/ConfigToolContext.java +++ b/src/main/java/org/onap/dmaap/tools/ConfigToolContext.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.tools; + package org.onap.dmaap.tools; import org.onap.dmaap.dmf.mr.beans.DMaaPMetricsSet; import com.att.nsa.cmdtool.CommandContext; diff --git a/src/main/java/com/att/nsa/dmaap/util/ContentLengthInterceptor.java b/src/main/java/org/onap/dmaap/util/ContentLengthInterceptor.java index 4ddc54a..b03eb5b 100644 --- a/src/main/java/com/att/nsa/dmaap/util/ContentLengthInterceptor.java +++ b/src/main/java/org/onap/dmaap/util/ContentLengthInterceptor.java @@ -19,120 +19,120 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.util;
-
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.http.HttpStatus;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.springframework.stereotype.Component;
-import org.onap.dmaap.dmf.mr.CambriaApiException;
-import org.onap.dmaap.dmf.mr.exception.DMaaPResponseCode;
-import org.onap.dmaap.dmf.mr.exception.ErrorResponse;
-import ajsc.beans.interceptors.AjscInterceptor;
-
-/**
- * AJSC Intercepter implementation of ContentLengthFilter
- */
-@Component
-public class ContentLengthInterceptor implements AjscInterceptor{
-
-
- private String defLength;
- //private Logger log = Logger.getLogger(ContentLengthInterceptor.class.toString());
- private static final EELFLogger log = EELFManager.getInstance().getLogger(ContentLengthInterceptor.class);
-
-
- /**
- * Intercepter method to intercept requests before processing
- */
- @Override
- public boolean allowOrReject(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse,
- Map map) throws Exception {
-
- log.info("inside Interceptor allowOrReject content length checking before pub/sub");
-
- JSONObject jsonObj = null;
- int requestLength = 0;
- setDefLength(System.getProperty("maxcontentlength"));
- try {
- // retrieving content length from message header
-
- if (null != httpservletrequest.getHeader("Content-Length")) {
- requestLength = Integer.parseInt(httpservletrequest.getHeader("Content-Length"));
- }
- // retrieving encoding from message header
- String transferEncoding = httpservletrequest.getHeader("Transfer-Encoding");
- // checking for no encoding, chunked and requestLength greater then
- // default length
- if (null != transferEncoding && !(transferEncoding.contains("chunked"))
- && (requestLength > Integer.parseInt(getDefLength()))) {
- jsonObj = new JSONObject().append("defaultlength", getDefLength())
- .append("requestlength", requestLength);
- log.error("message length is greater than default");
- throw new CambriaApiException(jsonObj);
- }
- else if (null == transferEncoding && (requestLength > Integer.parseInt(getDefLength())))
- {
- jsonObj = new JSONObject().append("defaultlength", getDefLength()).append(
- "requestlength", requestLength);
- log.error("Request message is not chunked or request length is greater than default length");
- throw new CambriaApiException(jsonObj);
-
-
- }
- else
- {
- //chain.doFilter(req, res);
- return true;
- }
-
- } catch (CambriaApiException | NumberFormatException | JSONException e) {
-
- log.info("Exception obj--"+e);
+ package org.onap.dmaap.util; + +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.http.HttpStatus; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.json.JSONException; +import org.json.JSONObject; +import org.springframework.stereotype.Component; +import org.onap.dmaap.dmf.mr.CambriaApiException; +import org.onap.dmaap.dmf.mr.exception.DMaaPResponseCode; +import org.onap.dmaap.dmf.mr.exception.ErrorResponse; +import ajsc.beans.interceptors.AjscInterceptor; + +/** + * AJSC Intercepter implementation of ContentLengthFilter + */ +@Component +public class ContentLengthInterceptor implements AjscInterceptor{ + + + private String defLength; + //private Logger log = Logger.getLogger(ContentLengthInterceptor.class.toString()); + private static final EELFLogger log = EELFManager.getInstance().getLogger(ContentLengthInterceptor.class); + + + /** + * Intercepter method to intercept requests before processing + */ + @Override + public boolean allowOrReject(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, + Map map) throws Exception { + + log.info("inside Interceptor allowOrReject content length checking before pub/sub"); + + JSONObject jsonObj = null; + int requestLength = 0; + setDefLength(System.getProperty("maxcontentlength")); + try { + // retrieving content length from message header + + if (null != httpservletrequest.getHeader("Content-Length")) { + requestLength = Integer.parseInt(httpservletrequest.getHeader("Content-Length")); + } + // retrieving encoding from message header + String transferEncoding = httpservletrequest.getHeader("Transfer-Encoding"); + // checking for no encoding, chunked and requestLength greater then + // default length + if (null != transferEncoding && !(transferEncoding.contains("chunked")) + && (requestLength > Integer.parseInt(getDefLength()))) { + jsonObj = new JSONObject().append("defaultlength", getDefLength()) + .append("requestlength", requestLength); + log.error("message length is greater than default"); + throw new CambriaApiException(jsonObj); + } + else if (null == transferEncoding && (requestLength > Integer.parseInt(getDefLength()))) + { + jsonObj = new JSONObject().append("defaultlength", getDefLength()).append( + "requestlength", requestLength); + log.error("Request message is not chunked or request length is greater than default length"); + throw new CambriaApiException(jsonObj); + + + } + else + { + //chain.doFilter(req, res); + return true; + } + + } catch (CambriaApiException | NumberFormatException | JSONException e) { + + log.info("Exception obj--"+e); log.error("message size is greater then default"+e.getMessage()); String messg=e.toString(); if(jsonObj!=null){ messg=jsonObj.toString(); - }
- ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_REQUEST_TOO_LONG,
- DMaaPResponseCode.MSG_SIZE_EXCEEDS_MSG_LIMIT.getResponseCode(), System.getProperty("msg_size_exceeds")
- + messg);
- log.info(errRes.toString());
-
-
- map.put(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"test");
+ } + ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_REQUEST_TOO_LONG, + DMaaPResponseCode.MSG_SIZE_EXCEEDS_MSG_LIMIT.getResponseCode(), System.getProperty("msg_size_exceeds") + + messg); + log.info(errRes.toString()); + + + map.put(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"test"); httpservletresponse.setStatus(HttpStatus.SC_REQUEST_TOO_LONG); - if(httpservletresponse.getOutputStream()!=null){
+ if(httpservletresponse.getOutputStream()!=null){ httpservletresponse.getOutputStream().write(errRes.toString().getBytes()); - }
- return false;
- }
-
-
-
- }
-
-
- /**
- * Get Default Content Length
- * @return defLength
- */
- public String getDefLength() {
- return defLength;
- }
- /**
- * Set Default Content Length
- * @param defLength
- */
- public void setDefLength(String defLength) {
- this.defLength = defLength;
- }
-
-
-
-}
+ } + return false; + } + + + + } + + + /** + * Get Default Content Length + * @return defLength + */ + public String getDefLength() { + return defLength; + } + /** + * Set Default Content Length + * @param defLength + */ + public void setDefLength(String defLength) { + this.defLength = defLength; + } + + + +} diff --git a/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java b/src/main/java/org/onap/dmaap/util/DMaaPAuthFilter.java index 4ef8626..547c4cd 100644 --- a/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java +++ b/src/main/java/org/onap/dmaap/util/DMaaPAuthFilter.java @@ -19,7 +19,7 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.util; + package org.onap.dmaap.util; import java.io.IOException; diff --git a/src/main/java/com/att/nsa/dmaap/util/ServicePropertiesMapBean.java b/src/main/java/org/onap/dmaap/util/ServicePropertiesMapBean.java index b16162b..1778182 100644 --- a/src/main/java/com/att/nsa/dmaap/util/ServicePropertiesMapBean.java +++ b/src/main/java/org/onap/dmaap/util/ServicePropertiesMapBean.java @@ -19,9 +19,9 @@ * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ -package com.att.nsa.dmaap.util; + package org.onap.dmaap.util; -import com.att.nsa.dmaap.filemonitor.ServicePropertiesMap; +import org.onap.dmaap.filemonitor.ServicePropertiesMap; /** * Class ServicePropertiesMapBean |