From cb174e731d76308e78079e14db83caa41128788e Mon Sep 17 00:00:00 2001 From: Dustin Johnson Date: Tue, 22 Jan 2013 10:19:09 -0600 Subject: [PATCH] Issue #1501 Route notification requests to datadelivery. Change-Id: Icde52bafb67e199caeb74ed0078c879ab514836b Former-commit-id: cda7f4d59271d7eed5b6ec2b69b685cae20d0aa9 [formerly d9568913608989c2ec346734e01c9744ebf550dd] [formerly cda7f4d59271d7eed5b6ec2b69b685cae20d0aa9 [formerly d9568913608989c2ec346734e01c9744ebf550dd] [formerly 500f6050be0326260a0b04089a0a69e42a96587d [formerly 9550a861fab635a8f61c485152e27ec90ebb9cb2]]] Former-commit-id: 500f6050be0326260a0b04089a0a69e42a96587d Former-commit-id: a372963fb72311b05b20db43fec9d81339ccc78f [formerly b4bb2ee4546ea100aaba4f5c2c1bd7079dcffb7f] Former-commit-id: 2ab171b9ef45092dbdead41314de27346da44e6d --- .../datadelivery/utils/NotificationHandler.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/NotificationHandler.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/NotificationHandler.java index 73d72c9391..2e1d7a5bfd 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/NotificationHandler.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/NotificationHandler.java @@ -9,13 +9,13 @@ import com.raytheon.uf.common.datadelivery.event.notification.DeleteNotification import com.raytheon.uf.common.datadelivery.event.notification.DeleteNotificationResponse; import com.raytheon.uf.common.datadelivery.event.notification.GetNotificationRequest; import com.raytheon.uf.common.datadelivery.event.notification.NotificationRecord; +import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants; +import com.raytheon.uf.common.serialization.comm.RequestRouter; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.notification.INotificationObserver; import com.raytheon.uf.viz.core.notification.NotificationException; import com.raytheon.uf.viz.core.notification.NotificationMessage; -import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.datadelivery.notification.xml.MessageLoadXML; /** @@ -29,6 +29,7 @@ import com.raytheon.uf.viz.datadelivery.notification.xml.MessageLoadXML; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 12, 2012 jsanchez Initial creation + * Jan 22, 2013 1501 djohnson Route requests to datadelivery. * * * @@ -115,10 +116,10 @@ public class NotificationHandler implements INotificationObserver { request.setUsername(username); request.setHours(hours); request.setMaxResults(maxResults); - ArrayList response = (ArrayList) ThriftClient - .sendRequest(request); + ArrayList response = (ArrayList) RequestRouter + .route(request, DataDeliveryConstants.DATA_DELIVERY_SERVER); return response; - } catch (VizException e) { + } catch (Exception e) { statusHandler.error( "Error trying to retrieve notifications from database", e); } @@ -139,10 +140,10 @@ public class NotificationHandler implements INotificationObserver { try { DeleteNotificationRequest request = new DeleteNotificationRequest(); request.setIds(ids); - DeleteNotificationResponse response = (DeleteNotificationResponse) ThriftClient - .sendRequest(request); + DeleteNotificationResponse response = (DeleteNotificationResponse) RequestRouter + .route(request, DataDeliveryConstants.DATA_DELIVERY_SERVER); rowsDeleted = response.getRowsDeleted(); - } catch (VizException e) { + } catch (Exception e) { statusHandler.error( "Error trying to delete notification(s) from database", e); }