Produced by Araxis Merge on 12/5/2017 12:06:37 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\CoreRouter\main\src\java\gov\va\med\imaging\exchange\configuration\utility | AppConfigurationUtility.java | Mon Dec 4 21:35:16 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CoreRouter\main\src\java\gov\va\med\imaging\exchange\configuration\utility | AppConfigurationUtility.java | Mon Dec 4 21:58:36 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 264 |
| 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: Jul 12, 2007 | |
| 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.exc hange.conf iguration. utility; | |
| 27 | ||
| 28 | import jav a.net.URI; | |
| 29 | import jav a.net.URIS yntaxExcep tion; | |
| 30 | import jav a.util.Has hMap; | |
| 31 | ||
| 32 | import org .apache.lo gging.log4 j.LogManag er; | |
| 33 | import org .apache.lo gging.log4 j.Logger; | |
| 34 | ||
| 35 | import gov .va.med.im aging.core .interface s.exceptio ns.Applica tionConfig urationExc eption; | |
| 36 | import gov .va.med.im aging.exch ange.confi guration.A ppConfigur ation; | |
| 37 | ||
| 38 | /** | |
| 39 | * @author
|
|
| 40 | * Command line supp ort for in itializing and persi sting an A ppConfigur ation obje ct. | |
| 41 | * Used by the ViX I nstaller. | |
| 42 | */ | |
| 43 | public cla ss AppConf igurationU tility | |
| 44 | { | |
| 45 | // define th e command line | |
| 46 | pr ivate stat ic final S tring LOCA L_SITE_NUM BER = "Loc alSiteNumb er"; | |
| 47 | pr ivate stat ic final S tring SMTP _SERVER_UR I = "SmtpS erverUri"; | |
| 48 | pr ivate stat ic final S tring VIX_ SOFTWARE_V ERSION = " VixSoftwar eVersion"; | |
| 49 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(AppC onfigurati onUtility. class); | |
| 50 | ||
| 51 | /* * | |
| 52 | * @param ar gs | |
| 53 | * / | |
| 54 | pu blic stati c void mai n(String[] args) | |
| 55 | { | |
| 56 | Hash Map<String , String> configPara meters = p arseComman dLine(args ); | |
| 57 | bool ean paramE rror = fal se; | |
| 58 | Stri ng localSi teNumber = null; | |
| 59 | Stri ng smtpSer verUri = n ull; | |
| 60 | Stri ng vixSoft wareVersio n = null; | |
| 61 | ||
| 62 | loca lSiteNumbe r = config Parameters .get(LOCAL _SITE_NUMB ER); | |
| 63 | if ( localSiteN umber == n ull) | |
| 64 | { | |
| 65 | System .err.print ln("Missin g required command l ine parame ter : " + LOCAL_SITE _NUMBER); | |
| 66 | paramE rror = tru e; | |
| 67 | } | |
| 68 | smtp ServerUri = configPa rameters.g et(SMTP_SE RVER_URI); | |
| 69 | if ( smtpServer Uri == nul l) | |
| 70 | { | |
| 71 | System .err.print ln("Missin g required command l ine parame ter : " + SMTP_SERVE R_URI); | |
| 72 | paramE rror = tru e; | |
| 73 | } | |
| 74 | vixS oftwareVer sion = con figParamet ers.get(VI X_SOFTWARE _VERSION); | |
| 75 | if ( vixSoftwar eVersion = = null) | |
| 76 | { | |
| 77 | System .err.print ln("Missin g required command l ine parame ter : " + VIX_SOFTWA RE_VERSION ); | |
| 78 | paramE rror = tru e; | |
| 79 | } | |
| 80 | ||
| 81 | // e xit if we are missin g any requ ired param eters | |
| 82 | if ( paramError ) | |
| 83 | { | |
| 84 | System .exit(-1); | |
| 85 | } | |
| 86 | ||
| 87 | AppC onfigurati on appConf ig = new A ppConfigur ation(); | |
| 88 | try | |
| 89 | { | |
| 90 | appCon fig.init() ; | |
| 91 | appCon fig.setLoc alSiteNumb er(localSi teNumber); | |
| 92 | appCon fig.setSmt pServerUri (new URI(s mtpServerU ri)); | |
| 93 | appCon fig.setVix SoftwareVe rsion(vixS oftwareVer sion); | |
| 94 | appCon fig.setCac hingEnable d(true); / / caching enabled by default | |
| 95 | if (!a ppConfig.s aveAppConf igurationT oFile()) | |
| 96 | { | |
| 97 | System.e rr.println ("Error: c ould not w rite the c onfigurati on file.") ; | |
| 98 | System.e xit(-1); | |
| 99 | } | |
| 100 | logger .info("ViX configura tion file written to : " + appC onfig.getA ppConfigur ationFiles pec()); | |
| 101 | } | |
| 102 | catc h (Applica tionConfig urationExc eption ex) | |
| 103 | { | |
| 104 | System .err.print ln(ex.getM essage()); | |
| 105 | System .exit(-1); | |
| 106 | } | |
| 107 | catc h (URISynt axExceptio n ex) | |
| 108 | { | |
| 109 | System .err.print ln(ex.getM essage()); | |
| 110 | System .exit(-1); | |
| 111 | } | |
| 112 | ||
| 113 | Syst em.exit(0) ; | |
| 114 | } | |
| 115 | ||
| 116 | pr ivate stat ic HashMap <String, S tring> par seCommandL ine(String [] args) | |
| 117 | { | |
| 118 | Hash Map<String , String> configPara meters = n ew HashMap <String, S tring>(); | |
| 119 | ||
| 120 | for (int i=0 ; i < args. length ; i ++) | |
| 121 | { | |
| 122 | String [] nameVal ue = args[ i].split(" ="); | |
| 123 | if (na meValue.le ngth != 2) | |
| 124 | { | |
| 125 | System.e rr.println ("Command line param eter is no t in the f orm key=va lue: " + a rgs[i]); | |
| 126 | System.e xit(-1); | |
| 127 | } | |
| 128 | config Parameters .put(nameV alue[0], n ameValue[1 ]); | |
| 129 | } | |
| 130 | ||
| 131 | retu rn configP arameters; | |
| 132 | } | |
| 133 | ||
| 134 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.