Produced by Araxis Merge on 12/5/2017 12:06:48 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROICommands\main\src\java\gov\va\med\imaging\roi\commands\periodic | PeriodicROICommandStarter.java | Mon Dec 4 21:35:20 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROICommands\main\src\java\gov\va\med\imaging\roi\commands\periodic | PeriodicROICommandStarter.java | Mon Dec 4 22:05:23 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 308 |
| Changed | 2 | 4 |
| 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 | /** | |
| 2 | * | |
| 3 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Apr 27, 2012 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.roi .commands. periodic; | |
| 27 | ||
| 28 | import org .apache.lo gging.log4 j.LogManag er; | |
| 29 | import org .apache.lo gging.log4 j.Logger; | |
| 30 | ||
| 31 | import gov .va.med.im aging.noti fications. Notificati onFacade; | |
| 32 | import gov .va.med.im aging.noti fications. Notificati onTypes; | |
| 33 | import gov .va.med.im aging.roi. commands.m bean.ROICo mmandsStat istics; | |
| 34 | import gov .va.med.im aging.roi. commands.f acade.ROIC ommandsCon text; | |
| 35 | import gov .va.med.im aging.roi. commands.p eriodic.co nfiguratio n.ROIPerio dicCommand Configurat ion; | |
| 36 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 37 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extMemento ; | |
| 38 | import gov .va.med.se rver.Serve rAgnosticE ngineAdapt er; | |
| 39 | ||
| 40 | /** | |
| 41 | * @author
|
|
| 42 | * | |
| 43 | */ | |
| 44 | public cla ss Periodi cROIComman dStarter | |
| 45 | { | |
| 46 | pr ivate stat ic ServerA gnosticEng ineAdapter engineAda pter = nul l; | |
| 47 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Peri odicROICom mandStarte r.class); | |
| 48 | ||
| 49 | pu blic synch ronized st atic void setEngineA dapter(Ser verAgnosti cEngineAda pter engin eAdapter) | |
| 50 | { | |
| 51 | Peri odicROICom mandStarte r.engineAd apter = en gineAdapte r; | |
| 52 | } | |
| 53 | ||
| 54 | pu blic stati c ROIPerio dicCommand sCredentia lsState cu rrentCrede ntialsStat e = ROIPer iodicComma ndsCredent ialsState. unknown; | |
| 55 | ||
| 56 | pu blic stati c void sta rtROIPerio dicCommand s() | |
| 57 | { | |
| 58 | logg er.info("I nitializin g ROI peri odic comma nds"); | |
| 59 | ||
| 60 | ||
| 61 | // s et up a se curity rea lm for the commands | |
| 62 | ROIP eriodicCom mandConfig uration co nfig = ROI PeriodicCo mmandConfi guration.g etROIPerio dicCommand Configurat ion(); | |
| 63 | ||
| 64 | //Pe riodicROIC ommandRunS tatus.getP eriodicCom mandRunSta tus().setP eriodicROI Processing Enabled(co nfig.isPer iodicROIPr ocessingEn abled()); | |
| 65 | ROIC ommandsSta tistics st ats = ROIC ommandsSta tistics.ge tRoiComman dsStatisti cs(); | |
| 66 | stat s.setRoiPr ocessWorkI temImmedia tely(confi g.isProces sWorkItemI mmediately ()); | |
| 67 | if(c onfig.isPe riodicROIP rocessingE nabled() | | config.i sExpireCom pletedItem sEnabled() ) | |
| 68 | { | |
| 69 | String accessCod e = config .getAccess Code().get Value(); | |
| 70 | String verifyCod e = config .getVerify Code().get Value(); | |
| 71 | if(acc essCode == null || a ccessCode. length() < =0) | |
| 72 | { | |
| 73 | logger.e rror("Miss ing access code, dis abling per iodic comm ands."); | |
| 74 | stats.se tRoiComple tedItemsPu rgeProcess ing(false) ; | |
| 75 | stats.se tRoiPeriod icProcessi ng(false); | |
| 76 | stats.se tRoiPeriod icProcessi ngError("M issing acc ess code") ; | |
| 77 | currentC redentials State = RO IPeriodicC ommandsCre dentialsSt ate.invali d; | |
| 78 | return; | |
| 79 | } | |
| 80 | if(ver ifyCode == null || v erifyCode. length() < =0) | |
| 81 | { | |
| 82 | logger.e rror("Miss ing verify code, dis abling per iodic comm ands."); | |
| 83 | stats.se tRoiComple tedItemsPu rgeProcess ing(false) ; | |
| 84 | stats.se tRoiPeriod icProcessi ng(false); | |
| 85 | stats.se tRoiPeriod icProcessi ngError("M issing ver ify code") ; | |
| 86 | currentC redentials State = RO IPeriodicC ommandsCre dentialsSt ate.invali d; | |
| 87 | return; | |
| 88 | } | |
| 89 | ||
| 90 | Transa ctionConte xtMemento memento = Transactio nContextFa ctory.get( ).getMemen to(); | |
| 91 | try | |
| 92 | { | |
| 93 | // Authe nticate on the main thread. | |
| 94 | if(engin eAdapter.a uthenticat e(accessCo de, verify Code.getBy tes()) == null) | |
| 95 | { | |
| 96 | stats.setR oiPeriodic Processing (false); | |
| 97 | stats.setR oiComplete dItemsPurg eProcessin g(false); | |
| 98 | stats.setR oiPeriodic Processing Error("Inv alid crede ntials for ROI perio dic proces sing, cann ot process requests" ); | |
| 99 | // if null is return ed that me ans the au thenticati on failed, do not st art the pe riodic com mand and s end out an email not ification | |
| 100 | logger.err or("Authen tication o f user for ROI Perio dic comman d failed, cannot sta rt periodi c command! "); | |
| 101 | // send an email not ification | |
| 102 | ||
| 103 | // if noth ing is ena bled then no real re ason to se nd a notif ication | |
| 104 | if(config. isExpireCo mpletedIte msEnabled( ) || confi g.isPeriod icROIProce ssingEnabl ed()) | |
| 105 | { | |
| 106 | lo gger.info( "Sending e mail notif ication ab out invali d credenti als for RO I periodic processin g."); | |
| 107 | St ring subje ct = "Inva lid VIX RO I service account cr edentials" ; | |
| 108 | St ring messa ge = "The credential s used for periodic processing of Releas e of Infor mation (RO I) disclos ures is in valid. ROI disclosur es will no t be proce ssed until the crede ntials are corrected ."; | |
| 109 | No tification Facade.sen dNotificat ion(Notifi cationType s.InvalidS erviceAcco untCredent ials, subj ect, messa ge); | |
| 110 | } | |
| 111 | currentCre dentialsSt ate = ROIP eriodicCom mandsCrede ntialsStat e.invalid; | |
| 112 | } | |
| 113 | else | |
| 114 | { | |
| 115 | currentCre dentialsSt ate = ROIP eriodicCom mandsCrede ntialsStat e.valid; | |
| 116 | if(config. isExpireCo mpletedIte msEnabled( )) | |
| 117 | { | |
| 118 | st ats.setRoi CompletedI temsPurgeP rocessing( true); | |
| 119 | lo gger.info( "Starting purgeCompl etedROIWor kItems per iodic comm and"); | |
| 120 | RO ICommandsC ontext.get ROIPeriodi cRouter(). purgeCompl etedROIWor kItems(); | |
| 121 | } | |
| 122 | else | |
| 123 | { | |
| 124 | lo gger.info( "purgeComp letedROIWo rkItems is disabled in configu ration fil e, purge w ill not be run."); | |
| 125 | st ats.setRoi CompletedI temsPurgeP rocessing( false); | |
| 126 | } | |
| 127 | if(config. isPeriodic ROIProcess ingEnabled ()) | |
| 128 | { | |
| 129 | st ats.setRoi PeriodicPr ocessing(t rue); | |
| 130 | st ats.setRoi PeriodicPr ocessingEr ror(null); | |
| 131 | lo gger.info( "Starting processROI PeriodicRe quests per iodic comm and"); | |
| 132 | RO ICommandsC ontext.get ROIPeriodi cRouter(). processROI PeriodicRe quests(); | |
| 133 | } | |
| 134 | else | |
| 135 | { | |
| 136 | lo gger.info( "processRO IPeriodicR equests is disabled in configu ration fil e, ROI wor k items wi ll not be processed periodical ly."); | |
| 137 | st ats.setRoi PeriodicPr ocessing(f alse); | |
| 138 | st ats.setRoi PeriodicPr ocessingEr ror("ROI P eriodic pr ocessing d isabled"); | |
| 139 | } | |
| 140 | } | |
| 141 | } | |
| 142 | finall y | |
| 143 | { | |
| 144 | Transact ionContext Factory.re storeTrans actionCont ext(mement o); | |
| 145 | } | |
| 146 | } | |
| 147 | else | |
| 148 | { | |
| 149 | logger .info("Nei ther proce ssROIPerio dicRequest s nor purg eCompleted ROIWorkIte ms is enab led, neith er will no t be run p eriodicall y."); | |
| 150 | stats. setRoiPeri odicProces sing(false ); | |
| 151 | stats. setRoiComp letedItems PurgeProce ssing(fals e); | |
| 152 | stats. setRoiPeri odicProces singError( "ROI Perio dic proces sing disab led"); | |
| 153 | curren tCredentia lsState = ROIPeriodi cCommandsC redentials State.unkn own; | |
| 154 | } | |
| 155 | } | |
| 156 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.