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
Checkstyle fixes for prov eelf and utils
[dmaap/datarouter.git]
/
datarouter-prov
/
src
/
main
/
java
/
org
/
onap
/
dmaap
/
datarouter
/
provisioning
/
utils
/
URLUtilities.java
diff --git
a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/URLUtilities.java
b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/URLUtilities.java
index
4576bd2
..
2e00002
100644
(file)
--- a/
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/URLUtilities.java
+++ b/
datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/URLUtilities.java
@@
-24,9
+24,10
@@
\r
package org.onap.dmaap.datarouter.provisioning.utils;
\r
\r
\r
package org.onap.dmaap.datarouter.provisioning.utils;
\r
\r
+import com.att.eelf.configuration.EELFLogger;
\r
+import com.att.eelf.configuration.EELFManager;
\r
import java.net.InetAddress;
\r
import java.net.UnknownHostException;
\r
import java.net.InetAddress;
\r
import java.net.UnknownHostException;
\r
-import java.util.Arrays;
\r
\r
import org.onap.dmaap.datarouter.provisioning.BaseServlet;
\r
\r
\r
import org.onap.dmaap.datarouter.provisioning.BaseServlet;
\r
\r
@@
-38,6
+39,14
@@
import org.onap.dmaap.datarouter.provisioning.BaseServlet;
*/
\r
public class URLUtilities {
\r
\r
*/
\r
public class URLUtilities {
\r
\r
+
\r
+ private static final EELFLogger utilsLogger = EELFManager.getInstance().getLogger("UtilsLog");
\r
+ private static final String HTTPS = "https://";
\r
+ private static String otherPod;
\r
+
\r
+ private URLUtilities() {
\r
+ }
\r
+
\r
/**
\r
* Generate the URL used to access a feed.
\r
*
\r
/**
\r
* Generate the URL used to access a feed.
\r
*
\r
@@
-45,7
+54,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generateFeedURL(int feedid) {
\r
* @return the URL
\r
*/
\r
public static String generateFeedURL(int feedid) {
\r
- return
"https://" + BaseServlet.provName
+ "/feed/" + feedid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/feed/" + feedid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-55,7
+64,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generatePublishURL(int feedid) {
\r
* @return the URL
\r
*/
\r
public static String generatePublishURL(int feedid) {
\r
- return
"https://" + BaseServlet.provName
+ "/publish/" + feedid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/publish/" + feedid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-65,7
+74,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generateSubscribeURL(int feedid) {
\r
* @return the URL
\r
*/
\r
public static String generateSubscribeURL(int feedid) {
\r
- return
"https://" + BaseServlet.provName
+ "/subscribe/" + feedid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/subscribe/" + feedid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-75,7
+84,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generateFeedLogURL(int feedid) {
\r
* @return the URL
\r
*/
\r
public static String generateFeedLogURL(int feedid) {
\r
- return
"https://" + BaseServlet.provName
+ "/feedlog/" + feedid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/feedlog/" + feedid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-85,7
+94,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generateSubscriptionURL(int subid) {
\r
* @return the URL
\r
*/
\r
public static String generateSubscriptionURL(int subid) {
\r
- return
"https://" + BaseServlet.provName
+ "/subs/" + subid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/subs/" + subid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-95,7
+104,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generateSubLogURL(int subid) {
\r
* @return the URL
\r
*/
\r
public static String generateSubLogURL(int subid) {
\r
- return
"https://" + BaseServlet.provName
+ "/sublog/" + subid;
\r
+ return
HTTPS + BaseServlet.getProvName()
+ "/sublog/" + subid;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-104,7
+113,7
@@
public class URLUtilities {
* @return the URL
\r
*/
\r
public static String generatePeerProvURL() {
\r
* @return the URL
\r
*/
\r
public static String generatePeerProvURL() {
\r
- return
"https://"
+ getPeerPodName() + "/internal/prov";
\r
+ return
HTTPS
+ getPeerPodName() + "/internal/prov";
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-115,11
+124,11
@@
public class URLUtilities {
public static String generatePeerLogsURL() {
\r
//Fixes for Itrack ticket - DATARTR-4#Fixing if only one Prov is configured, not to give exception to fill logs.
\r
String peerPodUrl = getPeerPodName();
\r
public static String generatePeerLogsURL() {
\r
//Fixes for Itrack ticket - DATARTR-4#Fixing if only one Prov is configured, not to give exception to fill logs.
\r
String peerPodUrl = getPeerPodName();
\r
- if (peerPodUrl
.equals("") || peerPodUrl==null
) {
\r
+ if (peerPodUrl
== null || "".equals(peerPodUrl)
) {
\r
return "";
\r
}
\r
\r
return "";
\r
}
\r
\r
- return
"https://"
+ peerPodUrl + "/internal/drlogs/";
\r
+ return
HTTPS
+ peerPodUrl + "/internal/drlogs/";
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-128,23
+137,21
@@
public class URLUtilities {
* @return the name
\r
*/
\r
public static String getPeerPodName() {
\r
* @return the name
\r
*/
\r
public static String getPeerPodName() {
\r
- if (other
_p
od == null) {
\r
- String this
_pod = ""
;
\r
+ if (other
P
od == null) {
\r
+ String this
Pod
;
\r
try {
\r
try {
\r
- this_pod = InetAddress.getLocalHost().getHostName();
\r
- System.out.println("this_pod: " + this_pod);
\r
+ thisPod = InetAddress.getLocalHost().getHostName();
\r
} catch (UnknownHostException e) {
\r
} catch (UnknownHostException e) {
\r
- this_pod = "";
\r
+ utilsLogger.trace("UnkownHostException: " + e.getMessage(), e);
\r
+ thisPod = "";
\r
}
\r
}
\r
- System.out.println("ALL PODS: " + Arrays.asList(BaseServlet.getPods()));
\r
for (String pod : BaseServlet.getPods()) {
\r
for (String pod : BaseServlet.getPods()) {
\r
- if (!pod.equals(this
_p
od)) {
\r
- other
_p
od = pod;
\r
+ if (!pod.equals(this
P
od)) {
\r
+ other
P
od = pod;
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r
- return other
_p
od;
\r
+ return other
P
od;
\r
}
\r
\r
}
\r
\r
- private static String other_pod;
\r
}
\r
}
\r