Code Review
/
dmaap
/
datarouter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[DMAAP-DR] Remove AAF/TLS phase 1
[dmaap/datarouter.git]
/
datarouter-prov
/
src
/
main
/
java
/
org
/
onap
/
dmaap
/
datarouter
/
provisioning
/
SubscribeServlet.java
diff --git
a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
index
8e70e69
..
2ee58d6
100644
(file)
--- a/
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
+++ b/
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/SubscribeServlet.java
@@
-24,13
+24,15
@@
package org.onap.dmaap.datarouter.provisioning;
package org.onap.dmaap.datarouter.provisioning;
+import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.sendResponseError;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.util.Collection;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.util.Collection;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.authz.AuthorizationResponse;
import org.onap.dmaap.datarouter.provisioning.beans.EventLogRecord;
import org.json.JSONObject;
import org.onap.dmaap.datarouter.authz.AuthorizationResponse;
import org.onap.dmaap.datarouter.provisioning.beans.EventLogRecord;
@@
-39,10
+41,6
@@
import org.onap.dmaap.datarouter.provisioning.beans.Subscription;
import org.onap.dmaap.datarouter.provisioning.eelf.EelfMsgs;
import org.onap.dmaap.datarouter.provisioning.utils.JSONUtilities;
import org.onap.dmaap.datarouter.provisioning.eelf.EelfMsgs;
import org.onap.dmaap.datarouter.provisioning.utils.JSONUtilities;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.sendResponseError;
/**
* This servlet handles provisioning for the <subscribeURL> which is generated by the provisioning server to
/**
* This servlet handles provisioning for the <subscribeURL> which is generated by the provisioning server to
@@
-52,6
+50,7
@@
import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
* @version $Id$
*/
@SuppressWarnings("serial")
* @version $Id$
*/
@SuppressWarnings("serial")
+
public class SubscribeServlet extends ProxyServlet {
//Adding EELF Logger Rally:US664892
public class SubscribeServlet extends ProxyServlet {
//Adding EELF Logger Rally:US664892
@@
-66,7
+65,8
@@
public class SubscribeServlet extends ProxyServlet {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
setIpFqdnRequestIDandInvocationIDForEelf("doDelete", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID,
+ req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "DELETE not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
String message = "DELETE not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
@@
-87,7
+87,8
@@
public class SubscribeServlet extends ProxyServlet {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
setIpFqdnRequestIDandInvocationIDForEelf("doGet", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID,
+ req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
EventLogRecord elr = new EventLogRecord(req);
String message = isAuthorizedForProvisioning(req);
if (message != null) {
@@
-130,7
+131,7
@@
public class SubscribeServlet extends ProxyServlet {
}
// Display a list of URLs
Collection<String> list = Subscription.getSubscriptionUrlList(feedid);
}
// Display a list of URLs
Collection<String> list = Subscription.getSubscriptionUrlList(feedid);
- String t = JSONUtilities.createJSONArray(list);
+ String
strLis
t = JSONUtilities.createJSONArray(list);
// send response
elr.setResult(HttpServletResponse.SC_OK);
// send response
elr.setResult(HttpServletResponse.SC_OK);
@@
-138,7
+139,7
@@
public class SubscribeServlet extends ProxyServlet {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(SUBLIST_CONTENT_TYPE);
try {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(SUBLIST_CONTENT_TYPE);
try {
- resp.getOutputStream().print(t);
+ resp.getOutputStream().print(
strLis
t);
} catch (IOException ioe) {
eventlogger.error("PROV0181 SubscribeServlet.doGet: " + ioe.getMessage(), ioe);
}
} catch (IOException ioe) {
eventlogger.error("PROV0181 SubscribeServlet.doGet: " + ioe.getMessage(), ioe);
}
@@
-155,7
+156,8
@@
public class SubscribeServlet extends ProxyServlet {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
setIpFqdnRequestIDandInvocationIDForEelf("doPut", req);
eelfLogger.info(EelfMsgs.ENTRY);
try {
- eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID, req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
+ eelfLogger.info(EelfMsgs.MESSAGE_WITH_BEHALF_AND_SUBID,
+ req.getHeader(BEHALF_HEADER), getIdFromPath(req) + "");
String message = "PUT not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
String message = "PUT not allowed for the subscribeURL.";
EventLogRecord elr = new EventLogRecord(req);
elr.setMessage(message);
@@
-238,9
+240,6
@@
public class SubscribeServlet extends ProxyServlet {
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
sendResponseError(resp, HttpServletResponse.SC_BAD_REQUEST, message, eventlogger);
return;
}
- if (intlogger.isDebugEnabled()) {
- intlogger.debug(jo.toString());
- }
if (++activeSubs > maxSubs) {
activeSubs--;
message = "Cannot create subscription; the maximum number of subscriptions has been configured.";
if (++activeSubs > maxSubs) {
activeSubs--;
message = "Cannot create subscription; the maximum number of subscriptions has been configured.";
@@
-271,7
+270,8
@@
public class SubscribeServlet extends ProxyServlet {
*/
String feedAafInstance = feed.getAafInstance();
String subAafInstance = sub.getAafInstance();
*/
String feedAafInstance = feed.getAafInstance();
String subAafInstance = sub.getAafInstance();
- boolean subAafLegacyEmptyOrNull = (subAafInstance == null || "".equals(subAafInstance) || "legacy".equalsIgnoreCase(subAafInstance));
+ boolean subAafLegacyEmptyOrNull = (subAafInstance == null
+ || "".equals(subAafInstance) || "legacy".equalsIgnoreCase(subAafInstance));
// This extra check added to verify AAF feed with AAF subscriber having empty aaf instance check
if (feedAafInstance == null || "".equals(feedAafInstance) || "legacy".equalsIgnoreCase(feedAafInstance)) {
// This extra check added to verify AAF feed with AAF subscriber having empty aaf instance check
if (feedAafInstance == null || "".equals(feedAafInstance) || "legacy".equalsIgnoreCase(feedAafInstance)) {
@@
-327,7
+327,8
@@
public class SubscribeServlet extends ProxyServlet {
Subscription sub2 = Subscription.getSubscriptionMatching(sub);
if (sub2 != null) {
intlogger.warn(
Subscription sub2 = Subscription.getSubscriptionMatching(sub);
if (sub2 != null) {
intlogger.warn(
- "PROV0011 Creating a duplicate subscription: new subid=" + sub.getSubid() + ", old subid=" + sub2.getSubid());
+ "PROV0011 Creating a duplicate subscription: new subid="
+ + sub.getSubid() + ", old subid=" + sub2.getSubid());
}
// Create SUBSCRIPTIONS table entries
}
// Create SUBSCRIPTIONS table entries