289. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:45 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.

289.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingExchangeBaseWebProxy\main\src\java\gov\va\med\imaging\proxy AbstractRequestParameters.java Mon Dec 4 21:34:34 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingExchangeBaseWebProxy\main\src\java\gov\va\med\imaging\proxy AbstractRequestParameters.java Mon Dec 4 22:03:13 2017 UTC

289.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 388
Changed 1 2
Inserted 0 0
Removed 0 0

289.3 Comparison options

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

289.4 Active regular expressions

No regular expressions were active.

289.5 Comparison detail

  1   /**
  2    * 
  3    */
  4   package go v.va.med.i maging.pro xy;
  5  
  6   import jav a.text.Dat eFormat;
  7   import jav a.text.Par seExceptio n;
  8   import jav a.text.Sim pleDateFor mat;
  9   import jav a.util.Dat e;
  10   import jav a.util.Has hMap;
  11   import jav a.util.Map ;
  12  
  13   import org .apache.lo gging.log4 j.LogManag er;
  14   import org .apache.lo gging.log4 j.Logger;
  15  
  16   /**
  17    * @author         
BECKEC
  18    * 
  19    * The sup erclass of  request p arameters,  those thi ngs that s erve to en capsulate  the
  20    * paramet ers to a p roxy reque st.
  21    */
  22   public abs tract clas s Abstract RequestPar ameters
  23   implements  java.io.S erializabl e
  24   {
  25           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  26           //  Request m etadata pr operties.
  27           //  These are  usually n ot used in  the actua l invocati on and res ulting res ponse.
  28           //  The key v alues shou ld use the  Transacti onProperty Name enume ration for  
  29           //  "well-kno wn" proper ties.
  30           pr ivate Map< String, St ring> prop erties = n ew HashMap <String,St ring>();
  31           
  32           //  an intern al date fo rmat used  only for c onverting  dates to/f rom 
  33           //  a String  format in  the proper ties map
  34           pr ivate Date Format dat eFormat =  new Simple DateFormat ("yyyyMMdd :hh:mm:ss. SSSSZ");
  35           
  36           /* *
  37            *  Create a  RequestPar ameters in stance wit h no
  38            *  additiona l properti es and a u nique tran saction ID .
  39            * /
  40           pu blic Abstr actRequest Parameters ()
  41           {
  42                    this (null);
  43           }
  44           
  45           /* *
  46            *  Create a  RequestPar ameters in stance
  47            *  
  48            *  @param pr operties -  if not nu ll then th e map will  be copied  to this i nstance pr operties
  49            * /
  50           pu blic Abstr actRequest Parameters (Map<Strin g, String>  propertie s)
  51           {
  52                    this (null, nul l, propert ies);
  53           }
  54  
  55           /* *
  56            *  
  57            *  @param re ferenceTra nsactionId entifier
  58            *  @param pr operties
  59            * /
  60           pu blic Abstr actRequest Parameters (String re ferenceTra nsactionId entifier,  Map<String , String>  properties )
  61           {
  62                    this (null, nul l, propert ies);
  63           }
  64           
  65           pu blic Abstr actRequest Parameters (
  66                             String  reference Transactio nIdentifie r,
  67                             Date r equiredRes ponseDate,
  68                             Map<St ring, Stri ng> proper ties)
  69           {
  70                    supe r();
  71                    
  72                    if(  referenceT ransaction Identifier  != null )
  73                             this.p roperties. put( Reque stProperty Name.Refer enceTransa ctionId.to String(),  referenceT ransaction Identifier  );
  74  
  75                    // p roperties  must be st rings, so  put a Stri ng represe ntation of  the requi red date
  76                    // i f no requi red respon se date is  specified  then assu me immedia te respons e is requi red
  77                    this .propertie s.put( 
  78                             Reques tPropertyN ame.Requir edResponse Date.toStr ing(), 
  79                             requir edResponse Date != nu ll ?
  80                                      dateForm at.format( requiredRe sponseDate ) :
  81                                      dateForm at.format( new Date() )
  82                    );
  83  
  84                    // d on't use p utAll beca use there  may be pro perties th at overwri te the
  85                    // k nown prope rties, whi ch may not  be mutabl e
  86                    if(p roperties  != null)
  87                    {
  88                             for(St ring key :  propertie s.keySet() )
  89                                      putPrope rty( key,  properties .get(key)  );
  90                    }
  91           }
  92           
  93           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  94           //  Well know n property  getters a nd setters
  95           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  96           
  97           pu blic Strin g getRefer enceTransa ctionIdent ifier()
  98           {
  99                    retu rn propert ies.get(Re questPrope rtyName.Re ferenceTra nsactionId .toString( ));
  100           }
  101           pu blic void  setReferen ceTransact ionIdentif ier(String  value)
  102           {
  103                    prop erties.put (RequestPr opertyName .Reference Transactio nId.toStri ng(), valu e);
  104           }
  105  
  106           pu blic Date  getRequire dResponseD ate()
  107           {
  108                    try
  109                    {
  110                             return  dateForma t.parse( p roperties. get(Reques tPropertyN ame.Requir edResponse Date.toStr ing()) );
  111                    } 
  112                    catc h (ParseEx ception x)
  113                    {
  114                             logger .error(x);
  115                             return  new Date( );
  116                    }
  117           }
  118           
  119           /* *
  120            *  Sets the  required r esponse da te to the  current da te
  121            * /
  122           pr ivate void  resetRequ iredRespon seDate()
  123           {
  124                    this .propertie s.put( 
  125                             Reques tPropertyN ame.Requir edResponse Date.toStr ing(), 
  126                             dateFo rmat.forma t(new Date ())
  127                    );
  128           }
  129           
  130           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  131           //  Generic P arameter p ut and get
  132           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  133  
  134           /* *
  135            *  Put an ad ditional p roperty th at may be  needed by  the asynch  listeners
  136            *  These are  not used  in the act ual invoca tion and r esulting r esponse.
  137            * /
  138           pu blic void  putPropert y(String k ey, String  value)
  139           {
  140                    Requ estPropert yName well KnownName  = RequestP ropertyNam e.valueOf( key);
  141                    if(w ellKnownNa me != null )
  142                    {
  143                             if(wel lKnownName .isMutable () || getP roperty(ke y) == null  )
  144                                      properti es.put(key , value);
  145                             else
  146                                      logger.w arn("Attem pt to set  immutable  property ' " + key +  "' is bein g ignored" );
  147                    }
  148                    else              // a use r defined  property,  we don't e nforse its  immutabil ity
  149                             this.p roperties. put(key, v alue);
  150           }
  151           
  152           /* *
  153            *  Get an ad ditional p roperty th at may hav e been add ed by the  caller.
  154            *  These are  not used  in the act ual invoca tion and r esulting r esponse.
  155            * /
  156           pu blic Strin g getPrope rty(String  key)
  157           {
  158                    retu rn this.pr operties.g et(key);
  159           }
  160           
  161           pu blic Map<S tring,Stri ng> getPro perties()
  162           {
  163                    retu rn this.pr operties;
  164           }
  165  
  166           /* *
  167            *  This sett er is here  only for  use by XML  encoder/d ecoder.
  168            *  DO NOT US E IT for o ther code  else you w ill be hun g, drawn,
  169            *  quartered , publicly  flogged a nd humilia ted.  Then  you'll ha ve
  170            *  to fix th e resultin g bugs.
  171            *  
  172            *  @param pr operties
  173            * /
  174           pu blic void  setPropert ies(Map<St ring,Strin g> propert ies)
  175           {
  176                    this .propertie s = proper ties;
  177           }
  178  
  179           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  180           //  Object Ov errides
  181           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== =========
  182           
  183           /* *
  184            *  The hashC ode() meth od must be  implement ed for der ived class es for the  client's  results re corder to
  185            *  work corr ectly.
  186            * /
  187           @O verride
  188           pu blic int h ashCode()
  189           {
  190                    fina l int PRIM E = 31;
  191                    int  result = 1 ;
  192                    resu lt = PRIME  * result  + ((this.p roperties  == null) ?  0 : this. properties .hashCode( ));
  193                    retu rn result;
  194           }
  195   }