/* * 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.subscription.*; //import gov.hhs.fha.nhinc.subscription_b_2_overridefordocuments.NotificationMessageHolderType.Message; //import gov.hhs.fha.nhinc.subscription_b_2_overridefordocuments.NotifyDocumentType; //import gov.hhs.fha.nhinc.subscriptiondte.*; //import ihe.iti.xds_b._2007.RetrieveDocumentSetRequestType; //import ihe.iti.xds_b._2007.RetrieveDocumentSetRequestType.DocumentRequest; //import java.util.List; //import javax.xml.bind.JAXBElement; //import javax.xml.ws.wsaddressing.W3CEndpointReference; //import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType; //import org.oasis_open.docs.wsn.b_2.Notify; /** * * @author rayj */ public class CreateAgencyNotifyHelper { private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(CreateAgencyNotifyHelper.class); // public static NotifyOfDocumentType createAgencyNotifyDocument(CreateAgencyNotifyDocumentRequestMessage createNotifyRequest) { // NotifyOfDocumentType agencyNotifyMessage = new NotifyOfDocumentType(); // NotifyDocumentType agencyNotify = new NotifyDocumentType(); // agencyNotifyMessage.setNotify(agencyNotify); // // gov.hhs.fha.nhinc.subscription_b_2_overridefordocuments.NotificationMessageHolderType agencyNotificationHolder = new gov.hhs.fha.nhinc.subscription_b_2_overridefordocuments.NotificationMessageHolderType(); // agencyNotify.getNotificationMessage().add(agencyNotificationHolder); // // Notify nhinNotify = createNotifyRequest.getNotify(); // NotificationMessageHolderType notificationMessageHolder = NotifyHelper.getNotificationMessageHolder(nhinNotify); // // log.info("getting documents"); // RetrieveDocumentSetRequestType documents = getDocuments(nhinNotify); // log.info("(documents==null)=" + (documents == null)); // if (documents != null) { // log.info("(documents.getDocumentRequest().size())=" + (documents.getDocumentRequest().size())); // } // Message agencyInnerMessage = new Message(); // agencyNotificationHolder.setMessage(agencyInnerMessage); // agencyInnerMessage.setRetrieveDocumentSetRequest(documents); // // W3CEndpointReference nhinSubscriptionReference = SubscriptionReferenceHelper.createNhinSubscriptionReference(createNotifyRequest.getSubscriptionReference()); // agencyNotificationHolder.setSubscriptionReference(nhinSubscriptionReference); // // return agencyNotifyMessage; // } // // private static RetrieveDocumentSetRequestType getDocuments(Notify nhinNotify) { // RetrieveDocumentSetRequestType documentInfos = null; // // NotificationMessageHolderType notificationMessageHolder = NotifyHelper.getNotificationMessageHolder(nhinNotify); // Object anyItem = notificationMessageHolder.getMessage().getAny(); // if (anyItem instanceof JAXBElement) { // JAXBElement jbElement = (JAXBElement) anyItem; // Object jbElementValue = jbElement.getValue(); // if (jbElementValue instanceof RetrieveDocumentSetRequestType) { // documentInfos = (RetrieveDocumentSetRequestType) jbElementValue; // } // } else if (anyItem instanceof ihe.iti.xds_b._2007.RetrieveDocumentSetRequestType) { // documentInfos = (RetrieveDocumentSetRequestType) anyItem; // } else { // log.info("unhandled anyItem in getDocuments() => " + anyItem); // } // return documentInfos; // } }