Produced by Araxis Merge on 10/2/2017 7:00:08 AM 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 | cds.zip\cds\product\production\cdsinvocation\cds-invocation\src\test\java\com\cognitive\cds\invocation\engineplugins | OpenCDSMockEngineInstanceStateManager.java | Wed Jul 12 18:43:52 2017 UTC |
| 2 | cds.zip\cds\product\production\cdsinvocation\cds-invocation\src\test\java\com\cognitive\cds\invocation\engineplugins | OpenCDSMockEngineInstanceStateManager.java | Thu Sep 28 16:10:54 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 198 |
| Changed | 2 | 8 |
| 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 | * COPYRIG HT STATUS: © 2015, 2 016. This work, aut hored by C ognitive M edical Sys tems | |
| 3 | * employe es, was fu nded in wh ole or in part by Th e Departme nt of Vete rans | |
| 4 | * Affairs under U.S . Governme nt contrac t VA118-11 -D-1011 / VA118-1011 -0013. | |
| 5 | * The cop yright hol der agrees to post o r allow th e Governme nt to post all or | |
| 6 | * part of this work in open-s ource repo sitories s ubject to the Apache License, | |
| 7 | * Version 2.0, date d January 2004. All other righ ts are res erved by t he | |
| 8 | * copyrig ht owner. | |
| 9 | * | |
| 10 | * For use outside t he Governm ent, the f ollowing n otice appl ies: | |
| 11 | * | |
| 12 | * Cop yright 201 5 © Cognit ive Medica l Systems | |
| 13 | * | |
| 14 | * Lic ensed unde r the Apac he License , Version 2.0 (the " License"); you may | |
| 15 | * not use this file excep t in compl iance with the Licen se. You ma y obtain | |
| 16 | * a c opy of the License a t http://w ww.apache. org/licens es/LICENSE -2.0 | |
| 17 | * | |
| 18 | * Unl ess requir ed by appl icable law or agreed to in wri ting, soft ware | |
| 19 | * dis tributed u nder the L icense is distribute d on an "A S IS" BASI S, | |
| 20 | * WIT HOUT WARRA NTIES OR C ONDITIONS OF ANY KIN D, either express or implied. | |
| 21 | * See the Licen se for the specific language g overning p ermissions and | |
| 22 | * lim itations u nder the L icense. | |
| 23 | * | |
| 24 | */ | |
| 25 | package co m.cognitiv e.cds.invo cation.eng ineplugins ; | |
| 26 | ||
| 27 | import com .cognitive .cds.invoc ation.Engi neInstance StateManag ementIFace ; | |
| 28 | import com .cognitive .cds.invoc ation.mode l.EngineIn stanceStat e; | |
| 29 | import jav a.util.Arr ayList; | |
| 30 | import jav a.util.Lis t; | |
| 31 | import jav ax.annotat ion.PostCo nstruct; | |
| 32 | import org .springfra mework.ste reotype.Co mponent; | |
| 33 | ||
| 34 | /** | |
| 35 | * | |
| 36 | * @author jeremy | |
| 37 | */ | |
| 38 | @Component | |
| 39 | public cla ss OpenCDS MockEngine InstanceSt ateManager implement s EngineIn stanceStat eManagemen tIFace { | |
| 40 | ||
| 41 | pr ivate Arra yList<Engi neInstance State> ope nCDSEngine s = new Ar rayList<>( ); | |
| 42 | ||
| 43 | @O verride | |
| 44 | pu blic List< EngineInst anceState> getActive EngineInst ancesByTyp e(String t ype) { | |
| 45 | ||
| 46 | Arra yList<Engi neInstance State> toR eturn = ne w ArrayLis t<EngineIn stanceStat e>(); | |
| 47 | ||
| 48 | for (EngineIns tanceState eis : ope nCDSEngine s) { | |
| 49 | //retu rn only ac tive match es... | |
| 50 | if (ei s.getType( ).equalsIg noreCase(t ype) && ei s.getStatu s() == tru e) { | |
| 51 | toReturn .add(eis); | |
| 52 | } | |
| 53 | } | |
| 54 | Syst em.out.pri ntln("tota l eis reco rds: " + o penCDSEngi nes.size() | |
| 55 | + " - active eis records: " + toRetu rn.size()) ; | |
| 56 | ||
| 57 | retu rn toRetur n; | |
| 58 | ||
| 59 | } | |
| 60 | ||
| 61 | @P ostConstru ct | |
| 62 | pr ivate void init() { | |
| 63 | ||
| 64 | /** | |
| 65 | * p reloading this with both good and bad re cords, so that the c ode can fa il on one engine, ma rk it as | |
| 66 | * ' inactive' and then t ry again, etc. | |
| 67 | */ | |
| 68 | Engi neInstance State open CDS1 = new EngineIns tanceState (); | |
| 69 | open CDS1.setNa me("OpenCD S One"); | |
| 70 | open CDS1.setTy pe("OpenCD S"); | |
| 71 | open CDS1.setId ("oicu812" ); | |
| 72 | open CDS1.setSt atus(true) ; | |
| 73 | openCDS1.s etHost(" IP "); | |
| 74 | openCDS1.s etPort(" PORT "); | |
| 75 | ||
| 76 | open CDSEngines .add(openC DS1); | |
| 77 | ||
| 78 | Engi neInstance State open CDS2 = new EngineIns tanceState (); | |
| 79 | open CDS2.setNa me("OpenCD S Two"); | |
| 80 | open CDS2.setTy pe("OpenCD S"); | |
| 81 | open CDS2.setId ("c3p0"); | |
| 82 | open CDS2.setSt atus(true) ; | |
| 83 | openCDS2.s etHost(" IP "); //obvi ously a ba d one... | |
| 84 | openCDS2.s etPort(" PORT "); | |
| 85 | ||
| 86 | open CDSEngines .add(openC DS2); | |
| 87 | } | |
| 88 | ||
| 89 | @O verride | |
| 90 | pu blic boole an updateE ngineInsta nceState(E ngineInsta nceState u eis) { | |
| 91 | ||
| 92 | for (EngineIns tanceState eis : ope nCDSEngine s) { | |
| 93 | if (ei s.getName( ).equalsIg noreCase(u eis.getNam e()) | |
| 94 | && eis.g etType().e qualsIgnor eCase(ueis .getType() ) | |
| 95 | && eis.g etHost().e qualsIgnor eCase(ueis .getHost() ) | |
| 96 | && eis.g etPort().e qualsIgnor eCase(ueis .getPort() )) { | |
| 97 | eis.setS tatus(fals e); | |
| 98 | } | |
| 99 | } | |
| 100 | retu rn true; | |
| 101 | } | |
| 102 | ||
| 103 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.