Produced by Araxis Merge on 12/13/2018 10:35:31 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 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\service\transaction | TransactionTimestampManager.java | Fri Dec 7 17:36:38 2018 UTC |
| 2 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\service\transaction | TransactionTimestampManager.java | Wed Dec 12 22:26:42 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 202 |
| 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 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrii ght 2005 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | ||
| 5 | package go v.va.med.f w.service. transactio n; | |
| 6 | ||
| 7 | import jav a.sql.Time stamp; | |
| 8 | import jav a.util.Dat e; | |
| 9 | ||
| 10 | import org .apache.co mmons.lang .Validate; | |
| 11 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 12 | import org .springfra mework.ste reotype.Co mponent; | |
| 13 | ||
| 14 | import gov .va.med.cc ht.persist ent.Timest ampDAO; | |
| 15 | import gov .va.med.fw .cache.Tra nsactionTi mestampCac heManager; | |
| 16 | import gov .va.med.fw .service.A bstractCom ponent; | |
| 17 | ||
| 18 | /** | |
| 19 | * Manages the creat ion and st orage of t he "global Transacti on timesta mp". The | |
| 20 | * "global Transacti on timesta mp" is mea nt to sync hronize al l database flushes | |
| 21 | * in the same Trans action suc h that the y all use the same e vent date. Typically | |
| 22 | * this ti mestamp wi ll be crea ted and ca ched when the Transa ction is s tarted by | |
| 23 | * the Tra nsactionSy nchronizat ionInitial izer class . | |
| 24 | * | |
| 25 | * Timesta mp retriev al is eith er from th e database (if they | |
| 26 | * Current TimestampA ction is i njected) o r from the applicati on server (no | |
| 27 | * Current TimestampA ction inje ction). | |
| 28 | * | |
| 29 | * Created Nov 3, 20 05 2:59:33 PM | |
| 30 | * | |
| 31 | * DNS | |
| 32 | * | |
| 33 | * @see go v.va.med.f w.service. transactio n.Transact ionSynchro nizationIn itializer | |
| 34 | */ | |
| 35 | @Component | |
| 36 | public cla ss Transac tionTimest ampManager extends A bstractCom ponent { | |
| 37 | ||
| 38 | @A utowired | |
| 39 | pr ivate Tran sactionTim estampCach eManager t imestampCa cheManager ; | |
| 40 | @A utowired | |
| 41 | pr ivate Time stampDAO t imestampDA O; | |
| 42 | ||
| 43 | pu blic Times tamp intia lizeTransa ctionTimes tamp(boole an forceOv erride) { | |
| 44 | if ( timestampC acheManage r.hasTimes tamp() && forceOverr ide) | |
| 45 | timest ampCacheMa nager.remo veTimestam p(); | |
| 46 | ||
| 47 | Time stamp ts = createNew Transactio nTimestamp (); | |
| 48 | time stampCache Manager.st oreTransac tionTimest amp(ts); | |
| 49 | retu rn ts; | |
| 50 | } | |
| 51 | ||
| 52 | /* * | |
| 53 | * If called in a scen ario that does not h ave a Time stamp alre ady create d, | |
| 54 | * one will be created but not s tored. The refore, su bsequent c alls in th at | |
| 55 | * non-Trans actional c ontext wil l return a different timestamp every tim e. | |
| 56 | * | |
| 57 | * @return | |
| 58 | * / | |
| 59 | pu blic Times tamp getTr ansactionT imestamp() { | |
| 60 | Time stamp ts = timestamp CacheManag er.getTran sactionTim estamp(); | |
| 61 | if ( ts == null ) { | |
| 62 | logger | |
| 63 | .debug("Th ere is no Timestamp tied to th e current (if any) T ransaction . Creating new one") ; | |
| 64 | // cre ate an unb ound ts | |
| 65 | ts = c reateNewTr ansactionT imestamp() ; | |
| 66 | } | |
| 67 | retu rn ts; | |
| 68 | } | |
| 69 | ||
| 70 | pr ivate Time stamp crea teNewTrans actionTime stamp() { | |
| 71 | Time stamp ts = null; | |
| 72 | if ( timestampD AO != null ) { | |
| 73 | return timestamp DAO.getCur rentTimest ampFromDat abase(); | |
| 74 | } el se { | |
| 75 | ts = n ew Timesta mp(System. currentTim eMillis()) ; | |
| 76 | if (lo gger.isDeb ugEnabled( )) | |
| 77 | logger.d ebug("###I nitialized ts (from JVM) at JV M time [" + new Date () | |
| 78 | + "]: using jvm ts [" + ts + "]" ); | |
| 79 | } | |
| 80 | retu rn ts; | |
| 81 | } | |
| 82 | ||
| 83 | /* * | |
| 84 | * @return R eturns the timestamp CacheManag er. | |
| 85 | * / | |
| 86 | pu blic Trans actionTime stampCache Manager ge tTimestamp CacheManag er() { | |
| 87 | retu rn timesta mpCacheMan ager; | |
| 88 | } | |
| 89 | ||
| 90 | /* * | |
| 91 | * @param ti mestampCac heManager | |
| 92 | * The time stampCache Manager to set. | |
| 93 | * / | |
| 94 | pu blic void setTimesta mpCacheMan ager(Trans actionTime stampCache Manager ti mestampCac heManager) { | |
| 95 | this .timestamp CacheManag er = times tampCacheM anager; | |
| 96 | } | |
| 97 | ||
| 98 | pu blic void afterPrope rtiesSet() { | |
| 99 | Vali date.notNu ll(timesta mpCacheMan ager); | |
| 100 | Vali date.notNu ll(timesta mpDAO); | |
| 101 | } | |
| 102 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.