157. EPMO Open Source Coordination Office Redaction File Detail Report

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

157.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DxDataSourceProvider\main\src\java\gov\va\med\imaging\dx\datasource\configuration DxDataSourceConfiguration.java Mon Dec 4 21:35:24 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DxDataSourceProvider\main\src\java\gov\va\med\imaging\dx\datasource\configuration DxDataSourceConfiguration.java Tue Dec 5 12:45:02 2017 UTC

157.2 Comparison summary

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

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

157.4 Active regular expressions

No regular expressions were active.

157.5 Comparison detail

  1   /**
  2     Package:  MAG - Vis tA Imaging
  3     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  4     Date Cre ated: Apr  4, 2017
  5     Develope r:  vhaisl tjahjb
  6     Descript ion: 
  7  
  8           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  9           ;;  Property  of the US  Government .
  10           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  11           ;;  Use of un released v ersions of  this soft ware requi res the us er
  12           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  13           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  14           ;;   telephon e (301) 73 4-0100.
  15           ;;
  16           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  17           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  18           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  19           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  20           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  21           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  22  
  23    */
  24   package go v.va.med.i maging.dx. datasource .configura tion;
  25  
  26   import gov .va.med.OI D;
  27   import gov .va.med.Ro utingToken ;
  28   import gov .va.med.Ro utingToken Impl;
  29   import gov .va.med.ex ceptions.R outingToke nFormatExc eption;
  30   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  31   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rceImpl;
  32   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  33   import gov .va.med.im aging.dx.d atasource. DxDocument SetDataSou rceService ;
  34   import gov .va.med.im aging.dx.r est.endpoi nts.DxDesP roxyAdapte rRestUri;
  35  
  36   import jav a.io.Seria lizable;
  37   import jav a.net.Malf ormedURLEx ception;
  38   import jav a.net.URL;
  39   import jav a.util.Arr ayList;
  40   import jav a.util.Lis t;
  41   import jav a.util.Sor tedSet;
  42   import jav a.util.Tre eSet;
  43   import org .apache.lo gging.log4 j.LogManag er;
  44   import org .apache.lo gging.log4 j.Logger;
  45  
  46   /**
  47    * @author  vhaisltja hjb
  48    *
  49    */
  50   public cla ss DxDataS ourceConfi guration
  51   implements  Serializa ble
  52   {
  53           pr ivate stat ic final l ong serial VersionUID  = -781488 6817785999 850L;
  54           
  55           pu blic final  static St ring defau ltKeystore Alias = "d x";
  56           pu blic final  static St ring defau ltKeystore Url = "fil e:///c:/Vi xCertStore /cvix.jks" ;
  57           pu blic final  static St ring defau ltTruststo reUrl = "f ile:///c:/ VixCertSto re/das.tru ststore";
  58           pu blic final  static St ring defau ltTLSProto col = "dxs ";
  59           pu blic final  static in t defaultT LSPort =  PORT ;
  60           
  61           pu blic final  static in t defaultQ ueryTimeou t = 50000;
  62           pu blic final  static in t defaultR etrieveTim eout = 120 000;
  63           pu blic final  static in t defaultD elayPeriod  = 2000;
  64  
  65           pu blic final  static St ring defau ltDasProto col = "dxs ";
  66           pu blic final  static St ring defau ltDasHost  = "das-tes t. DNS     "; //For t esting pur poses
  67           pu blic final  static in t defaultD asPort = - 1;
  68           pu blic final  static St ring defau ltRequestS ource = "V ADAS";
  69           pu blic final  static St ring defau ltLoinc =  "34794-8";
  70           pu blic final  static St ring defau ltProvider  = "123";
  71           pu blic final  static St ring defau ltDesHomeC ommunityId  = "2.16.8 40.1.11388 3.3.42.100 01.100001. 1000";
  72           pu blic final  static St ring defau ltAccessib leIpAddres s = "127.0 .0.1";
  73           
  74           pr ivate Sort edSet<DxSi teConfigur ation> art ifactSourc eConfigura tions = 
  75                             new Tr eeSet<DxSi teConfigur ation>(new  DxSiteCon figuration Comparator ()); 
  76           pr ivate bool ean useCer tificate =  false;
  77           
  78           // private TL SConfigura tion tlsCo nfiguratio n;
  79           // private Dx DataSource ProxyConfi guration p roxyConfig uration;
  80           
  81           pr ivate tran sient Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  82           pr ivate Inte ger queryT imeout;
  83           pr ivate Inte ger retrie veTimeout;
  84           pr ivate Stri ng desServ ice;
  85           pr ivate Stri ng desVers ion;
  86           pr ivate Stri ng desServ iceVersion ;
  87           pr ivate Stri ng desRequ estSource;
  88           pr ivate Stri ng desLoin c;
  89           pr ivate Stri ng desProv ider;
  90           pr ivate Stri ng desHome CommunityI d;
  91           
  92           pr ivate Inte ger delayP eriod;
  93  
  94           pr ivate Stri ng dasProt ocol;
  95           pr ivate Stri ng dasHost ;
  96           pr ivate int  dasPort;
  97  
  98           pr ivate Bool ean allowP artialSucc ess;
  99           pr ivate Stri ng keystor eAlias;
  100           pr ivate Stri ng keystor eUrl;
  101           pr ivate Stri ng keystor ePassword;
  102           pr ivate Stri ng trustst oreUrl;
  103           pr ivate Stri ng trustst orePasswor d;
  104           pr ivate Stri ng tlsProt ocol;
  105           pr ivate int  tlsPort;
  106           pr ivate Stri ng accessi bleIpAddre ss;
  107           pr ivate Stri ng alexdel argePasswo rd;
  108  
  109           
  110           /* *
  111            *  Create a  configurat ion with t he minimum  default v alues
  112            *  @return
  113            *  @throws M alformedUR LException
  114            * /
  115           pu blic stati c DxDataSo urceConfig uration cr eate()
  116           th rows Malfo rmedURLExc eption 
  117           {
  118                    retu rn new DxD ataSourceC onfigurati on(
  119                              null, null , null, nu ll, null,  PORT , defaultK eystoreAli as, true, 
  120                             defaul tQueryTime out, 
  121                             defaul tRetrieveT imeout, 
  122                             DxDesP roxyAdapte rRestUri.d xServicePa th,
  123                             DxData SourceProx yConfigura tion.DEFAU LT_DES_VER SION,
  124                             DxData SourceProx yConfigura tion.DEFAU LT_DES_SER VICE_VERSI ON,
  125                             defaul tDelayPeri od,
  126                             defaul tDasProtoc ol,
  127                             defaul tDasHost,
  128                             defaul tDasPort,
  129                             defaul tRequestSo urce,
  130                             defaul tLoinc,
  131                             defaul tProvider,
  132                             defaul tDesHomeCo mmunityId,
  133                             defaul tAccessibl eIpAddress ,
  134                             null
  135                    );
  136           }
  137           
  138           pu blic stati c DxDataSo urceConfig uration cr eate(
  139                    Stri ng keystor ePassword,  String tr uststorePa ssword)
  140           th rows Malfo rmedURLExc eption 
  141           {
  142                    retu rn DxDataS ourceConfi guration.c reate(
  143                             defaul tKeystoreU rl, 
  144                             keysto rePassword
  145                             defaul tTruststor eUrl, 
  146                             trusts torePasswo rd);
  147           }
  148           
  149           pu blic stati c DxDataSo urceConfig uration cr eate(
  150                    Stri ng keystor eUrl, 
  151                    Stri ng keystor ePassword,  
  152                    Stri ng trustst oreUrl, 
  153                    Stri ng trustst orePasswor d)
  154           th rows Malfo rmedURLExc eption 
  155           {
  156                    retu rn DxDataS ourceConfi guration.c reate(
  157                             keysto reUrl, 
  158                             keysto rePassword
  159                             trusts toreUrl, 
  160                             trusts torePasswo rd, 
  161                             defaul tTLSProtoc ol,
  162                             defaul tTLSPort,
  163                             defaul tKeystoreA lias,
  164                             DxData SourceProx yConfigura tion.DEFAU LT_ALLOWPA RTIALSUCCE SS.boolean Value());
  165           }
  166           
  167           pu blic stati c DxDataSo urceConfig uration cr eate(
  168                    Stri ng keystor eUrl, 
  169                    Stri ng keystor ePassword,  
  170                    Stri ng trustst oreUrl, 
  171                    Stri ng trustst orePasswor d, 
  172                    Stri ng tlsProt ocol,
  173                    int  tlsPort,
  174                    Stri ng keystor eAlias,
  175                    bool ean allowP artialSucc ess)
  176           th rows Malfo rmedURLExc eption 
  177           {
  178                    if(k eystoreUrl  == null)
  179                             keysto reUrl = de faultKeyst oreUrl;
  180                    if(t ruststoreU rl == null )
  181                             trusts toreUrl =  defaultTru ststoreUrl ;
  182                    if(t lsProtocol  == null)
  183                             tlsPro tocol = de faultTLSPr otocol;
  184                    if(t lsPort <=  0)
  185                             tlsPor t = defaul tTLSPort;
  186                    
  187                    retu rn new DxD ataSourceC onfigurati on(
  188                             keysto reUrl, 
  189                             keysto rePassword
  190                             trusts toreUrl, 
  191                             trusts torePasswo rd, 
  192                             tlsPro tocol,
  193                             tlsPor t, 
  194                             keysto reAlias,
  195                             allowP artialSucc ess,
  196                             defaul tQueryTime out, 
  197                             defaul tRetrieveT imeout,
  198                             DxDesP roxyAdapte rRestUri.d xServicePa th,
  199                             DxData SourceProx yConfigura tion.DEFAU LT_DES_VER SION,
  200                             DxData SourceProx yConfigura tion.DEFAU LT_DES_SER VICE_VERSI ON,
  201                             defaul tDelayPeri od,
  202                             defaul tDasProtoc ol,
  203                             defaul tDasHost,
  204                             defaul tDasPort,
  205                             defaul tRequestSo urce,
  206                             defaul tLoinc,
  207                             defaul tProvider,
  208                             defaul tDesHomeCo mmunityId,
  209                             defaul tAccessibl eIpAddress ,
  210                             null
  211                    );
  212           }
  213  
  214           pu blic stati c DxDataSo urceConfig uration cr eate(
  215                    Stri ng keystor eUrl,
  216                    Stri ng keystor ePassword,  
  217                    Stri ng trustst oreUrl, 
  218                    Stri ng trustst orePasswor d, 
  219                    Stri ng tlsProt ocol,
  220                    int  tlsPort,
  221                    Stri ng keystor eAlias,
  222                    bool ean allowP artialSucc ess,
  223                    int  queryTimeo ut,
  224                    int  retrieveTi meout,
  225                    Stri ng desServ ice,
  226                    Stri ng desVers ion,
  227                    Stri ng desServ iceVersion ,
  228                    int  delayPerio d,
  229                    Stri ng dasProt ocol,
  230                    Stri ng dasHost ,
  231                    int  dasPort,
  232                    Stri ng desRequ estSource,
  233                    Stri ng desLoin c,
  234                    Stri ng desProv ider,
  235                    Stri ng desHome CommunityI d,
  236                    Stri ng accessi bleIpAddre ss,
  237                    Stri ng alexdel argePasswo rd
  238           )
  239           th rows Malfo rmedURLExc eption 
  240           {
  241                    retu rn new DxD ataSourceC onfigurati on(
  242                                      keystore Url,
  243                                      keystore Password, 
  244                                      truststo reUrl, 
  245                                      truststo rePassword
  246                                      tlsProto col,
  247                                      tlsPort,
  248                                      keystore Alias,
  249                                      allowPar tialSucces s,
  250                                      queryTim eout,
  251                                      retrieve Timeout,
  252                                      desServi ce,
  253                                      desVersi on,
  254                                      desServi ceVersion,
  255                                      delayPer iod,
  256                                      dasProto col,
  257                                      dasHost,
  258                                      dasPort,
  259                                      desReque stSource,
  260                                      desLoinc ,
  261                                      desProvi der,
  262                                      desHomeC ommunityId ,
  263                                      accessib leIpAddres s,
  264                                      alexdela rgePasswor d
  265                                      );
  266           }
  267  
  268           //  ========= ========== ========== ========== ========== ========== ========== ========== =====
  269           
  270           /* *
  271            *  @return t he logger
  272            * /
  273           pr otected sy nchronized  Logger ge tLogger()
  274           {
  275                    if(l ogger == n ull)
  276                             logger  = LogMana ger.getLog ger(this.g etClass()) ;
  277                    retu rn this.lo gger;
  278           }
  279  
  280           /* *
  281            *  @param si teConfigur ations the  siteConfi gurations  to set
  282            * /
  283           // public voi d setSiteC onfigurati ons(List<D xSiteConfi guration>  siteConfig urations)  {
  284           //       this .siteConfi gurations  = siteConf igurations ;
  285           // }
  286           
  287           /* *
  288            *  
  289            *  @param tr uststoreUr l
  290            *  @param ke ystoreUrl
  291            *  @param ke ystorePass word
  292            *  @param tr uststorePa ssword
  293            *  @param fe derationSs lProtocol
  294            *  @throws M alformedUR LException  
  295            * /
  296           pr ivate DxDa taSourceCo nfiguratio n(
  297                    Stri ng keystor eUrl,
  298                    Stri ng keystor ePassword,  
  299                    Stri ng trustst oreUrl, 
  300                    Stri ng trustst orePasswor d, 
  301                    Stri ng tlsProt ocol,
  302                    int  tlsPort,
  303                    Stri ng keystor eAlias,
  304                    bool ean allowP artialSucc ess,
  305                    int  queryTimeo ut,
  306                    int  retrieveTi meout,
  307                    Stri ng desServ ice,
  308                    Stri ng desVers ion,
  309                    Stri ng desServ iceVersion ,
  310                    int  delayPerio d,
  311                    Stri ng dasProt ocol,
  312                    Stri ng dasHost ,
  313                    int  dasPort,
  314                    Stri ng desRequ estSource,
  315                    Stri ng desLoin c,
  316                    Stri ng desProv ider,
  317                    Stri ng desHome CommunityI d,
  318                    Stri ng accessi bleIpAddre ss,
  319                    Stri ng alexdel argePasswo rd
  320                    ) 
  321           th rows Malfo rmedURLExc eption 
  322           {
  323                    supe r();
  324   //               this .tlsConfig uration =  TLSConfigu ration.cre ate(
  325   //                        keysto reUrl, key storePassw ord, 
  326   //                        trusts toreUrl, t ruststoreP assword,
  327   //                        tlsPro tocol, tls Port);
  328   //               this .proxyConf iguration  = new DxDa taSourcePr oxyConfigu ration(new  Boolean(a llowPartia lSuccess)) ;
  329                    
  330                    this .keystoreU rl =  keys toreUrl;
  331                    this .keystoreP assword =  keystorePa ssword;
  332                    this .truststor eUrl = tru ststoreUrl ;
  333                    this .truststor ePassword  = truststo rePassword ;
  334                    this .tlsProtoc ol = tlsPr otocol;
  335                    this .tlsPort =  tlsPort;
  336                    this .keystoreA lias = key storeAlias ;
  337                    this .allowPart ialSuccess  = new Boo lean(allow PartialSuc cess);
  338  
  339                    this .queryTime out = quer yTimeout;
  340                    this .retrieveT imeout = r etrieveTim eout;
  341                    this .desServic e = desSer vice;
  342                    this .desVersio n = desVer sion;
  343                    this .desServic eVersion =  desServic eVersion;
  344                    this .delayPeri od = delay Period;
  345                    this .dasProtoc ol = dasPr otocol;
  346                    this .dasHost =  dasHost;
  347                    this .dasPort =  dasPort;
  348                    this .desReques tSource =  desRequest Source;
  349                    this .desLoinc  = desLoinc ;
  350                    this .desProvid er = desPr ovider;
  351                    this .desHomeCo mmunityId  = desHomeC ommunityId ;
  352                    this .accessibl eIpAddress  = accessi bleIpAddre ss;
  353                    this .alexdelar gePassword  = alexdel argePasswo rd;
  354           }
  355           
  356  
  357           pu blic void  setAccessi bleIpAddre ss(String  ipAddress)  {
  358                    this .accessibl eIpAddress  = ipAddre ss;
  359           }
  360  
  361           pu blic Strin g getAcces sibleIpAdd ress() {
  362                    retu rn accessi bleIpAddre ss;
  363           }
  364  
  365           /* *
  366            *  @return t he allowPa rtialSucce ss
  367            * /
  368           pu blic Boole an isAllow PartialSuc cess()
  369           {
  370                    retu rn this.al lowPartial Success;
  371           }
  372  
  373  
  374           
  375           /* *
  376            *  @return t he tlsConf iguration
  377            * /
  378   //      pu blic TLSCo nfiguratio n getTlsCo nfiguratio n()
  379   //      {
  380   //               retu rn this.tl sConfigura tion;
  381   //      }
  382  
  383           /* *
  384            *  @param tl sConfigura tion the t lsConfigur ation to s et
  385            * /
  386   //      pu blic void  setTlsConf iguration( TLSConfigu ration tls Configurat ion)
  387   //      {
  388   //               this .tlsConfig uration =  tlsConfigu ration;
  389   //      }
  390  
  391           /* *
  392            *  @return t he trustst oreUrl
  393            * /
  394           pu blic Strin g getTrust storeUrl()  
  395           {
  396                    //re turn getTl sConfigura tion().get Truststore Url().toSt ring();
  397                    retu rn trustst oreUrl;
  398           }
  399  
  400           /* *
  401            *  @param tr uststoreUr l the trus tstoreUrl  to set
  402            *  @throws M alformedUR LException  
  403            * /
  404           pu blic void  setTrustst oreUrl(Str ing trusts toreUrl) 
  405           // throws Mal formedURLE xception 
  406           {
  407                    //ge tTlsConfig uration(). setTrustst oreUrl(new  URL(trust storeUrl)) ;
  408                    this .truststor eUrl = tru ststoreUrl ;
  409           }
  410  
  411           /* *
  412            *  @return t he keystor eUrl
  413            * /
  414           pu blic Strin g getKeyst oreUrl() 
  415           {
  416                    //re turn getTl sConfigura tion().get KeystoreUr l().toStri ng();
  417                    retu rn keystor eUrl;
  418           }
  419  
  420           /* *
  421            *  @param ke ystoreUrl  the keysto reUrl to s et
  422            *  @throws M alformedUR LException  
  423            * /
  424           pu blic void  setKeystor eUrl(Strin g keystore Url) 
  425           // throws Mal formedURLE xception 
  426           {
  427                    //ge tTlsConfig uration(). setKeystor eUrl(new U RL(keystor eUrl));
  428                    this .keystoreU rl = keyst oreUrl;
  429           }
  430  
  431           /* *
  432            *  @return t he keystor ePassword
  433            * /
  434           pu blic Strin g getKeyst orePasswor d() 
  435           {
  436                    //re turn getTl sConfigura tion().get KeystorePa ssword();
  437                    retu rn keystor ePassword;
  438           }
  439  
  440           /* *
  441            *  @param ke ystorePass word the k eystorePas sword to s et
  442            * /
  443           pu blic void  setKeystor ePassword( String key storePassw ord) 
  444           {
  445                    //ge tTlsConfig uration(). setKeystor ePassword( keystorePa ssword);
  446                    this .keystoreP assword =  keystorePa ssword;
  447           }
  448  
  449           /* *
  450            *  The alias  of the ce rtificate  to use as  the creden tials.
  451            *  
  452            *  @param st ring
  453            * /
  454           pu blic Strin g getKeyst oreAlias()
  455           {
  456                    retu rn keystor eAlias;
  457                    //re turn getTl sConfigura tion().get Alias();
  458           }
  459           
  460           pu blic void  setKeystor eAlias(Str ing alias)
  461           {
  462                    this .keystoreA lias = ali as;
  463                    //ge tTlsConfig uration(). setAlias(a lias);
  464           }
  465           
  466           /* *
  467            *  @return t he trustst orePasswor d
  468            * /
  469           pu blic Strin g getTrust storePassw ord() 
  470           {
  471                    //re turn getTl sConfigura tion().get Truststore Password() ;
  472                    retu rn trustst orePasswor d;
  473           }
  474  
  475           /* *
  476            *  @param tr uststorePa ssword the  truststor ePassword  to set
  477            * /
  478           pu blic void  setTrustst orePasswor d(String t ruststoreP assword) 
  479           {
  480                    //ge tTlsConfig uration(). setTrustst orePasswor d(truststo rePassword );
  481                    this .truststor ePassword  = truststo rePassword ;
  482           }
  483  
  484           /* *
  485            *  @return t he useCert ificate
  486            * /
  487           pu blic boole an isUseCe rtificate(
  488           {
  489                    retu rn useCert ificate;
  490           }
  491  
  492           /* *
  493            *  @param us eCertifica te the use Certificat e to set
  494            * /
  495           pu blic void  setUseCert ificate(bo olean useC ertificate
  496           {
  497                    this .useCertif icate = us eCertifica te;
  498           }
  499           
  500           pu blic Integ er getQuer yTimeout()
  501           {
  502                    retu rn queryTi meout;
  503           }
  504  
  505           pu blic void  setQueryTi meout(Inte ger queryT imeout)
  506           {
  507                    this .queryTime out = quer yTimeout;
  508           }
  509  
  510           pu blic Integ er getRetr ieveTimeou t()
  511           {
  512                    retu rn retriev eTimeout;
  513           }
  514  
  515           pu blic void  setRetriev eTimeout(I nteger ret rieveTimeo ut)
  516           {
  517                    this .retrieveT imeout = r etrieveTim eout;
  518           }
  519  
  520           /* *
  521            *  @return t he tlsProt ocol
  522            * /
  523           pu blic Strin g getTLSPr otocol()
  524           {
  525                    //re turn getTl sConfigura tion().get Protocol() ;
  526                    retu rn tlsProt ocol;
  527           }
  528  
  529           /* *
  530            *  @return t he tlsPort
  531            * /
  532           pu blic int g etTLSPort( )
  533           {
  534                    //re turn getTl sConfigura tion().get Port();
  535                    retu rn tlsPort ;
  536           }
  537  
  538           /* *
  539            *  @param tl sProtocol  the tlsPro tocol to s et
  540            * /
  541           pu blic void  setTLSProt ocol(Strin g protocol )
  542           {
  543                    //ge tTlsConfig uration(). setProtoco l(protocol );
  544                    this .tlsProtoc ol = proto col;
  545           }
  546  
  547           /* *
  548            *  @param tl sPort the  tlsPort to  set
  549            * /
  550           pu blic void  setTLSPort (int port)
  551           {
  552                    //ge tTlsConfig uration(). setPort(po rt);
  553                    this .tlsPort =  port;
  554           }
  555  
  556           /* *
  557            *  @return t he proxyCo nfiguratio n
  558            * /
  559   //      pu blic DxDat aSourcePro xyConfigur ation getP roxyConfig uration()
  560   //      {
  561   //               retu rn this.pr oxyConfigu ration;
  562   //      }
  563  
  564           /* *
  565            *  @param pr oxyConfigu ration the  proxyConf iguration  to set
  566            * /
  567   //      pu blic void  setProxyCo nfiguratio n(DxDataSo urceProxyC onfigurati on proxyCo nfiguratio n)
  568   //      {
  569   //               this .proxyConf iguration  = proxyCon figuration ;
  570   //      }
  571  
  572           
  573           /* *
  574            *  @return t he desVers ion
  575            * /
  576           pu blic Strin g getDesVe rsion() 
  577           {
  578                    retu rn this.de sVersion;
  579           }
  580  
  581           /* *
  582            *  @param de sVersion t he desVers ion to set
  583            * /
  584           pu blic void  setDesVers ion(String  desVersio n) 
  585           {
  586                    this .desVersio n = desVer sion;
  587           }
  588  
  589           /* *
  590            *  @return t he desVers ion
  591            * /
  592           pu blic Strin g getDesSe rviceVersi on() 
  593           {
  594                    retu rn this.de sServiceVe rsion;
  595           }
  596  
  597           /* *
  598            *  @param de sServiceVe rsion the  desService Version to  set
  599            * /
  600           pu blic void  setDesServ iceVersion (String de sServiceVe rsion) 
  601           {
  602                    this .desServic eVersion =  desServic eVersion;
  603           }
  604  
  605           /* *
  606            *  @return t he desRequ estSource
  607            * /
  608           pu blic Strin g getDesRe questSourc e() 
  609           {
  610                    retu rn this.de sRequestSo urce;
  611           }
  612  
  613           /* *
  614            *  @param de sRequestSo urce the d esRequestS ource to s et
  615            * /
  616           pu blic void  setDesRequ estSource( String des RequestSou rce) 
  617           {
  618                    this .desReques tSource =  desRequest Source;
  619           }
  620           
  621           /* *
  622            *  @return t he desLoin c
  623            * /
  624           pu blic Strin g getDesLo inc() 
  625           {
  626                    retu rn this.de sLoinc;
  627           }
  628  
  629           /* *
  630            *  @param de sLoinc the  desLoinc  to set
  631            * /
  632           pu blic void  setDesLoin c(String d esLoinc) 
  633           {
  634                    this .desLoinc  = desLoinc ;
  635           }
  636           
  637           /* *
  638            *  @return t he desProv ider
  639            * /
  640           pu blic Strin g getDesPr ovider() 
  641           {
  642                    retu rn this.de sProvider;
  643           }
  644  
  645           /* *
  646            *  @param de sProvider  the desPro vider to s et
  647            * /
  648           pu blic void  setDesProv ider(Strin g desProvi der) 
  649           {
  650                    this .desProvid er = desPr ovider;
  651           }
  652           
  653           /* *
  654            *  @return t he delayPe riod
  655            * /
  656           pu blic Integ er getDela yPeriod()
  657           {
  658                    retu rn delayPe riod;
  659           }
  660  
  661           /* *
  662            *  @param de layPeriod  the delayP eriod to s et
  663            * /
  664           pu blic void  setDelayPe riod(Integ er delayPe riod)
  665           {
  666                    this .delayPeri od = delay Period;
  667           }
  668  
  669           /* *
  670            *  @return t he dasProt ocol
  671            * /
  672           pu blic Strin g getDasPr otocol() 
  673           {
  674                    retu rn this.da sProtocol;
  675           }
  676  
  677           /* *
  678            *  @param da sProtocol  the dasPro tocol to s et
  679            * /
  680           pu blic void  setDasProt ocol(Strin g dasProto col) 
  681           {
  682                    this .dasProtoc ol = dasPr otocol;
  683           }
  684           
  685           /* *
  686            *  @return t he dasHost
  687            * /
  688           pu blic Strin g getDasHo st() 
  689           {
  690                    retu rn this.da sHost;
  691           }
  692  
  693           /* *
  694            *  @param da sHost the  dasHost to  set
  695            * /
  696           pu blic void  setDasHost (String da sHost) 
  697           {
  698                    this .dasHost =  dasHost;
  699           }
  700  
  701           /* *
  702            *  @return t he dasPort
  703            * /
  704           pu blic int g etDasPort(
  705           {
  706                    retu rn this.da sPort;
  707           }
  708  
  709           /* *
  710            *  @param da sPort the  dasPort to  set
  711            * /
  712           pu blic void  setDasPort (int dasPo rt) 
  713           {
  714                    this .dasPort =  dasPort;
  715           }
  716  
  717           /* *
  718            *  @return t he desServ ice
  719            * /
  720           pu blic Strin g getDesSe rvice() {
  721                    retu rn this.de sService;
  722           }
  723           
  724           /* *
  725            *  @param de sService t he desServ ice to set
  726            * /
  727           pu blic void  setDesServ ice(String  desServic e) 
  728           {
  729                    this .desServic e = desSer vice;
  730           }
  731           
  732  
  733           /* *
  734            *  @return t he desHome CommunityI d
  735            * /
  736           pu blic Strin g getDesHo meCommunit yId() 
  737           {
  738                    retu rn this.de sHomeCommu nityId;
  739           }
  740  
  741           /* *
  742            *  @param de sHomeCommu nityId the  desHomeCo mmunityId  to set
  743            * /
  744           pu blic void  getDesHome CommunityI d(String d esHomeComm unityId) 
  745           {
  746                    this .desHomeCo mmunityId  = desHomeC ommunityId ;
  747           }
  748  
  749           /* *
  750            *  
  751            * /
  752           pu blic void  clear()
  753           {
  754                    arti factSource Configurat ions.clear ();
  755           }
  756  
  757           /* *
  758            *  @return t he alextde largePassw ord
  759            * /
  760           pu blic Strin g getAlext delargePas sword() 
  761           {
  762                    retu rn alexdel argePasswo rd;
  763           }
  764  
  765           /* *
  766            *  @param al exdelargeP assword th e alexdela rgePasswor d to set
  767            * /
  768           pu blic void  setAlextde largePassw ord(String  alexdelar gePassword
  769           {
  770                    this .alexdelar gePassword  = alexdel argePasswo rd;
  771           }
  772  
  773           
  774           
  775           //  ========= ========== ========== ========== ========== ========== ========== ========
  776           /* *
  777            *  
  778            *  @param co nfiguratio n
  779            *  @param si te
  780            *  @return
  781            *  @throws M ethodExcep tion
  782            * /
  783           pu blic DxSit eConfigura tion findS iteConfigu ration(Res olvedArtif actSource  resolvedAr tifactSour ce)
  784           th rows Metho dException
  785           {
  786                    if(r esolvedArt ifactSourc e == null  || resolve dArtifactS ource.getA rtifactSou rce() == n ull)
  787                    {
  788                             String  msg = "Ei ther resol vedArtifac tSource or  resolvedA rtifactSou rce.getArt ifactSourc e() are nu ll.";
  789                             getLog ger().erro r(msg);
  790                             return  null;
  791                    }
  792                    
  793                    OID  homeCommun ityId = re solvedArti factSource .getArtifa ctSource() .getHomeCo mmunityId( );
  794                    Stri ng reposit oryId = re solvedArti factSource .getArtifa ctSource() .getReposi toryId();
  795                    
  796                    DxSi teConfigur ation site Configurat ion;
  797                    try
  798                    {
  799                             siteCo nfiguratio n = get(ho meCommunit yId, repos itoryId);
  800                             if(sit eConfigura tion == nu ll)
  801                             {
  802                                      String m sg = "Coul d not find  DX gatewa y site con figuration  for artif act source  '" + reso lvedArtifa ctSource.t oString()  + "'.";
  803                                      getLogge r().info(m sg);
  804                                      return n ull;
  805                             }
  806                             
  807                             return  siteConfi guration;
  808                    }
  809                    catc h (Routing TokenForma tException  x)
  810                    {
  811                             throw  new Method Exception( "Exception  thrown wh ile findin g site con figuration  for " + r esolvedArt ifactSourc e.toString () + ".",  x);
  812                    }
  813           }
  814           
  815           /* *
  816            *  Replaces  the URL wi th the spe cified pro tocol with  a URL for med from t he
  817            *  path.  Th e resultin g Resolved ArtifactSo urce will  have only  one query  and
  818            *  one retri eve URL, w hich will  be the one s to use f or DX.  An y componen t
  819            *  of the UR L may be c hanged by  the URLCom ponentMerg er.
  820            *  
  821            *  @param re solvedArti factSource
  822            *  @param si teConfigur ation
  823            *  @return
  824            *  @throws M ethodExcep tion 
  825            *  @throws M alformedUR LException  
  826            * /
  827           pu blic Resol vedArtifac tSource fi xupURLPath s(
  828                    Reso lvedArtifa ctSource r esolvedArt ifactSourc e,
  829                    DxSi teConfigur ation site Configurat ion) throw s MethodEx ception 
  830           {
  831                    if(s iteConfigu ration ==  null)
  832                             return  resolvedA rtifactSou rce;
  833                    
  834                    List <URL> fixe dUpQueryUr ls = new A rrayList<U RL>();
  835                    for(  URL metad ataUrl : r esolvedArt ifactSourc e.getMetad ataUrls()  )
  836                             if( Dx DocumentSe tDataSourc eService.S UPPORTED_P ROTOCOL.eq uals(metad ataUrl.get Protocol() ) )
  837                             {
  838                                      URL fixe dUpUrl = n ull;
  839                                      try {
  840                                               fixedUpUrl  = siteCon figuration .getQueryC omponentMe rger().mer ge(metadat aUrl);
  841                                      } catch  (Malformed URLExcepti on e) {
  842                                               throw new  MethodExce ption("Exc eption thr own while  siteConfig uration.ge tQueryComp onentMerge r().merge  " + metada taUrl.toSt ring() + " .", e);
  843                                      }
  844                                      fixedUpQ ueryUrls.a dd(fixedUp Url); 
  845                             }
  846                    
  847                    List <URL> fixe dUpRetriev eUrls = ne w ArrayLis t<URL>();
  848                    for(  URL retri eveUrl : r esolvedArt ifactSourc e.getArtif actUrls()  )
  849                             if( Dx DocumentSe tDataSourc eService.S UPPORTED_P ROTOCOL.eq uals(retri eveUrl.get Protocol() ) )
  850                             {
  851                                      URL fixe dUpUrl;
  852                                      try {
  853                                               fixedUpUrl  = siteCon figuration .getRetrie veComponen tMerger(). merge(retr ieveUrl);
  854                                      } catch  (Malformed URLExcepti on e) {
  855                                               throw new  MethodExce ption("Exc eption thr own while  siteConfig uration.ge tRetrieveC omponentMe rger().mer ge " + ret rieveUrl.t oString()  + ".", e);
  856                                      }
  857                                      fixedUpR etrieveUrl s.add(fixe dUpUrl); 
  858                             }
  859                    
  860                    Reso lvedArtifa ctSourceIm pl result  = Resolved ArtifactSo urceImpl.c reate(
  861                             resolv edArtifact Source.get ArtifactSo urce(), fi xedUpQuery Urls, fixe dUpRetriev eUrls
  862                    );
  863                    
  864                    retu rn result;
  865           }
  866           
  867           /* *
  868            *  @param si teConfigur ation
  869            * /
  870           pu blic void  add(DxSite Configurat ion siteCo nfiguratio n)
  871           {
  872                    sync hronized(a rtifactSou rceConfigu rations)
  873                    {
  874                             artifa ctSourceCo nfiguratio ns.add(sit eConfigura tion);
  875                    }
  876           }
  877           
  878           /* *
  879            *  
  880            *  @param si teNumber
  881            *  @return
  882            *  @throws R outingToke nFormatExc eption 
  883            * /
  884           pu blic DxSit eConfigura tion get(O ID homeCom munityId,  String rep ositoryId)  
  885           th rows Routi ngTokenFor matExcepti on
  886           {
  887                    if(h omeCommuni tyId == nu ll || repo sitoryId = = null)
  888                             return  null;
  889                    
  890                    retu rn get(Rou tingTokenI mpl.create (homeCommu nityId, re positoryId ));
  891           }
  892           
  893           pu blic DxSit eConfigura tion get(R outingToke n target) 
  894           th rows Routi ngTokenFor matExcepti on
  895           {
  896                    sync hronized(a rtifactSou rceConfigu rations)
  897                    {
  898                             for(Dx SiteConfig uration si teConfig :  artifactS ourceConfi gurations)
  899                                      if( targ et.equals( siteConfig .getRoutin gToken())  )
  900                                               return sit eConfig;
  901                    }
  902                    retu rn null;
  903           }
  904           
  905           /* *
  906            *  
  907            *  @param si teNumber
  908            *  @throws R outingToke nFormatExc eption 
  909            * /
  910           pu blic void  remove(OID  homeCommu nityId, St ring repos itoryId) 
  911           th rows Routi ngTokenFor matExcepti on
  912           {
  913                    if(h omeCommuni tyId == nu ll || repo sitoryId = = null)
  914                             return ;
  915                    remo ve(Routing TokenImpl. create(hom eCommunity Id, reposi toryId));
  916           }
  917           
  918           pu blic void  remove(Rou tingToken  target) 
  919           th rows Routi ngTokenFor matExcepti on
  920           {        
  921                    sync hronized(a rtifactSou rceConfigu rations)
  922                    {
  923                             DxSite Configurat ion siteTo Remove = g et(target) ;
  924                             
  925                             if(sit eToRemove  != null)
  926                                      artifact SourceConf igurations .remove(si teToRemove );
  927                    }
  928           }
  929           
  930           /* *
  931            *  
  932            * /
  933           @O verride
  934           pu blic Strin g toString ()
  935           {
  936                    Stri ngBuilder  sb = new S tringBuild er();
  937                    
  938                    sb.a ppend("BEG IN " + thi s.getClass ().getName () + " \n" );
  939                    for( DxSiteConf iguration  site : art ifactSourc eConfigura tions)
  940                    {
  941                             sb.app end('\t');
  942                             sb.app end(site.t oString()) ;
  943                             sb.app end('\n');
  944                    }
  945                    sb.a ppend("END  " + this. getClass() .getName()  + " \n");
  946                    
  947                    retu rn sb.toSt ring();
  948           }
  949  
  950  
  951  
  952   }