Produced by Araxis Merge on 6/9/2017 3:49:50 PM Eastern 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 | Fri Jun 9 19:49:50 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-client\src\main\java\gov\va\nvap\svc\consenteval\common | XACMLRequestParser.java | Fri Apr 21 20:15:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 296 |
| 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.nvap. svc.consen teval.comm on; | |||||
| 2 | ||||||
| 3 | import jav a.util.Lis t; | |||||
| 4 | ||||||
| 5 | import oas is.names.t c.xacml._2 _0.context .schema.os .RequestTy pe; | |||||
| 6 | ||||||
| 7 | public cla ss XACMLRe questParse r { | |||||
| 8 | ||||||
| 9 | /* * | |||||
| 10 | * @param re questType | |||||
| 11 | * @return | |||||
| 12 | * / | |||||
| 13 | pu blic stati c String e xtractRequ estorHomeC ommunityId ( | |||||
| 14 | final RequestTyp e requestT ype) { | |||||
| 15 | Stri ng hcid = ""; | |||||
| 16 | fina l List<Str ing> hcids = XACMLCo ntextUtil | |||||
| 17 | .extract SubjectAtt ributeValu es( | |||||
| 18 | re questType, | |||||
| 19 | XA CMLContext Constants. XACML_REQU EST_SUBJEC T_HOME_COM MUNITY_ID_ ATTR_ID); | |||||
| 20 | if ( (hcids != null) && ( hcids.size () > 0)) { | |||||
| 21 | hcid = hcids.get (0); // HC ID in Subj ect | |||||
| 22 | } | |||||
| 23 | ||||||
| 24 | retu rn hcid; | |||||
| 25 | } | |||||
| 26 | ||||||
| 27 | /* * | |||||
| 28 | * @param re questType | |||||
| 29 | * @return | |||||
| 30 | * / | |||||
| 31 | pu blic stati c String e xtractReso urceHomeCo mmunityId( | |||||
| 32 | final RequestTyp e requestT ype) { | |||||
| 33 | Stri ng hcid = ""; | |||||
| 34 | fina l List<Str ing> hcids = XACMLCo ntextUtil | |||||
| 35 | .extract ResourceAt tributeVal ues( | |||||
| 36 | re questType, | |||||
| 37 | XA CMLContext Constants. XACML_REQU EST_RESOUR CE_HOME_CO MMUNITY_ID _ATTR_ID); | |||||
| 38 | if ( (hcids != null) && ( hcids.size () > 0)) { | |||||
| 39 | hcid = hcids.get (0); // HC ID in Subj ect | |||||
| 40 | } | |||||
| 41 | ||||||
| 42 | retu rn hcid; | |||||
| 43 | } | |||||
| 44 | ||||||
| 45 | /* * | |||||
| 46 | * @param re questType | |||||
| 47 | * @return | |||||
| 48 | * / | |||||
| 49 | pu blic stati c String e xtractSubj ectPOU(fin al Request Type reque stType) { | |||||
| 50 | Stri ng pou = " "; | |||||
| 51 | fina l List<Str ing> pous = XACMLCon textUtil | |||||
| 52 | .extract SubjectAtt ributeValu es( | |||||
| 53 | re questType, | |||||
| 54 | XA CMLContext Constants. XACML_REQU EST_SUBJEC T_PURPOSE_ FOR_USE_AT TR_ID); | |||||
| 55 | if ( (pous != n ull) && (p ous.size() > 0)) { | |||||
| 56 | pou = pous.get(0 ); // POU in Subject | |||||
| 57 | } | |||||
| 58 | ||||||
| 59 | retu rn pou; | |||||
| 60 | } | |||||
| 61 | ||||||
| 62 | /* * | |||||
| 63 | * @param re questType | |||||
| 64 | * @return | |||||
| 65 | * / | |||||
| 66 | // Should ha ve the sam e value as getResour ceHomeComm unityId. U sed by PDP Impl | |||||
| 67 | pu blic stati c String g etEnvironm entLocalit y(final Re questType requestTyp e) { | |||||
| 68 | Stri ng envLoca lity = ""; | |||||
| 69 | fina l List<Str ing> els = XACMLCont extUtil.ge tResourceA ttributeVa lues( | |||||
| 70 | requestT ype, XACML ContextCon stants.ENV _LOCALITY_ ATTR_ID); | |||||
| 71 | if ( (els != nu ll) && (el s.size() > 0)) { | |||||
| 72 | envLoc ality = el s.get(0); | |||||
| 73 | } | |||||
| 74 | ||||||
| 75 | retu rn envLoca lity; | |||||
| 76 | } | |||||
| 77 | ||||||
| 78 | /* * | |||||
| 79 | * @param re quest | |||||
| 80 | * @return | |||||
| 81 | * / | |||||
| 82 | pu blic stati c List<Str ing> getPa tientAllow edHomeComm unities( | |||||
| 83 | final RequestTyp e request) { | |||||
| 84 | fina l List<Str ing> patie ntAllowedO rgs = XACM LContextUt il | |||||
| 85 | .getReso urceAttrib uteValues( | |||||
| 86 | re quest, | |||||
| 87 | XA CMLContext Constants. RESOURCE_P ATIENT_ALL OWED_ORGS_ ATTR_ID); | |||||
| 88 | retu rn patient AllowedOrg s; | |||||
| 89 | } | |||||
| 90 | ||||||
| 91 | /* | |||||
| 92 | * DELETE pu blic stati c String g etSubjectL ocality (f inal Reque stType | |||||
| 93 | * request) { String s ubjectLoca lity = ""; if (isInb ound(reque st)) { | |||||
| 94 | * subjectLo cality = g etRequesto rHomeCommu nityId(req uest); } e lse if | |||||
| 95 | * (isOutbou nd(request )) { subje ctLocality = | |||||
| 96 | * getResour ceHomeComm unityId(re quest); } return sub jectLocali ty; } | |||||
| 97 | * / | |||||
| 98 | ||||||
| 99 | /* * | |||||
| 100 | * @param re quest | |||||
| 101 | * @return | |||||
| 102 | * / | |||||
| 103 | pu blic stati c String g etRequeste dAction(fi nal Reques tType requ est) { | |||||
| 104 | retu rn XACMLCo ntextUtil. getActionA ttributeVa lue(reques t, | |||||
| 105 | XACMLCon textConsta nts.XACML_ REQUEST_AC TION_ID_AT TR_ID); | |||||
| 106 | ||||||
| 107 | } | |||||
| 108 | ||||||
| 109 | /* * | |||||
| 110 | * @param re questType | |||||
| 111 | * @return | |||||
| 112 | * / | |||||
| 113 | pu blic stati c String g etRequeste dResourceI d(final Re questType requestTyp e) { | |||||
| 114 | fina l List<Str ing> pids = XACMLCon textUtil.g etResource AttributeV alues( | |||||
| 115 | requestT ype, | |||||
| 116 | XACMLCon textConsta nts.XACML_ REQUEST_RE SOURCE_ID_ ATTR_ID); | |||||
| 117 | if ( (pids == n ull) || (p ids.size() == 0)) { | |||||
| 118 | return ""; | |||||
| 119 | } | |||||
| 120 | retu rn pids.ge t(0); | |||||
| 121 | } | |||||
| 122 | ||||||
| 123 | /* * | |||||
| 124 | * @param re questType | |||||
| 125 | * @return | |||||
| 126 | * / | |||||
| 127 | pu blic stati c String g etRequesto rHomeCommu nityId( | |||||
| 128 | final RequestTyp e requestT ype) { | |||||
| 129 | Stri ng hcid = ""; | |||||
| 130 | fina l List<Str ing> hcids = XACMLCo ntextUtil | |||||
| 131 | .getSubj ectAttribu teValues( | |||||
| 132 | re questType, | |||||
| 133 | XA CMLContext Constants. XACML_REQU EST_SUBJEC T_HOME_COM MUNITY_ID_ ATTR_ID); | |||||
| 134 | if ( (hcids != null) && ( hcids.size () > 0)) { | |||||
| 135 | hcid = hcids.get (0); // HC ID in Subj ect | |||||
| 136 | } | |||||
| 137 | ||||||
| 138 | retu rn hcid; | |||||
| 139 | } | |||||
| 140 | ||||||
| 141 | /* * | |||||
| 142 | * @param re questType | |||||
| 143 | * @return | |||||
| 144 | * / | |||||
| 145 | pu blic stati c String g etRequesto rPurposeOf Use(final RequestTyp e requestT ype) { | |||||
| 146 | fina l List<Str ing> pouCo des = XACM LContextUt il | |||||
| 147 | .getSubj ectAttribu teValues( | |||||
| 148 | re questType, | |||||
| 149 | XA CMLContext Constants. XACML_REQU EST_SUBJEC T_PURPOSE_ FOR_USE_AT TR_ID); | |||||
| 150 | if ( (pouCodes == null) | | (pouCode s.size() = = 0)) { | |||||
| 151 | return ""; | |||||
| 152 | } | |||||
| 153 | retu rn pouCode s.get(0); | |||||
| 154 | } | |||||
| 155 | ||||||
| 156 | /* * | |||||
| 157 | * @param re questType | |||||
| 158 | * @return | |||||
| 159 | * / | |||||
| 160 | pu blic stati c String g etRequesto rSubjectId (final Req uestType r equestType ) { | |||||
| 161 | fina l List<Str ing> sids = XACMLCon textUtil.g etSubjectA ttributeVa lues( | |||||
| 162 | requestT ype, | |||||
| 163 | XACMLCon textConsta nts.XACML_ REQUEST_SU BJECT_SUBJ ECT_ID_ATT R_ID); | |||||
| 164 | if ( (sids == n ull) || (s ids.size() == 0)) { | |||||
| 165 | return ""; | |||||
| 166 | } | |||||
| 167 | retu rn sids.ge t(0); | |||||
| 168 | ||||||
| 169 | } | |||||
| 170 | ||||||
| 171 | /* * | |||||
| 172 | * @param re questType | |||||
| 173 | * @return | |||||
| 174 | * / | |||||
| 175 | pu blic stati c String g etResource HomeCommun ityId( | |||||
| 176 | final RequestTyp e requestT ype) { | |||||
| 177 | Stri ng hcid = ""; | |||||
| 178 | fina l List<Str ing> hcids = XACMLCo ntextUtil | |||||
| 179 | .getReso urceAttrib uteValues( | |||||
| 180 | re questType, | |||||
| 181 | XA CMLContext Constants. XACML_REQU EST_RESOUR CE_HOME_CO MMUNITY_ID _ATTR_ID); | |||||
| 182 | if ( (hcids != null) && ( hcids.size () > 0)) { | |||||
| 183 | hcid = hcids.get (0); // HC ID in Subj ect | |||||
| 184 | } | |||||
| 185 | ||||||
| 186 | retu rn hcid; | |||||
| 187 | } | |||||
| 188 | /* * | |||||
| 189 | * @param re questType | |||||
| 190 | * @return | |||||
| 191 | * / | |||||
| 192 | pu blic stati c String g etSamlAuth ( | |||||
| 193 | final RequestTyp e requestT ype) { | |||||
| 194 | Stri ng saml = ""; | |||||
| 195 | fina l List<Str ing> samls = XACMLCo ntextUtil | |||||
| 196 | .getReso urceAttrib uteValues( | |||||
| 197 | re questType, | |||||
| 198 | XA CMLContext Constants. RESOURCE_S AML_AUTH); | |||||
| 199 | if ( (samls != null) && ( samls.size () > 0)) { | |||||
| 200 | saml = samls.get (0); // HC ID in Subj ect | |||||
| 201 | } | |||||
| 202 | ||||||
| 203 | retu rn saml; | |||||
| 204 | } | |||||
| 205 | /* * | |||||
| 206 | * @param re quest | |||||
| 207 | * @return | |||||
| 208 | * / | |||||
| 209 | // Should ha ve the sam e value as getReques tedAction. Used by P DPImpl | |||||
| 210 | pu blic stati c String g etResource ServiceTyp e(final Re questType request) { | |||||
| 211 | Stri ng service Type = ""; | |||||
| 212 | fina l List<Str ing> servi ceTypes = XACMLConte xtUtil | |||||
| 213 | .getReso urceAttrib uteValues( request, | |||||
| 214 | XA CMLContext Constants. RESOURCE_S ERVICE_TYP E_ATTR_ID) ; | |||||
| 215 | if ( (serviceTy pes != nul l) && (ser viceTypes. size() > 0 )) { | |||||
| 216 | servic eType = se rviceTypes .get(0); / / ServiceT ype in Res ource | |||||
| 217 | } | |||||
| 218 | ||||||
| 219 | retu rn service Type; | |||||
| 220 | ||||||
| 221 | } | |||||
| 222 | ||||||
| 223 | /* * | |||||
| 224 | * @param re questType | |||||
| 225 | * @return | |||||
| 226 | * / | |||||
| 227 | // Should ha ve the sam e value as getReques torHomeCom munityId. Used by | |||||
| 228 | // PDPImpl | |||||
| 229 | pu blic stati c String g etSubjectL ocality(fi nal Reques tType requ estType) { | |||||
| 230 | Stri ng subject Locality = ""; | |||||
| 231 | fina l List<Str ing> sls = XACMLCont extUtil.ge tSubjectAt tributeVal ues( | |||||
| 232 | requestT ype, XACML ContextCon stants.SUB JECT_LOCAL ITY_ATTR_I D); | |||||
| 233 | if ( (sls != nu ll) && (sl s.size() > 0)) { | |||||
| 234 | subjec tLocality = sls.get( 0); | |||||
| 235 | } | |||||
| 236 | ||||||
| 237 | retu rn subject Locality; | |||||
| 238 | } | |||||
| 239 | ||||||
| 240 | pu blic stati c boolean isDocQuery (final Req uestType r equest) { | |||||
| 241 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 242 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_D OC_QUERY_I N_ACTION_I D_VALUE | |||||
| 243 | .equals( action) | |||||
| 244 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_QUERY _OUT_ACTIO N_ID_VALUE | |||||
| 245 | .e quals(acti on); | |||||
| 246 | } | |||||
| 247 | ||||||
| 248 | pu blic stati c boolean isDocRetri eve(final RequestTyp e request) { | |||||
| 249 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 250 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_D OC_RETRIEV E_IN_ACTIO N_ID_VALUE | |||||
| 251 | .equals( action) | |||||
| 252 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_RETRI EVE_OUT_AC TION_ID_VA LUE | |||||
| 253 | .e quals(acti on); | |||||
| 254 | } | |||||
| 255 | ||||||
| 256 | pu blic stati c boolean isInbound( final Requ estType re quest) { | |||||
| 257 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 258 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_P ATIENT_DIS COVERY_IN_ ACTION_ID_ VALUE | |||||
| 259 | .equals( action) | |||||
| 260 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_QUERY _IN_ACTION _ID_VALUE | |||||
| 261 | .e quals(acti on) | |||||
| 262 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_RETRI EVE_IN_ACT ION_ID_VAL UE | |||||
| 263 | .e quals(acti on); | |||||
| 264 | } | |||||
| 265 | ||||||
| 266 | pu blic stati c boolean isNHINOut( final Requ estType re quest) { | |||||
| 267 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 268 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_N HINOUT_ACT ION_ID_VAL UE | |||||
| 269 | .equals( action); | |||||
| 270 | } | |||||
| 271 | ||||||
| 272 | pu blic stati c boolean isOutbound (final Req uestType r equest) { | |||||
| 273 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 274 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_P ATIENT_DIS COVERY_OUT _ACTION_ID _VALUE | |||||
| 275 | .equals( action) | |||||
| 276 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_QUERY _OUT_ACTIO N_ID_VALUE | |||||
| 277 | .e quals(acti on) | |||||
| 278 | || XACML ContextCon stants.XAC ML_REQUEST _DOC_RETRI EVE_OUT_AC TION_ID_VA LUE | |||||
| 279 | .e quals(acti on); | |||||
| 280 | } | |||||
| 281 | ||||||
| 282 | pu blic stati c boolean isPatientD iscovery(f inal Reque stType req uest) { | |||||
| 283 | fina l String a ction = XA CMLRequest Parser.get RequestedA ction(requ est); | |||||
| 284 | retu rn XACMLCo ntextConst ants.XACML _REQUEST_P ATIENT_DIS COVERY_IN_ ACTION_ID_ VALUE | |||||
| 285 | .equals( action) | |||||
| 286 | || XACML ContextCon stants.XAC ML_REQUEST _PATIENT_D ISCOVERY_O UT_ACTION_ ID_VALUE | |||||
| 287 | .e quals(acti on); | |||||
| 288 | } | |||||
| 289 | ||||||
| 290 | pu blic stati c void val idateAndFi xMessage(f inal Reque stType req uest) { | |||||
| 291 | XACM LContextUt il.validat eAndFixSub jectAttrib utes(reque st); | |||||
| 292 | XACM LContextUt il.validat eAndFixRes ourceAttri butes(requ est); | |||||
| 293 | XACM LContextUt il.validat eAndFixAct ionAttribu tes(reques t); | |||||
| 294 | ||||||
| 295 | } | |||||
| 296 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.