[507] | 1 | package gov.hhs.fha.nhinc.subscription.repository;
|
---|
| 2 |
|
---|
| 3 | import gov.hhs.fha.nhinc.nhinccomponentsubscriptionreferencerepository.NhincComponentSubscriptionReferenceRepositoryPortType;
|
---|
| 4 | import javax.ejb.Stateless;
|
---|
| 5 | import javax.jws.WebService;
|
---|
| 6 | import org.apache.commons.logging.Log;
|
---|
| 7 | import org.apache.commons.logging.LogFactory;
|
---|
| 8 |
|
---|
| 9 | /**
|
---|
| 10 | * Service for the gateway subscription reference repository.
|
---|
| 11 | *
|
---|
| 12 | * @author Neil Webb
|
---|
| 13 | */
|
---|
| 14 | @WebService(serviceName = "NhincComponentSubscriptionReferenceRepositoryService", portName = "NhincComponentSubscriptionReferenceRepositoryPortTypeBindingPort", endpointInterface = "gov.hhs.fha.nhinc.nhinccomponentsubscriptionreferencerepository.NhincComponentSubscriptionReferenceRepositoryPortType", targetNamespace = "urn:gov:hhs:fha:nhinc:nhinccomponentsubscriptionreferencerepository", wsdlLocation = "META-INF/wsdl/GatewaySubscriptionReferenceRepository/NhincComponentSubscriptionReferenceRepository.wsdl")
|
---|
| 15 | @Stateless
|
---|
| 16 | public class GatewaySubscriptionReferenceRepository implements NhincComponentSubscriptionReferenceRepositoryPortType {
|
---|
| 17 | private static Log log = LogFactory.getLog(GatewaySubscriptionReferenceRepository.class);
|
---|
| 18 |
|
---|
| 19 | public gov.hhs.fha.nhinc.common.subscription.SubscriptionReferenceType storeSubscriptionReference(gov.hhs.fha.nhinc.common.subscription.SubscriptionItemType subscriptionItem) {
|
---|
| 20 | gov.hhs.fha.nhinc.common.subscription.SubscriptionReferenceType subscriptionReference = null;
|
---|
| 21 | try
|
---|
| 22 | {
|
---|
| 23 | subscriptionReference = new SubscriptionReferenceRepositoryHelper().storeSubscription(subscriptionItem);
|
---|
| 24 | }
|
---|
| 25 | catch (SubscriptionRepositoryException ex)
|
---|
| 26 | {
|
---|
| 27 | log.error(ex.getMessage(), ex);
|
---|
| 28 | // Return empty reference until fault handling is implemented
|
---|
| 29 | subscriptionReference = new gov.hhs.fha.nhinc.common.subscription.SubscriptionReferenceType();
|
---|
| 30 | }
|
---|
| 31 | return subscriptionReference;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | public gov.hhs.fha.nhinc.common.nhinccommon.AcknowledgementType deleteSubscriptionReference(gov.hhs.fha.nhinc.common.subscription.DeleteSubscriptionMessageRequestType deleteSubscriptionMessage) {
|
---|
| 35 | gov.hhs.fha.nhinc.common.nhinccommon.AcknowledgementType ack = null;
|
---|
| 36 | try
|
---|
| 37 | {
|
---|
| 38 | if(deleteSubscriptionMessage != null)
|
---|
| 39 | {
|
---|
| 40 | ack = new SubscriptionReferenceRepositoryHelper().deleteSubscription(deleteSubscriptionMessage.getSubscriptionReference());
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 | catch (SubscriptionRepositoryException ex)
|
---|
| 44 | {
|
---|
| 45 | log.error(ex.getMessage(), ex);
|
---|
| 46 | // Create an ack here until proper fault handling is established.
|
---|
| 47 | ack = new gov.hhs.fha.nhinc.common.nhinccommon.AcknowledgementType();
|
---|
| 48 | }
|
---|
| 49 | return ack;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | public gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType retrieveByCriteria(gov.hhs.fha.nhinc.common.subscription.SubscriptionCriteriaType subscriptionCriteria) {
|
---|
| 53 | gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType subscriptionItems = null;
|
---|
| 54 | try
|
---|
| 55 | {
|
---|
| 56 | subscriptionItems = new SubscriptionReferenceRepositoryHelper().retrieveByCriteria(subscriptionCriteria);
|
---|
| 57 | }
|
---|
| 58 | catch (SubscriptionRepositoryException ex)
|
---|
| 59 | {
|
---|
| 60 | log.error(ex.getMessage(), ex);
|
---|
| 61 | // Create empty response until fault handling is added
|
---|
| 62 | subscriptionItems = new gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType();
|
---|
| 63 | }
|
---|
| 64 | return subscriptionItems;
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | public gov.hhs.fha.nhinc.common.subscription.SubscriptionItemType retrieveBySubscriptionReference(gov.hhs.fha.nhinc.common.subscription.RetrieveBySubscriptionReferenceRequestMessageType retrieveBySubscriptionReferenceMessage) {
|
---|
| 68 | gov.hhs.fha.nhinc.common.subscription.SubscriptionItemType subscriptionItem = null;
|
---|
| 69 | try
|
---|
| 70 | {
|
---|
| 71 | if(retrieveBySubscriptionReferenceMessage != null)
|
---|
| 72 | {
|
---|
| 73 | subscriptionItem = new SubscriptionReferenceRepositoryHelper().retrieveBySubscriptionReference(retrieveBySubscriptionReferenceMessage.getSubscriptionReference());
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
| 76 | catch (SubscriptionRepositoryException ex)
|
---|
| 77 | {
|
---|
| 78 | log.error(ex.getMessage(), ex);
|
---|
| 79 | // Create empty response until fault handling is added
|
---|
| 80 | subscriptionItem = new gov.hhs.fha.nhinc.common.subscription.SubscriptionItemType();
|
---|
| 81 | }
|
---|
| 82 | return subscriptionItem;
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | public gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType retrieveByParentSubscriptionReference(gov.hhs.fha.nhinc.common.subscription.RetrieveByParentSubscriptionReferenceMessageType retrieveByParentSubscriptionReferenceMessage) {
|
---|
| 86 | gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType subscriptionItems = null;
|
---|
| 87 | try
|
---|
| 88 | {
|
---|
| 89 | if(retrieveByParentSubscriptionReferenceMessage != null)
|
---|
| 90 | {
|
---|
| 91 | subscriptionItems = new SubscriptionReferenceRepositoryHelper().retrieveByParentSubscriptionReference(retrieveByParentSubscriptionReferenceMessage.getSubscriptionReference());
|
---|
| 92 | }
|
---|
| 93 | }
|
---|
| 94 | catch (SubscriptionRepositoryException ex)
|
---|
| 95 | {
|
---|
| 96 | log.error(ex.getMessage(), ex);
|
---|
| 97 | // Create empty response until fault handling is added
|
---|
| 98 | subscriptionItems = new gov.hhs.fha.nhinc.common.subscription.SubscriptionItemsType();
|
---|
| 99 | }
|
---|
| 100 | return subscriptionItems;
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | }
|
---|