X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdatarouter.git;a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2FPoker.java;h=f1660f9479113c610ccee9f2ab32c5b655665c9c;hp=193485e66a3f035775200793a3285c645310a0fa;hb=6c78b3e6a0a67c73f931337356a172cc69cee0e8;hpb=b6272800c94bab63eff623034bbc5bd2ded7b4d4 diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java index 193485e6..f1660f94 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Poker.java @@ -36,7 +36,9 @@ import java.util.Set; import java.util.Timer; import java.util.TimerTask; import java.util.TreeSet; -import org.apache.log4j.Logger; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; @@ -64,6 +66,7 @@ public class Poker extends TimerTask { private static final String POKE_URL_TEMPLATE = "http://%s/internal/fetchProv"; private static final Object lock = new Object(); + private static final String CARRIAGE_RETURN = "\n],\n"; /** * This is a singleton -- there is only one Poker object in the server @@ -72,18 +75,19 @@ public class Poker extends TimerTask { private long timer1; private long timer2; private String thisPod; // DNS name of this machine - private Logger logger; + private EELFLogger logger; private String provString; + private Poker() { timer1 = timer2 = 0; Timer rolex = new Timer(); - logger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal"); + logger = EELFManager.getInstance().getLogger("InternalLog"); try { thisPod = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { - thisPod = "*UNKNOWN*"; // not a major problem - logger.info("UnknownHostException: Setting thisPod to \"*UNKNOWN*\""); + thisPod = "*UNKNOWN_POD*"; // not a major problem + logger.info("UnknownHostException: Setting thisPod to \"*UNKNOWN_POD*\"", e); } provString = buildProvisioningString(); @@ -193,10 +197,10 @@ public class Poker extends TimerTask { } catch (MalformedURLException e) { logger.warn( "PROV0013 MalformedURLException Error poking node at " + nodeUrl + " : " + e - .getMessage()); + .getMessage(), e); } catch (IOException e) { logger.warn("PROV0013 IOException Error poking node at " + nodeUrl + " : " + e - .getMessage()); + .getMessage(), e); } }; r.run(); @@ -213,7 +217,7 @@ public class Poker extends TimerTask { sb.append(f.asJSONObject().toString()); pfx = ",\n"; } - sb.append("\n],\n"); + sb.append(CARRIAGE_RETURN); //Append groups to the string - Rally:US708115 - 1610 pfx = "\n"; @@ -223,7 +227,7 @@ public class Poker extends TimerTask { sb.append(s.asJSONObject().toString()); pfx = ",\n"; } - sb.append("\n],\n"); + sb.append(CARRIAGE_RETURN); // Append Subscriptions to the string pfx = "\n"; @@ -235,13 +239,13 @@ public class Poker extends TimerTask { } pfx = ",\n"; } - sb.append("\n],\n"); + sb.append(CARRIAGE_RETURN); // Append Parameters to the string pfx = "\n"; sb.append("\"parameters\": {"); Map props = Parameters.getParameters(); - Set ivals = new HashSet(); + Set ivals = new HashSet<>(); String intv = props.get("_INT_VALUES"); if (intv != null) { ivals.addAll(Arrays.asList(intv.split("\\|"))); @@ -278,7 +282,7 @@ public class Poker extends TimerTask { sb.append(in.asJSONObject().toString()); pfx = ",\n"; } - sb.append("\n],\n"); + sb.append(CARRIAGE_RETURN); pfx = "\n"; sb.append("\"egress\": {");