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

280.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingDicomRouter\main\src\java\gov\va\med\imaging\core\router\commands ProcessPortListeningCheckCommandImpl.java Mon Dec 4 21:35:24 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingDicomRouter\main\src\java\gov\va\med\imaging\core\router\commands ProcessPortListeningCheckCommandImpl.java Mon Dec 4 22:02:55 2017 UTC

280.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 282
Changed 2 4
Inserted 0 0
Removed 0 0

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

280.4 Active regular expressions

No regular expressions were active.

280.5 Comparison detail

  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: Sep  10, 2011
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
PETERB
  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.cor e.router.c ommands;
  27  
  28   import gov .va.med.im aging.core .annotatio ns.routerf acade.Rout erCommandE xecution;
  29   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  30   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  31   import gov .va.med.im aging.core .interface s.router.C ommand;
  32   import gov .va.med.im aging.core .router.Ab stractComm andImpl;
  33   import gov .va.med.im aging.dico m.common.s tats.Dicom ServiceSta ts;
  34   import gov .va.med.im aging.exch ange.busin ess.dicom. DicomServe rConfigura tion;
  35   import gov .va.med.im aging.exch ange.busin ess.dicom. Instrument Config;
  36  
  37   import jav a.io.IOExc eption;
  38   import jav a.net.Data gramSocket ;
  39   import jav a.net.Serv erSocket;
  40  
  41   import org .apache.lo gging.log4 j.LogManag er;
  42   import org .apache.lo gging.log4 j.Logger;
  43  
  44   /**
  45    * @author         
PETERB
  46    *
  47    */
  48   @RouterCom mandExecut ion(asynch ronous = t rue, distr ibutable =  false)
  49   public cla ss Process PortListen ingCheckCo mmandImpl  extends
  50                    Abst ractComman dImpl<Bool ean> {
  51  
  52           // private st atic final  long seri alVersionU ID = -5951 9801712926 87832L;
  53           pr ivate Logg er logger  = LogManag er
  54                             .getLo gger(Proce ssPortList eningCheck CommandImp l.class);
  55  
  56           /* *
  57            *  
  58            * /
  59           pu blic Proce ssPortList eningCheck CommandImp l() {
  60                    
  61           }
  62  
  63           /*  (non-Java doc)
  64            *  @see gov. va.med.ima ging.core. router.Abs tractComma ndImpl#cal lSynchrono uslyInTran sactionCon text()
  65            * /
  66           @O verride
  67           pu blic Boole an callSyn chronously InTransact ionContext ()
  68                             throws  MethodExc eption, Co nnectionEx ception {
  69                    
  70                    logg er.debug(T hread.curr entThread( ).getId()+ ": Executi ng Router  Command "+ this.getCl ass().getN ame());
  71                    
  72                    // F irst, loop  over all  the instru ments and  check the  listener o n each con figured po rt
  73                    for  (Instrumen tConfig in strument :  DicomServ erConfigur ation.getC onfigurati on().getIn struments( ))
  74                    {
  75                             checkL istener(in strument.g etPort());
  76                    }
  77                    
  78                    // F inally, al so check t he default  DICOM lis tener (que ry retriev e, etc)
  79                    chec kListener( DicomServe rConfigura tion.getCo nfiguratio n().getDic omListener Port());
  80                    
  81                    retu rn true;
  82           }
  83  
  84           pr ivate void  checkList ener(int l istenerPor t)
  85           {
  86                    Serv erSocket s s = null;
  87                Datagram Socket ds  = null;
  88                try {
  89                    ss =  new Serve rSocket(li stenerPort );
  90                    ss.s etReuseAdd ress(true) ;
  91                    ds =  new Datag ramSocket( listenerPo rt);
  92                    ds.s etReuseAdd ress(true) ;
  93                    logg er.debug(l istenerPor t+" checke d and is n ot listeni ng.");
  94                             DicomS erviceStat s.getInsta nce().setC urrentPort Status(lis tenerPort,  DicomServ iceStats.D OWN);
  95                }
  96                catch (I OException  e){
  97                    logg er.debug(l istenerPor t+" checke d and is l istening." );
  98                    Dico mServiceSt ats.getIns tance().se tCurrentPo rtStatus(l istenerPor t, DicomSe rviceStats .UP);
  99                }
  100                finally{
  101                    if ( ds != null ){
  102                         ds.close() ;
  103                    }
  104                    if ( ss != null ){
  105                         try{
  106                             ss.clo se();
  107                        
  108                         catch (IOE xception e ){
  109                             /* sho uld not be  thrown */
  110                         }
  111                    }
  112                }
  113  
  114           }
  115           /*  (non-Java doc)
  116            *  @see gov. va.med.ima ging.core. router.Abs tractComma ndImpl#get NewPeriodi cInstance( )
  117            * /
  118           @O verride
  119           pu blic Comma nd<Boolean > getNewPe riodicInst ance() thr ows Method Exception  {
  120                    Proc essPortLis teningChec kCommandIm pl command  = new Pro cessPortLi steningChe ckCommandI mpl();
  121                    comm and.setPer iodic(true );
  122                    comm and.setPer iodicExecu tionDelay( this.getPe riodicExec utionDelay ());
  123                    comm and.setCom mandContex t(this.get CommandCon text());
  124                    retu rn command ;
  125           }
  126  
  127           /*  (non-Java doc)
  128            *  @see gov. va.med.ima ging.core. router.Abs tractComma ndImpl#equ als(java.l ang.Object )
  129            * /
  130           @O verride
  131           pu blic boole an equals( Object obj ) {
  132                    retu rn false;
  133           }
  134  
  135           /*  (non-Java doc)
  136            *  @see gov. va.med.ima ging.core. router.Abs tractComma ndImpl#par ameterToSt ring()
  137            * /
  138           @O verride
  139           pr otected St ring param eterToStri ng() {
  140                    retu rn "";
  141           }
  142  
  143   }