X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fstd%2FManualClientEndUEB.java;h=85d5659e82fcfb73fcf1b58a4693147321ba6944;hb=685ed1545ed28b777a3ba6e7d315b78f355154cb;hp=f2a6a96d83fd4c466699f7b1143ddf19461449e5;hpb=7e547eaa55920dfbc9691eab33bb728395b50cf2;p=policy%2Fengine.git diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java index f2a6a96d8..85d5659e8 100644 --- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java +++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/std/ManualClientEndUEB.java @@ -23,7 +23,6 @@ package org.openecomp.policy.std; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; -import java.security.GeneralSecurityException; import java.util.List; import org.json.JSONObject; @@ -90,22 +89,20 @@ public class ManualClientEndUEB { CambriaPublisher pub = null; try { pub = CambriaClientFactory.createSimplePublisher(null, UEBlist, pubTopic); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - } catch (GeneralSecurityException e1) { - e1.printStackTrace(); + } catch (Exception e1) { + logger.error("Exception Occured"+e1); } final JSONObject msg1 = new JSONObject (); msg1.put ( "JSON", "UEB Update Ruest UID=" + uniqueID); - - try { - pub.send ( "MyPartitionKey", msg1.toString () ); - } catch (IOException e) { - logger.error("Exception Occured"+e); - } - pub.close (); - + if(pub != null){ + try { + pub.send ( "MyPartitionKey", msg1.toString () ); + pub.close (); + } catch (IOException e) { + logger.error("Exception Occured"+e); + } + } } public static void createTopic (String url, String uniquID, List uebURLList){ @@ -135,11 +132,9 @@ public class ManualClientEndUEB { String id = "0"; try { CConsumer = CambriaClientFactory.createConsumer ( null, uebURLList, topic + uniquID, "clientGroup", id, 15*1000, 1000 ); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - } catch (GeneralSecurityException e1) { - e1.printStackTrace(); - } + } catch (Exception e1) { + logger.error("Exception Occured"+e1); + } int count = 1; while (count < 4) { publishMessage(topic + "UpdateRequest", uniquID, uebURLList);