@@ -656,6 +656,38 @@ protected void _clientSolrComputate() throws Exception {
656656 clientSolrComputate = new HttpSolrClient .Builder (solrUrlComputate ).withHttpClient (httpClient ).build ();
657657 }
658658
659+ public String solrUrlFiware ;
660+
661+ public String getSolrUrlFiware () {
662+ return solrUrlFiware ;
663+ }
664+
665+ public void setSolrUrlFiware (String solrUrlFiware ) {
666+ this .solrUrlFiware = solrUrlFiware ;
667+ }
668+
669+ protected void _solrUrlFiware () throws Exception {
670+ solrUrlFiware = config
671+ .getString (langueConfigGlobale .getString (I18n .var_SOLR_URL_FIWARE ));
672+ }
673+
674+ public SolrClient clientSolrFiware ;
675+ protected void _clientSolrFiware () throws Exception {
676+ SSLContextBuilder builder = new SSLContextBuilder ();
677+ builder .loadTrustMaterial (null , new TrustSelfSignedStrategy ());
678+ SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory (builder .build (), NoopHostnameVerifier .INSTANCE );
679+ UsernamePasswordCredentials credentials = new UsernamePasswordCredentials (solrUtilisateur , solrMotDePasse );
680+ CredentialsProvider credentialsProvider = new BasicCredentialsProvider ();
681+ PreemptiveAuth requestInterceptor = new PreemptiveAuth (new BasicScheme ());
682+ credentialsProvider .setCredentials (AuthScope .ANY , credentials );
683+ CloseableHttpClient httpClient = HttpClients .custom ()
684+ .setSSLSocketFactory (sslsf )
685+ .setDefaultCredentialsProvider (credentialsProvider )
686+ .addInterceptorLast (requestInterceptor )
687+ .build ();
688+ clientSolrFiware = new HttpSolrClient .Builder (solrUrlFiware ).withHttpClient (httpClient ).build ();
689+ }
690+
659691 /**
660692 * Var.enUS: sourcePaths enUS: The absolute paths to source code directories in
661693 * the app to watch for changes.
@@ -952,7 +984,9 @@ public void initConfigSite() throws Exception {
952984 _solrUtilisateur ();
953985 _solrMotDePasse ();
954986 _solrUrlComputate ();
987+ _solrUrlFiware ();
955988 _clientSolrComputate ();
989+ _clientSolrFiware ();
956990 _cheminsSource ();
957991 _toutCheminsSource ();
958992 _nomsMethodeTest ();
0 commit comments