- if (scheme != null && handler!=null) {
- if (scheme.equals(NotificationScheme.AUTO_ALL_NOTIFICATIONS) || scheme.equals(NotificationScheme.AUTO_NOTIFICATIONS)) {
- if (AutoClientEnd.client == null) {
- client = ClientManager.createClient();
- if(url.contains("https")){
- url = url.replaceAll("https", "wss");
- }else {
- url = url.replaceAll("http", "ws");
- }
- try {
- logger.info("Starting Auto Notification with the PDP server : " + url);
- client.connectToServer(AutoClientEnd.class, new URI(url + "notifications"));
- status = true;
- if(error){
- // The URL's will be in Sync according to design Spec.
- ManualClientEnd.start(AutoClientEnd.url);
- StdPDPNotification notification = NotificationStore.getDeltaNotification((StdPDPNotification)ManualClientEnd.result(NotificationScheme.MANUAL_ALL_NOTIFICATIONS));
- if(notification.getNotificationType()!=null){
- if(oldNotification!=notification){
- oldNotification= notification;
- AutoClientEnd.notification = notification;
- callHandler();
- }
- }
- error = false;
- }
- //
- } catch (DeploymentException | IOException | URISyntaxException e) {
- logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e);
- client = null;
- status = false;
- changeURL();
- }
+ client = ClientManager.createClient();
+ if(url.contains("https")){
+ url = url.replaceAll("https", "wss");
+ }else {
+ url = url.replaceAll("http", "ws");
+ }
+ try {
+ logger.info("Starting Auto Notification with the PDP server : " + url);
+ client.connectToServer(AutoClientEnd.class, new URI(url + "notifications"));
+ status = true;
+ if(error){
+ // The URL's will be in Sync according to design Spec.
+ ManualClientEnd.start(AutoClientEnd.url);
+ StdPDPNotification notification = NotificationStore.getDeltaNotification((StdPDPNotification)ManualClientEnd.result(NotificationScheme.MANUAL_ALL_NOTIFICATIONS));
+ if(notification.getNotificationType()!=null&&oldNotification!=notification){
+ oldNotification= notification;
+ AutoClientEnd.notification = notification;
+ callHandler();