X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fstd%2FManualClientEndUEB.java;h=c04736e8661c116ab1c14a7ee3438129f342ee03;hb=4723527133e158ba48bf5a1eb9eec731af2ae1f8;hp=dcd86eb1fae5857f96c5897e23351139b60f8f11;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/std/ManualClientEndUEB.java b/PolicyEngineAPI/src/main/java/org/onap/policy/std/ManualClientEndUEB.java index dcd86eb1f..c04736e86 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/std/ManualClientEndUEB.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/std/ManualClientEndUEB.java @@ -51,35 +51,37 @@ public class ManualClientEndUEB { private static String url = null; private static String uniquID = null; private static String topic = null; - + + private ManualClientEndUEB() { + // Empty constructor + } public static PDPNotification result(NotificationScheme scheme) { if (resultJson == null || notification == null) { logger.debug("No Result" ); return null; - } else { - if(scheme.equals(NotificationScheme.MANUAL_ALL_NOTIFICATIONS)) { - boolean removed = false, updated = false; - if(notification.getRemovedPolicies()!=null && !notification.getRemovedPolicies().isEmpty()){ - removed = true; - } - if(notification.getLoadedPolicies()!=null && !notification.getLoadedPolicies().isEmpty()){ - updated = true; - } - if(removed && updated) { - notification.setNotificationType(NotificationType.BOTH); - }else if(removed){ - notification.setNotificationType(NotificationType.REMOVE); - }else if(updated){ - notification.setNotificationType(NotificationType.UPDATE); - } - return notification; - }else if(scheme.equals(NotificationScheme.MANUAL_NOTIFICATIONS)) { - return MatchStore.checkMatch(notification); - }else { - return null; + } + if(scheme.equals(NotificationScheme.MANUAL_ALL_NOTIFICATIONS)) { + boolean removed = false; + boolean updated = false; + if(notification.getRemovedPolicies()!=null && !notification.getRemovedPolicies().isEmpty()){ + removed = true; + } + if(notification.getLoadedPolicies()!=null && !notification.getLoadedPolicies().isEmpty()){ + updated = true; + } + if(removed && updated) { + notification.setNotificationType(NotificationType.BOTH); + }else if(removed){ + notification.setNotificationType(NotificationType.REMOVE); + }else if(updated){ + notification.setNotificationType(NotificationType.UPDATE); } + return notification; + }else if(scheme.equals(NotificationScheme.MANUAL_NOTIFICATIONS)) { + return MatchStore.checkMatch(notification); } + return null; } private static void publishMessage(String pubTopic, String uniqueID , List uebURLList) { @@ -145,13 +147,12 @@ public class ManualClientEndUEB { logger.debug("Manual Notification Recieved Message " + msg + " from UEB cluster : " + uebURLList.toString()); resultJson = msg; if (!msg.contains("UEB Update")){ -// System.out.println("Manual Notification Recieved Message " + msg + " from UEB cluster : " + uebURLList.toString()); notification = NotificationUnMarshal.notificationJSON(msg); count = 4; } } }catch (Exception e) { - + logger.error("Error in Manual CLient UEB notification ", e); } count++; }