/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package gov.hhs.fha.nhinc.subscription.dte; //import gov.hhs.fha.nhinc.common.nhinccommonadapter.NotifySubscribersOfCdcBioPackageRequestType; import gov.hhs.fha.nhinc.common.nhinccommonadapter.NotifySubscribersOfCdcBioPackageRequestType; import gov.hhs.fha.nhinc.common.subscription.TopicExpressionType; import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotificationMessageHolderType; import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotificationMessageHolderType.Message; import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotifyCdcBioPackageType; import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageRequestType; //import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotifyCdcBioPackageType; import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageResponseType; //import gov.hhs.fha.nhinc.subscription.*; import java.util.List; //urn:gov:hhs:fha:nhinc:common:subscriptionb2overrideforcdc import javax.xml.bind.JAXBElement; //import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotificationMessageHolderType; import javax.xml.ws.wsaddressing.W3CEndpointReference; //import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotificationMessageHolderType.Message; //import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotifyCdcBioPackageType; //import java.util.ArrayList; //import java.util.List; //import javax.xml.bind.JAXBElement; //import javax.xml.ws.wsaddressing.W3CEndpointReference; //import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageResponseType; //import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageRequestType; /** * * @author rayj */ public class CreateAgencyNotifyCdcBioPackageHelper { public static CreateAgencyNotifyCdcBioPackageResponseType createAgencyNotifyCdcBioPackage(CreateAgencyNotifyCdcBioPackageRequestType createNotifyRequest) { CreateAgencyNotifyCdcBioPackageResponseType result = new CreateAgencyNotifyCdcBioPackageResponseType(); NotifySubscribersOfCdcBioPackageRequestType notifySubscribers = new NotifySubscribersOfCdcBioPackageRequestType(); result.setNotifySubscribersOfCdcBioPackageRequest(notifySubscribers); NotifyCdcBioPackageType notify =new NotifyCdcBioPackageType(); notifySubscribers.setNotify(notify); List< NotificationMessageHolderType> notificationMessageList = notify.getNotificationMessage(); NotificationMessageHolderType notificationMessage = new NotificationMessageHolderType(); notificationMessageList.add(notificationMessage); Message message = new Message(); notificationMessage.setMessage(message); org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType.Message nhinNotificationMessage = NotifyHelper.getMessage(createNotifyRequest.getNotify()); Object any = nhinNotificationMessage.getAny(); if ((any != null) && (any instanceof JAXBElement)) { Object anyvalue = ((JAXBElement) any).getValue(); if (anyvalue instanceof byte[]) { byte[] bytearray = (byte[]) anyvalue; message.setCdcBioPackagePayload(bytearray); } } W3CEndpointReference nhinSubscriptionReference = SubscriptionReferenceHelper.createNhinSubscriptionReference(createNotifyRequest.getSubscriptionReference()); notificationMessage.setSubscriptionReference(nhinSubscriptionReference); org.oasis_open.docs.wsn.b_2.TopicExpressionType topic = TopicHelper.GetTopic(createNotifyRequest.getNotify()); notificationMessage.setTopic(topic); return result; } }