Produced by Araxis Merge on 2/4/2019 11:34:04 AM Eastern Standard 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 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\main\java\gov\va\mobile\vamf\mhpro\service\impl | ProviderService.java | Tue Nov 14 19:31:17 2017 UTC |
| 2 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\main\java\gov\va\mobile\vamf\mhpro\service\impl | ProviderService.java | Mon Feb 4 15:13:47 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 214 |
| 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.mobil e.vamf.mhp ro.service .impl; | |
| 2 | ||
| 3 | import jav a.util.Col lections; | |
| 4 | import jav a.util.Has hMap; | |
| 5 | import jav a.util.Map ; | |
| 6 | import jav a.util.Set ; | |
| 7 | ||
| 8 | import org .apache.co mmons.lang .StringUti ls; | |
| 9 | import org .slf4j.Log ger; | |
| 10 | import org .slf4j.Log gerFactory ; | |
| 11 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 12 | import org .springfra mework.bea ns.factory .annotatio n.Qualifie r; | |
| 13 | import org .springfra mework.con text.event .ContextRe freshedEve nt; | |
| 14 | import org .springfra mework.con text.event .EventList ener; | |
| 15 | import org .springfra mework.ste reotype.Se rvice; | |
| 16 | ||
| 17 | import gov .va.mobile .vamf.mhpr o.common.T emplatePro perties; | |
| 18 | import gov .va.mobile .vamf.mhpr o.datalaye r.Assignme ntReposito ry; | |
| 19 | import gov .va.mobile .vamf.mhpr o.datalaye r.Provider DetailsRep ository; | |
| 20 | import gov .va.mobile .vamf.mhpr o.domain.I ENAndStati onNumber; | |
| 21 | import gov .va.mobile .vamf.mhpr o.domain.P roviderDet ails; | |
| 22 | import gov .va.mobile .vamf.mhpr o.service. IProviderS ervice; | |
| 23 | ||
| 24 | /** | |
| 25 | * @author PII | |
| 26 | * | |
| 27 | */ | |
| 28 | @Service | |
| 29 | public cla ss Provide rService i mplements IProviderS ervice { | |
| 30 | pr ivate stat ic final L ogger logg er = Logge rFactory.g etLogger(P roviderSer vice.class ); | |
| 31 | ||
| 32 | @A utowired | |
| 33 | pr ivate Assi gnmentRepo sitory ass ignmentRep ository; | |
| 34 | @A utowired | |
| 35 | @Q ualifier(" providerDe tailsRepos itoryVista Impl") | |
| 36 | pr ivate Prov iderDetail sRepositor y provider DetailsRep ository; | |
| 37 | ||
| 38 | pr ivate Map< IENAndStat ionNumber, ProviderD etails> pr oviderDeta ilsStore; | |
| 39 | ||
| 40 | pu blic Provi derService () { | |
| 41 | prov iderDetail sStore = C ollections .synchroni zedMap(new HashMap<I ENAndStati onNumber, ProviderDe tails>()); | |
| 42 | } | |
| 43 | ||
| 44 | pu blic Provi derDetails getProvid erDetailsB yStation(S tring stat ionNumber, String pr oviderId) { | |
| 45 | retu rn getProv iderDetail s(new IENA ndStationN umber(prov iderId, st ationNumbe r)); | |
| 46 | } | |
| 47 | ||
| 48 | /* | |
| 49 | * (non-Java doc) | |
| 50 | * | |
| 51 | * @see gov. va.mobile. vamf.mhpro .service.I ProviderSe rvice# | |
| 52 | * getProvid erDetailsB yAssignAut h(java.lan g.String, java.lang. String) | |
| 53 | * / | |
| 54 | pu blic Provi derDetails getProvid erDetailsB yAssignAut h(String p roviderAss ignAuth, S tring prov iderIEN) { | |
| 55 | IENA ndStationN umber id = IENAndSta tionNumber .getForPro viderAssig nAuthAndIE N(provider AssignAuth , provider IEN); | |
| 56 | if ( id == null ) | |
| 57 | return null; | |
| 58 | ||
| 59 | Prov iderDetail s provider Details = getProvide rDetails(i d); | |
| 60 | retu rn provide rDetails; | |
| 61 | } | |
| 62 | ||
| 63 | pu blic Provi derDetails getProvid erDetails( IENAndStat ionNumber id) { | |
| 64 | //Fo r some rea son the fi rst call m ade return s the prox y user. T his makes sure we ma ke another call if t here is no data in t he cache | |
| 65 | if ( providerDe tailsStore .containsK ey(id) && providerDe tailsStore .get(id) ! = null) { | |
| 66 | return providerD etailsStor e.get(id); | |
| 67 | } | |
| 68 | ||
| 69 | Prov iderDetail s pd = get ProviderDe tailsInter nal(id); | |
| 70 | prov iderDetail sStore.put (id, pd); | |
| 71 | ||
| 72 | // r eturn a cl one to avo id polluti ng the cac he - CPB | |
| 73 | retu rn pd == n ull ? null : new Pro viderDetai ls(pd); | |
| 74 | } | |
| 75 | ||
| 76 | @E ventListen er({ Conte xtRefreshe dEvent.cla ss }) | |
| 77 | pu blic void refreshAll () { | |
| 78 | logg er.debug(" Clearing p rovider de tails cach e and repo pulating.. ."); | |
| 79 | prov iderDetail sStore.cle ar(); | |
| 80 | Set< IENAndStat ionNumber> providerI ds = assig nmentRepos itory.find UniqueProv iderIDs(); | |
| 81 | ||
| 82 | for (IENAndSta tionNumber id : prov iderIds) { | |
| 83 | Provid erDetails pd = null; | |
| 84 | try { | |
| 85 | pd = get ProviderDe tailsInter nal(id); | |
| 86 | } catc h (Excepti on e) { | |
| 87 | logger.e rror("Coul dn't retri eve provid er details for " + i d + ", ign oring... ( set log le vel to tra ce for ful l stack tr ace)"); | |
| 88 | logger.t race("Full exception :", e); | |
| 89 | continue ; | |
| 90 | } | |
| 91 | provid erDetailsS tore.put(i d, pd); | |
| 92 | } | |
| 93 | } | |
| 94 | ||
| 95 | pr ivate Prov iderDetail s getProvi derDetails Internal(I ENAndStati onNumber i d) { | |
| 96 | Stri ng overrid eName = Te mplateProp erties.get Property(" providerDe tailsUpdat e.override Name"); | |
| 97 | Prov iderDetail s pd = nul l; | |
| 98 | if ( StringUtil s.isNotBla nk(overrid eName)) { | |
| 99 | pd = n ew Provide rDetails() ; | |
| 100 | pd.set FullName(o verrideNam e + id.get IEN() + "@ " + id.get StationNum ber()); | |
| 101 | pd.set Id(new IEN AndStation Number(id) ); | |
| 102 | } el se { | |
| 103 | pd = p roviderDet ailsReposi tory.findB yIENAndSta tionNumber (id); | |
| 104 | } | |
| 105 | retu rn pd; | |
| 106 | } | |
| 107 | ||
| 108 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.