source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/NhincHiemSubscriptionEJB/src/java/gov/hhs/fha/nhinc/hiemnotify/HiemNotifyImpl.java@ 507

Last change on this file since 507 was 507, checked in by George Lilly, 15 years ago

NHIN gateway and adaptor for use on linux with VistA EHR and RPMS

File size: 1.9 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package gov.hhs.fha.nhinc.hiemnotify;
7import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.NotifyRequestType;
8import gov.hhs.fha.nhinc.nhinclib.NullChecker;
9import gov.hhs.fha.nhinc.nhincsubscription.NhincNotificationConsumerService;
10import gov.hhs.fha.nhinc.nhincsubscription.NotificationConsumer;
11import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractor;
12import gov.hhs.fha.nhinc.saml.extraction.SamlTokenExtractorHelper;
13import javax.xml.ws.WebServiceContext;
14import org.apache.commons.logging.Log;
15import org.apache.commons.logging.LogFactory;
16import org.oasis_open.docs.wsn.b_2.Notify;
17
18/**
19 *
20 * @author jhoppesc
21 */
22public class HiemNotifyImpl {
23
24 private static Log log = LogFactory.getLog(HiemNotifyImpl.class);
25
26 public static void notify(Notify notifyRequest, WebServiceContext context) {
27 log.debug("Entering HiemNotifyImpl.notify");
28
29 NotifyRequestType request = new NotifyRequestType();
30
31 request.setNotify(notifyRequest);
32 request.setAssertion(SamlTokenExtractor.GetAssertion(context));
33
34
35 String homeCommunityId = SamlTokenExtractorHelper.getHomeCommunityId();
36
37 if (NullChecker.isNotNullish(homeCommunityId)) {
38 NhincNotificationConsumerService service = new NhincNotificationConsumerService();
39 NotificationConsumer port = service.getNotificationConsumerPort();
40 ((javax.xml.ws.BindingProvider) port).getRequestContext().put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, SamlTokenExtractorHelper.getEndpointURL(homeCommunityId, SamlTokenExtractorHelper.INTERNAL_HIEM_NOTIFY));
41
42 try {
43 port.notify(request);
44 } catch (Exception e) {
45 log.error("Received Fault: " + e.getMessage());
46 }
47 }
48
49 log.debug("Exiting HiemNotifyImpl.notify");
50 }
51
52}
Note: See TracBrowser for help on using the repository browser.