410. EPMO Open Source Coordination Office Redaction File Detail Report

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

410.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCacheWebApp\main\src\gov\va\med\imaging\cache CacheSemantics.java Mon Dec 4 21:34:28 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCacheWebApp\main\src\gov\va\med\imaging\cache CacheSemantics.java Mon Dec 4 22:07:18 2017 UTC

410.2 Comparison summary

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

410.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

410.4 Active regular expressions

No regular expressions were active.

410.5 Comparison detail

  1   package go v.va.med.i maging.cac he;
  2  
  3   import jav a.util.Enu meration;
  4   import jav a.util.Has hMap;
  5   import jav a.util.Map ;
  6   import jav a.util.Res ourceBundl e;
  7  
  8   import org .apache.lo gging.log4 j.LogManag er;
  9   import org .apache.lo gging.log4 j.Logger;
  10  
  11   /**
  12    * 
  13    * @author         
BECKEC
  14    *
  15    */
  16   public cla ss CacheSe mantics 
  17   {
  18           pr ivate stat ic final S tring INST ANCE = "in stance";
  19           pr ivate stat ic final S tring GROU PS = "grou ps";
  20           pr ivate stat ic final S tring DEFA ULT_CACHE_ NAME = "de fault";
  21           pr ivate stat ic final S tring DEFA ULT_REGION _NAME = "d efault";
  22           
  23           pr ivate stat ic Resourc eBundle rb Semantics;
  24           pr ivate stat ic Map<Cac heSemantic s.GroupSem anticKey,  String> gr oupSemanti cs = 
  25                    new  HashMap<Ca cheSemanti cs.GroupSe manticKey,  String>() ;
  26           pr ivate stat ic Map<Cac heSemantic s.Instance SemanticKe y, String>  instanceS emantics =  
  27                    new  HashMap<Ca cheSemanti cs.Instanc eSemanticK ey, String >();
  28           pr ivate stat ic Logger  logger = L ogManager. getLogger( CacheSeman tics.class );
  29           
  30           st atic
  31           {
  32                    rbSe mantics =  ResourceBu ndle.getBu ndle("gov. va.med.ima ging.cache .CacheSema ntics");
  33                    
  34                    // t he keys MU ST be in t he form 
  35                    // < cache name >.<region  name>.grou ps
  36                    // -  or -
  37                    // < cache name >.<region  name>.inst ance
  38                    for( Enumeratio n<String>  keyEnum =  rbSemantic s.getKeys( ); keyEnum .hasMoreEl ements();  )
  39                    {
  40                             String  key = key Enum.nextE lement();
  41                             String [] keyElem ents = key .split("\\ x2e");                // split o n period ' .'
  42                             if(key Elements.l ength != 3 )
  43                             {
  44                                      logger.e rror(
  45                                               "The Cache Semantics  properties  file cont ains an in valid key  '" 
  46                                               + key 
  47                                               + "'.  Key s MUST be  in the for m <cache n ame>.<regi on name>.g roups -or-  <cache na me>.<regio n name>.in stance .") ;
  48                                      continue ;
  49                             }
  50                             
  51                             String  cacheName  = keyElem ents[0];
  52                             String  regionNam e = keyEle ments[1];
  53                             boolea n isGroups  = GROUPS. equalsIgno reCase( ke yElements[ 2] );
  54                             boolea n isInstan ce = INSTA NCE.equals IgnoreCase ( keyEleme nts[2] );
  55                             String  value = r bSemantics .getString (key);
  56                             
  57                             if(isG roups && v alue != nu ll)
  58                             {
  59                                      String[]  groupName s = rbSema ntics.getS tring(key) .split("," );
  60                                      for(int  groupIndex =0; groupI ndex < gro upNames.le ngth; ++gr oupIndex)
  61                                               groupSeman tics.put(n ew GroupSe manticKey( cacheName,  regionNam e, groupIn dex), grou pNames[gro upIndex].t rim());
  62                             }
  63                             else i f(isInstan ce && valu e != null)
  64                             {
  65                                      instance Semantics. put(new In stanceSema nticKey(ca cheName, r egionName) , value);
  66                             }
  67                             else
  68                                      logger.e rror(
  69                                               "The Cache Semantics  properties  file cont ains an in valid key  '" 
  70                                               + key 
  71                                               + "'.  Key s MUST be  in the for m <cache n ame>.<regi on name>.g roups -or-  <cache na me>.<regio n name>.in stance .") ;
  72                                      
  73                    }
  74           }
  75  
  76           /* *
  77            *  
  78            *  @param ca cheName
  79            *  @param re gionName
  80            *  @param gr oupLevel
  81            *  @return
  82            * /
  83           pu blic stati c String g etGroupSem anticType( String cac heName, St ring regio nName, int  groupLeve l)
  84           {
  85                    Grou pSemanticK ey key = n ew GroupSe manticKey( cacheName,  regionNam e, groupLe vel);
  86                    Stri ng semanti cType = gr oupSemanti cs.get(key );
  87                    logg er.debug(k ey.toStrin g() + "=>"  + semanti cType);
  88                    retu rn semanti cType == n ull ? 
  89                             groupS emantics.g et(new Gro upSemantic Key(DEFAUL T_CACHE_NA ME, DEFAUL T_REGION_N AME, group Level)) : 
  90                             semant icType;
  91           }
  92           
  93           /* *
  94            *  
  95            *  @param ca cheName
  96            *  @param re gionName
  97            *  @return
  98            * /
  99           pu blic stati c String g etInstance SemanticTy pe(String  cacheName,  String re gionName)
  100           {
  101                    Inst anceSemant icKey key  = new Inst anceSemant icKey(cach eName, reg ionName);
  102                    Stri ng semanti cType = in stanceSema ntics.get( key);
  103                    logg er.debug(k ey.toStrin g() + "=>"  + semanti cType);
  104                    retu rn semanti cType == n ull ? 
  105                             instan ceSemantic s.get(new  InstanceSe manticKey( DEFAULT_CA CHE_NAME,  DEFAULT_RE GION_NAME) ) : 
  106                             semant icType;
  107           }
  108  
  109           pr ivate stat ic class G roupSemant icKey
  110           {
  111                    priv ate final  String cac heName;
  112                    priv ate final  String reg ionName;
  113                    priv ate final  int groupL evel;
  114                    
  115                    publ ic GroupSe manticKey( String cac heName, St ring regio nName,
  116                                      int grou pLevel) {
  117                             super( );
  118                             this.c acheName =  cacheName ;
  119                             this.r egionName  = regionNa me;
  120                             this.g roupLevel  = groupLev el;
  121                    }
  122                    
  123                    @Ove rride
  124                    publ ic int has hCode() {
  125                             final  int prime  = 31;
  126                             int re sult = 1;
  127                             result  = prime *  result
  128                                               + ((cacheN ame == nul l) ? 0 : c acheName.h ashCode()) ;
  129                             result  = prime *  result +  groupLevel ;
  130                             result  = prime *  result
  131                                               + ((region Name == nu ll) ? 0 :  regionName .hashCode( ));
  132                             return  result;
  133                    }
  134                    @Ove rride
  135                    publ ic boolean  equals(Ob ject obj)  {
  136                             if (th is == obj)
  137                                      return t rue;
  138                             if (ob j == null)
  139                                      return f alse;
  140                             if (ge tClass() ! = obj.getC lass())
  141                                      return f alse;
  142                             GroupS emanticKey  other = ( GroupSeman ticKey) ob j;
  143                             if (ca cheName ==  null) {
  144                                      if (othe r.cacheNam e != null)
  145                                               return fal se;
  146                             } else  if (!cach eName.equa lsIgnoreCa se(other.c acheName))
  147                                      return f alse;
  148                             if (gr oupLevel ! = other.gr oupLevel)
  149                                      return f alse;
  150                             if (re gionName = = null) {
  151                                      if (othe r.regionNa me != null )
  152                                               return fal se;
  153                             } else  if (!regi onName.equ alsIgnoreC ase(other. regionName ))
  154                                      return f alse;
  155                             return  true;
  156                    }
  157                    
  158  
  159                    @Ove rride
  160                    publ ic String  toString()  
  161                    {
  162                             return  this.getC lass().get SimpleName () + "." +  cacheName  + "." + r egionName  + "." + In teger.toSt ring(group Level);
  163                    }
  164           }
  165           
  166           pr ivate stat ic class I nstanceSem anticKey
  167           {
  168                    priv ate final  String cac heName;
  169                    priv ate final  String reg ionName;
  170                    
  171                    publ ic Instanc eSemanticK ey(String  cacheName,  String re gionName)  {
  172                             super( );
  173                             this.c acheName =  cacheName ;
  174                             this.r egionName  = regionNa me;
  175                    }
  176                    
  177                    @Ove rride
  178                    publ ic int has hCode() {
  179                             final  int prime  = 31;
  180                             int re sult = 1;
  181                             result  = prime *  result
  182                                               + ((cacheN ame == nul l) ? 0 : c acheName.h ashCode()) ;
  183                             result  = prime *  result
  184                                               + ((region Name == nu ll) ? 0 :  regionName .hashCode( ));
  185                             return  result;
  186                    }
  187                    @Ove rride
  188                    publ ic boolean  equals(Ob ject obj)  {
  189                             if (th is == obj)
  190                                      return t rue;
  191                             if (ob j == null)
  192                                      return f alse;
  193                             if (ge tClass() ! = obj.getC lass())
  194                                      return f alse;
  195                             Instan ceSemantic Key other  = (Instanc eSemanticK ey) obj;
  196                             if (ca cheName ==  null) {
  197                                      if (othe r.cacheNam e != null)
  198                                               return fal se;
  199                             } else  if (!cach eName.equa lsIgnoreCa se(other.c acheName))
  200                                      return f alse;
  201                             if (re gionName = = null) {
  202                                      if (othe r.regionNa me != null )
  203                                               return fal se;
  204                             } else  if (!regi onName.equ alsIgnoreC ase(other. regionName ))
  205                                      return f alse;
  206                             return  true;
  207                    }
  208  
  209                    @Ove rride
  210                    publ ic String  toString()  
  211                    {
  212                             return  this.getC lass().get SimpleName () + "." +  cacheName  + "." + r egionName;
  213                    }
  214           }
  215   }