Produced by Araxis Merge on 4/5/2017 4:21:45 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\working_scrub\Unredacted\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\AdapterEJB\src\main\java\gov\va\med\nhin\adapter\adaptergateway\docretrieve | AdapterGatewayDocRetrieve.java | Fri Feb 10 15:41:44 2017 UTC |
| 2 | eHX-CIF.zip\eHX-CIF\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\AdapterEJB\src\main\java\gov\va\med\nhin\adapter\adaptergateway\docretrieve | AdapterGatewayDocRetrieve.java | Mon Apr 3 14:22:59 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 760 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.med.n hin.adapte r.adapterg ateway.doc retrieve; | |
| 2 | ||
| 3 | import jav a.util.con current.Ca llable; | |
| 4 | import jav a.util.con current.Ex ecutionExc eption; | |
| 5 | import jav a.util.con current.Ex ecutorComp letionServ ice; | |
| 6 | import jav a.util.con current.Ex ecutorServ ice; | |
| 7 | ||
| 8 | import jav ax.ejb.EJB ; | |
| 9 | import jav ax.ejb.Sta teless; | |
| 10 | ||
| 11 | import org .apache.co mmons.lang 3.StringUt ils; | |
| 12 | import org .slf4j.Log ger; | |
| 13 | import org .slf4j.Log gerFactory ; | |
| 14 | ||
| 15 | import gov .hhs.fha.n hinc.adapt erpolicyen gine.Adapt erPolicyEn ginePortTy pe; | |
| 16 | import gov .hhs.fha.n hinc.commo n.eventcom mon.DocRet rieveEvent Type; | |
| 17 | import gov .hhs.fha.n hinc.commo n.eventcom mon.DocRet rieveMessa geType; | |
| 18 | import gov .hhs.fha.n hinc.commo n.nhinccom mon.Assert ionType; | |
| 19 | import gov .hhs.fha.n hinc.commo n.nhinccom mon.HomeCo mmunityTyp e; | |
| 20 | import gov .hhs.fha.n hinc.commo n.nhinccom monadapter .CheckPoli cyRequestT ype; | |
| 21 | import gov .hhs.fha.n hinc.commo n.nhinccom monadapter .CheckPoli cyResponse Type; | |
| 22 | import gov .hhs.fha.n hinc.commo n.nhinccom monentity. Responding GatewayCro ssGatewayR etrieveReq uestType; | |
| 23 | import gov .hhs.fha.n hinc.nhinc lib.NhincC onstants; | |
| 24 | import gov .hhs.fha.n hinc.trans form.polic y.PolicyEn gineTransf ormer; | |
| 25 | import gov .va.med.nh in.adapter .adapterga teway.work manager.Wo rkManagerE xecutorSer viceLocal; | |
| 26 | import gov .va.med.nh in.adapter .facilitym anager.Fac ility; | |
| 27 | import gov .va.med.nh in.adapter .facilitym anager.Fac ilityManag er; | |
| 28 | import gov .va.med.nh in.adapter .facilitym anager.Fac ilityManag erLocal; | |
| 29 | import gov .va.med.nh in.adapter .facilitym anager.Ope rationOnOf f; | |
| 30 | import gov .va.med.nh in.adapter .logging.C heckPolicy ; | |
| 31 | import gov .va.med.nh in.adapter .logging.E ntityRetri eveError; | |
| 32 | import gov .va.med.nh in.adapter .logging.E rrorMessag e; | |
| 33 | import gov .va.med.nh in.adapter .logging.M aintLog; | |
| 34 | import gov .va.med.nh in.adapter .policyeng ine.Adapte rPolicyEng inePortTyp eLocal; | |
| 35 | import ihe .iti.xds_b ._2007.Ret rieveDocum entSetRequ estType; | |
| 36 | import ihe .iti.xds_b ._2007.Ret rieveDocum entSetRequ estType.Do cumentRequ est; | |
| 37 | import ihe .iti.xds_b ._2007.Ret rieveDocum entSetResp onseType; | |
| 38 | import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryError; | |
| 39 | import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryErrorLi st; | |
| 40 | import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryRespons eType; | |
| 41 | ||
| 42 | /** | |
| 43 | * | |
| 44 | * @author DN S WELCHR | |
| 45 | */ | |
| 46 | ||
| 47 | @Stateless (name = "A dapterGate wayDocRetr ieve") | |
| 48 | public cla ss Adapter GatewayDoc Retrieve i mplements EntityDocR etrievePor tTypeLocal | |
| 49 | { | |
| 50 | pr ivate stat ic final L ogger logg er = Logge rFactory.g etLogger(A dapterGate wayDocRetr ieve.class .getName() ); | |
| 51 | ||
| 52 | pr ivate clas s SendRequ estRespons e | |
| 53 | { | |
| 54 | publ ic Retriev eDocumentS etResponse Type retri eveDocumen tSetRespon se; | |
| 55 | publ ic SendReq uestExcept ion sre = null; | |
| 56 | ||
| 57 | publ ic boolean hasError( ) | |
| 58 | { | |
| 59 | return sre != nu ll; | |
| 60 | } | |
| 61 | } | |
| 62 | ||
| 63 | pr ivate clas s SendRequ estExcepti on extends Exception | |
| 64 | { | |
| 65 | priv ate static final lon g serialVe rsionUID = 1L; | |
| 66 | ||
| 67 | publ ic String remoteHome CommunityI d; | |
| 68 | } | |
| 69 | ||
| 70 | pr ivate clas s SendRequ estCallabl e implemen ts Callabl e<SendRequ estRespons e> | |
| 71 | { | |
| 72 | publ ic final R etrieveDoc umentSetRe questType retrieveDo cumentSetR equest; | |
| 73 | publ ic final A ssertionTy pe asserti on; | |
| 74 | publ ic final S tring remo teHomeComm unityId; | |
| 75 | ||
| 76 | publ ic SendReq uestCallab le(Retriev eDocumentS etRequestT ype retrie veDocument SetRequest , Assertio nType asse rtion, Str ing remote HomeCommun ityId) | |
| 77 | { | |
| 78 | this.r etrieveDoc umentSetRe quest = re trieveDocu mentSetReq uest; | |
| 79 | this.a ssertion = assertion ; | |
| 80 | this.r emoteHomeC ommunityId = remoteH omeCommuni tyId; | |
| 81 | ||
| 82 | logger .info("RD request ca llable cre ated."); | |
| 83 | } | |
| 84 | ||
| 85 | @Ove rride | |
| 86 | publ ic SendReq uestRespon se call() throws Exc eption | |
| 87 | { | |
| 88 | logger .info("RD request ca llable sen ding reque st..."); | |
| 89 | return sendReque st(retriev eDocumentS etRequest, assertion , remoteHo meCommunit yId); | |
| 90 | } | |
| 91 | } | |
| 92 | ||
| 93 | pr ivate Faci lityManage r facility Manager; | |
| 94 | pr ivate Adap terPolicyE nginePortT ype adapte rPolicyEng ine; | |
| 95 | pr ivate NHIN DocRetriev eRequestSe nder nhinD ocRetrieve RequestSen der; | |
| 96 | pr ivate Exec utorServic e executor Service; | |
| 97 | ||
| 98 | @E JB(beanInt erface = F acilityMan agerLocal. class, bea nName = "F acilityMan ager") | |
| 99 | pu blic void setFacilit yManager(F acilityMan ager facil ityManager ) | |
| 100 | { | |
| 101 | this .facilityM anager = f acilityMan ager; | |
| 102 | } | |
| 103 | ||
| 104 | @E JB(beanInt erface = A dapterPoli cyEnginePo rtTypeLoca l.class, b eanName = "AdapterPo licyEngine ") | |
| 105 | pu blic void setAdapter PolicyEngi ne(Adapter PolicyEngi nePortType adapterPo licyEngine ) | |
| 106 | { | |
| 107 | this .adapterPo licyEngine = adapter PolicyEngi ne; | |
| 108 | } | |
| 109 | ||
| 110 | @E JB(beanInt erface = N HINDocRetr ieveReques tSender.cl ass, beanN ame = "Nhi ncProxyNHI NDocRetrie veRequestS ender") | |
| 111 | pu blic void setNhinDoc QueryReque stSender(N HINDocRetr ieveReques tSender nh inDocQuery RequestSen der) | |
| 112 | { | |
| 113 | this .nhinDocRe trieveRequ estSender = nhinDocQ ueryReques tSender; | |
| 114 | } | |
| 115 | ||
| 116 | // @EJB(beanI nterface = WorkManag erExecutor ServiceLoc al.class, beanName = "WorkMana gerExecuto rService") | |
| 117 | @E JB(beanInt erface = W orkManager ExecutorSe rviceLocal .class, be anName = " OutboundRD WorkManage rExecutorS ervice") //changed 1/24/2017 | |
| 118 | pu blic void setExecuto rService(E xecutorSer vice execu torService ) | |
| 119 | { | |
| 120 | this .executorS ervice = e xecutorSer vice; | |
| 121 | } | |
| 122 | ||
| 123 | @O verride | |
| 124 | pu blic Retri eveDocumen tSetRespon seType res pondingGat ewayCrossG atewayRetr ieve(Respo ndingGatew ayCrossGat ewayRetrie veRequestT ype respon dingGatewa yCrossGate wayRetriev eRequest) | |
| 125 | { | |
| 126 | // C CR 177986 | |
| 127 | logg er.debug(" responding GatewayCro ssGatewayR etrieve() invoked"); | |
| 128 | ||
| 129 | Retr ieveDocume ntSetRespo nseType re t = new Re trieveDocu mentSetRes ponseType( ); | |
| 130 | Retr ieveDocume ntSetReque stType ret rieveDocum entSetRequ est = resp ondingGate wayCrossGa tewayRetri eveRequest .getRetrie veDocument SetRequest (); | |
| 131 | ||
| 132 | // C CR 177986 | |
| 133 | logg er.debug(" RetrieveDo cumentSetR equestType retrieveD ocumentSet Request {} ", retrie veDocument SetRequest ); | |
| 134 | ||
| 135 | Asse rtionType assertion = respondi ngGatewayC rossGatewa yRetrieveR equest.get Assertion( ); | |
| 136 | ||
| 137 | // C CR 177986 | |
| 138 | logg er.debug(" Assertion Type asser tion {} ", assertion ); | |
| 139 | ||
| 140 | Exec utorComple tionServic e<SendRequ estRespons e> complet ionService = new Exe cutorCompl etionServi ce<>(execu torService ); | |
| 141 | int numSubmitt ed = 0; | |
| 142 | ||
| 143 | for( DocumentRe quest docu mentReques t : retrie veDocument SetRequest .getDocume ntRequest( )) | |
| 144 | { | |
| 145 | Retrie veDocument SetRequest Type newRe quest = cr eateRetrie veDocument SetRequest (documentR equest); | |
| 146 | ||
| 147 | logger .debug("Re trieveDocu mentSetReq uestType n ewRequest {} ", newR equest); / / CCR | |
| 148 | // 1 77986 | |
| 149 | logger .debug("Ho me Communi ty Id {} : ", docume ntRequest. getHomeCom munityId() ); | |
| 150 | ||
| 151 | if(che ckPolicy(n ewRequest, assertion , document Request.ge tHomeCommu nityId())) | |
| 152 | { | |
| 153 | if(facil ityManager .isPartner Allowed(do cumentRequ est.getHom eCommunity Id(), Oper ationOnOff .ONBOARD)) | |
| 154 | { | |
| 155 | if(facilit yManager.i sPartnerAl lowed(docu mentReques t.getHomeC ommunityId (), Operat ionOnOff.O UT_DR)) | |
| 156 | { | |
| 157 | Se ndRequestC allable ca llable = n ew SendReq uestCallab le(newRequ est, asser tion, docu mentReques t.getHomeC ommunityId ()); | |
| 158 | co mpletionSe rvice.subm it(callabl e); | |
| 159 | ++ numSubmitt ed; | |
| 160 | ||
| 161 | lo gger.debug ("numSubmi tted {} ", numSubmit ted); | |
| 162 | } | |
| 163 | else | |
| 164 | { | |
| 165 | // Outbound DR Error | |
| 166 | ad dErrorToRe sponse(ret , "Interna l Registry /Repositor y Error: " + ErrorMe ssage.OUT_ DR_DISABLE D.getMessa ge(), docu mentReques t.getHomeC ommunityId ()); | |
| 167 | Ma intLog.que ryError(nu ll, ErrorM essage.OUT _DQ_DISABL ED, docume ntRequest. getHomeCom munityId() , logger); | |
| 168 | } | |
| 169 | } | |
| 170 | else | |
| 171 | { | |
| 172 | // Outboun d no partn er | |
| 173 | addErrorTo Response(r et, "Inter nal Regist ry/Reposit ory Error: " + Error Message.OU T_DR_NOT_A _PARTNER.g etMessage( ), documen tRequest.g etHomeComm unityId()) ; | |
| 174 | MaintLog.q ueryError( null, Erro rMessage.O UT_DR_NOT_ A_PARTNER, documentR equest.get HomeCommun ityId(), l ogger); | |
| 175 | } | |
| 176 | } | |
| 177 | } | |
| 178 | ||
| 179 | for( int i = 0; i < numSu bmitted; + +i) | |
| 180 | { | |
| 181 | try | |
| 182 | { | |
| 183 | SendRequ estRespons e response = complet ionService .take().ge t(); | |
| 184 | if(!resp onse.hasEr ror()) | |
| 185 | { | |
| 186 | addResultT oResponse( ret, respo nse.retrie veDocument SetRespons e); | |
| 187 | } | |
| 188 | else | |
| 189 | { | |
| 190 | SendReques tException sre = res ponse.sre; | |
| 191 | addErrorTo Response(r et, "Inter nal Regist ry/Reposit ory Error - HCID = " + sre.rem oteHomeCom munityId, sre.remote HomeCommun ityId); | |
| 192 | logger.war n("Error s ending Doc Retrieve f or communi ty id: {} with excep tion: {} " , sre.remo teHomeComm unityId, s re); // CC R | |
| 193 | // 17798 6- | |
| 194 | // loggi ng | |
| 195 | ||
| 196 | } | |
| 197 | } | |
| 198 | catch( ExecutionE xception e e) | |
| 199 | { | |
| 200 | logger.e rror("An U nknown err or occured processin g an outbo und doc re trieve req uest.", ee ); | |
| 201 | EntityRe trieveErro r.retrieve Error(resp ondingGate wayCrossGa tewayRetri eveRequest , ErrorMes sage.OUT_D R_UKNOWN, ee.getMess age()); | |
| 202 | } | |
| 203 | catch( Interrupte dException ie) | |
| 204 | { | |
| 205 | logger.e rror("Outb ound Doc R etrieve Th reads inte rrupted. Return wil l not be c omplete.", ie); | |
| 206 | } | |
| 207 | } | |
| 208 | ||
| 209 | retu rn ret; | |
| 210 | } | |
| 211 | ||
| 212 | pr ivate Retr ieveDocume ntSetReque stType cre ateRetriev eDocumentS etRequest( DocumentRe quest docu mentReques t) | |
| 213 | { | |
| 214 | Retr ieveDocume ntSetReque stType ret = new Ret rieveDocum entSetRequ estType(); | |
| 215 | ret. getDocumen tRequest() .add(docum entRequest ); | |
| 216 | retu rn ret; | |
| 217 | } | |
| 218 | ||
| 219 | pr ivate bool ean checkP olicy(Retr ieveDocume ntSetReque stType ret rieveDocum entSetRequ est, Asser tionType a ssertion, String rem oteHomeCom munityId) | |
| 220 | { | |
| 221 | logg er.debug(" DR Check P olicy"); | |
| 222 | ||
| 223 | DocR etrieveMes sageType d ocRetrieve Message = new DocRet rieveMessa geType(); | |
| 224 | docR etrieveMes sage.setRe trieveDocu mentSetReq uest(retri eveDocumen tSetReques t); | |
| 225 | docR etrieveMes sage.setAs sertion(as sertion); | |
| 226 | logg er.info("R equest doc RetrieveMe ssage crea ted"); | |
| 227 | ||
| 228 | Home CommunityT ype receiv ingHomeCom munity = n ew HomeCom munityType (); | |
| 229 | rece ivingHomeC ommunity.s etHomeComm unityId(re moteHomeCo mmunityId) ; | |
| 230 | logg er.debug(" Request re ceivingHom eCommunity : {}", rem oteHomeCom munityId); | |
| 231 | ||
| 232 | Home CommunityT ype sendin gHomeCommu nity = new HomeCommu nityType() ; | |
| 233 | send ingHomeCom munity.set HomeCommun ityId(getH omeCommuni tyId()); | |
| 234 | logg er.debug(" Request se ndingHomeC ommunity: {}", sendi ngHomeComm unity.getH omeCommuni tyId()); | |
| 235 | ||
| 236 | DocR etrieveEve ntType doc RetrieveEv ent = new DocRetriev eEventType (); | |
| 237 | docR etrieveEve nt.setMess age(docRet rieveMessa ge); | |
| 238 | docR etrieveEve nt.setDire ction(Nhin cConstants .POLICYENG INE_OUTBOU ND_DIRECTI ON); | |
| 239 | logg er.debug(" Request do cRetrieveE vent Direc tion: {}", NhincCons tants.POLI CYENGINE_O UTBOUND_DI RECTION); | |
| 240 | docR etrieveEve nt.setInte rface(Nhin cConstants .AUDIT_LOG _ENTITY_IN TERFACE); | |
| 241 | logg er.debug(" Request do cRetrieveE vent Inter face: {}", NhincCons tants.AUDI T_LOG_ENTI TY_INTERFA CE); | |
| 242 | docR etrieveEve nt.setRece ivingHomeC ommunity(r eceivingHo meCommunit y); | |
| 243 | docR etrieveEve nt.setSend ingHomeCom munity(sen dingHomeCo mmunity); | |
| 244 | logg er.debug(" Request do cRetrieveE vent creat ed"); | |
| 245 | ||
| 246 | Poli cyEngineTr ansformer transforme r = new Po licyEngine Transforme r(); | |
| 247 | Chec kPolicyReq uestType c heckPolicy Request = transforme r.transfor mDocRetrie veToCheckP olicy(docR etrieveEve nt); | |
| 248 | logg er.debug(" checkPolic yRequest c ompleted") ; | |
| 249 | ||
| 250 | if (facility Manager.ge tFacilityB yFacilityN umber("200 NSS") == n ull || !re moteHomeCo mmunityId. contains(f acilityMan ager.getFa cilityByFa cilityNumb er("200NSS ").getFull HomeCommun ityId())) | |
| 251 | { | |
| 252 | logger .info("Goi ng to chec kPolicy in adapterPo licyEngine ..."); | |
| 253 | CheckP olicyRespo nseType ch eckPolicyR esponse = adapterPol icyEngine. checkPolic y(checkPol icyRequest ); | |
| 254 | return CheckPoli cy.checkPo licy(check PolicyRequ est, check PolicyResp onse); | |
| 255 | } | |
| 256 | ||
| 257 | retu rn true; | |
| 258 | } | |
| 259 | ||
| 260 | pr ivate void addResult ToResponse (RetrieveD ocumentSet ResponseTy pe retriev eDocumentS etResponse , Retrieve DocumentSe tResponseT ype result ) | |
| 261 | { | |
| 262 | logg er.debug(" In addResu ltToRespon se"); | |
| 263 | if(r etrieveDoc umentSetRe sponse.get RegistryRe sponse() = = null) | |
| 264 | { | |
| 265 | if(res ult.getReg istryRespo nse() != n ull) | |
| 266 | { | |
| 267 | retrieve DocumentSe tResponse. setRegistr yResponse( result.get RegistryRe sponse()); | |
| 268 | } | |
| 269 | else | |
| 270 | { | |
| 271 | retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type()); | |
| 272 | } | |
| 273 | } | |
| 274 | ||
| 275 | if(r esult.getR egistryRes ponse().ge tRegistryE rrorList() != null) | |
| 276 | { | |
| 277 | logger .debug("Re gistry Err or List is not null. Adding er rors to Re gistry Res ponse"); | |
| 278 | if(ret rieveDocum entSetResp onse.getRe gistryResp onse() == null) | |
| 279 | { | |
| 280 | retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type()); | |
| 281 | } | |
| 282 | if(ret rieveDocum entSetResp onse.getRe gistryResp onse().get RegistryEr rorList() == null) | |
| 283 | { | |
| 284 | retrieve DocumentSe tResponse. getRegistr yResponse( ).setRegis tryErrorLi st(new Reg istryError List()); | |
| 285 | } | |
| 286 | retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().get RegistryEr ror().addA ll(result. getRegistr yResponse( ).getRegis tryErrorLi st().getRe gistryErro r()); | |
| 287 | retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().set HighestSev erity(resu lt.getRegi stryRespon se().getRe gistryErro rList().ge tHighestSe verity()); | |
| 288 | } | |
| 289 | ||
| 290 | if(r esult.getR egistryRes ponse().ge tStatus() != null) | |
| 291 | { | |
| 292 | if(ret rieveDocum entSetResp onse.getRe gistryResp onse() != null) | |
| 293 | { | |
| 294 | retrieve DocumentSe tResponse. getRegistr yResponse( ).setStatu s(result.g etRegistry Response() .getStatus ()); | |
| 295 | } | |
| 296 | } | |
| 297 | retr ieveDocume ntSetRespo nse.getDoc umentRespo nse().addA ll(result. getDocumen tResponse( )); | |
| 298 | } | |
| 299 | ||
| 300 | pr ivate void addErrorT oResponse( RetrieveDo cumentSetR esponseTyp e retrieve DocumentSe tResponse, String er rorString, final Str ing hcid) | |
| 301 | { | |
| 302 | logg er.debug(" In addErro rToRespons e"); | |
| 303 | if(r etrieveDoc umentSetRe sponse != null) | |
| 304 | { | |
| 305 | if(ret rieveDocum entSetResp onse.getRe gistryResp onse() == null) | |
| 306 | { | |
| 307 | retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type()); | |
| 308 | } | |
| 309 | ||
| 310 | if(ret rieveDocum entSetResp onse.getRe gistryResp onse().get RegistryEr rorList() == null) | |
| 311 | { | |
| 312 | retrieve DocumentSe tResponse. getRegistr yResponse( ).setRegis tryErrorLi st(new Reg istryError List()); | |
| 313 | } | |
| 314 | ||
| 315 | retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().set HighestSev erity("urn :oasis:nam es:tc:ebxm l-regrep:E rrorSeveri tyType:Err or"); | |
| 316 | ||
| 317 | Regist ryError re gistryErro r = new Re gistryErro r(); | |
| 318 | regist ryError.se tErrorCode ("XDSRegis tryError") ; | |
| 319 | regist ryError.se tCodeConte xt(errorSt ring); | |
| 320 | ||
| 321 | if(Str ingUtils.i sNotBlank( hcid)) | |
| 322 | { | |
| 323 | registry Error.setL ocation(hc id); | |
| 324 | } | |
| 325 | ||
| 326 | regist ryError.se tSeverity( "urn:oasis :names:tc: ebxml-regr ep:ErrorSe verityType :Error"); | |
| 327 | retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().get RegistryEr ror().add( registryEr ror); | |
| 328 | } | |
| 329 | } | |
| 330 | ||
| 331 | pr ivate bool ean commun itySupport s2011Specs (String hi eCommunity Oid) | |
| 332 | { | |
| 333 | logg er.debug(" In communi tySupports 2011Specs" ); | |
| 334 | // f etch the f acility in formation | |
| 335 | Faci lity facil ity = faci lityManage r.getFacil ityByFullH omeCommuni tyId(hieCo mmunityOid ); | |
| 336 | if(f acility == null) | |
| 337 | { | |
| 338 | logger .error("Er ror gettin g facility from {}", hieCommun ityOid); | |
| 339 | return false; | |
| 340 | } | |
| 341 | retu rn Facilit y.SPEC_VER SION_2011. equals(fac ility.getU seSpecVers ion()); | |
| 342 | } | |
| 343 | ||
| 344 | pr ivate Send RequestRes ponse send Request(Re trieveDocu mentSetReq uestType r etrieveDoc umentSetRe quest, Ass ertionType assertion , String r emoteHomeC ommunityId ) throws S endRequest Exception | |
| 345 | { | |
| 346 | logg er.info("D R Send Req uest..."); | |
| 347 | ||
| 348 | Send RequestRes ponse ret = new Send RequestRes ponse(); | |
| 349 | ||
| 350 | try | |
| 351 | { | |
| 352 | boolea n use2011S pec = fals e; | |
| 353 | if(com munitySupp orts2011Sp ecs(remote HomeCommun ityId)) | |
| 354 | { | |
| 355 | use2011S pec = true ; | |
| 356 | } | |
| 357 | ret.re trieveDocu mentSetRes ponse = nh inDocRetri eveRequest Sender.sen dRequest(r etrieveDoc umentSetRe quest, ass ertion, re moteHomeCo mmunityId, use2011Sp ec); | |
| 358 | logger .debug("RD response recieved f rom SSA"); | |
| 359 | } | |
| 360 | catc h(Throwabl e e) | |
| 361 | { | |
| 362 | SendRe questExcep tion sre = new SendR equestExce ption(); | |
| 363 | sre.re moteHomeCo mmunityId = remoteHo meCommunit yId; | |
| 364 | sre.in itCause(e) ; | |
| 365 | ret.sr e = sre; | |
| 366 | logger .debug("Er ror sendin g RD to SS A: {}", e. getMessage ()); | |
| 367 | } | |
| 368 | retu rn ret; | |
| 369 | } | |
| 370 | ||
| 371 | pr ivate Stri ng getHome CommunityI d() | |
| 372 | { | |
| 373 | Stri ng ret = n ull; | |
| 374 | Faci lity facil ity = faci lityManage r.getFacil ityByFacil ityNumber( "VA"); | |
| 375 | if(f acility != null) | |
| 376 | { | |
| 377 | ret = facility.g etHomeComm unityId(); | |
| 378 | } | |
| 379 | retu rn ret; | |
| 380 | } | |
| 381 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.