public void init()

in src/main/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java [102:155]


  public void init(NamedList args)
  {
    super.init(args);
    authorityBaseURL = (String)args.get("AuthorityServiceBaseURL");
    if (authorityBaseURL == null)
    {
      LOG.info("USING DEFAULT BASE URL!!");
      authorityBaseURL = "http://localhost:8345/mcf-authority-service";
    }
    Integer cTimeOut = (Integer)args.get("ConnectionTimeOut");
    connectionTimeOut = cTimeOut == null ? 60000 : cTimeOut;
    Integer timeOut = (Integer)args.get("SocketTimeOut");
    socketTimeOut = timeOut == null ? 300000 : timeOut;
    String allowAttributePrefix = (String)args.get("AllowAttributePrefix");
    String denyAttributePrefix = (String)args.get("DenyAttributePrefix");
    if (allowAttributePrefix == null)
      allowAttributePrefix = "allow_token_";
    if (denyAttributePrefix == null)
      denyAttributePrefix = "deny_token_";
    fieldAllowDocument = allowAttributePrefix+"document";
    fieldDenyDocument = denyAttributePrefix+"document";
    fieldAllowShare = allowAttributePrefix+"share";
    fieldDenyShare = denyAttributePrefix+"share";
    fieldAllowParent = allowAttributePrefix+"parent";
    fieldDenyParent = denyAttributePrefix+"parent";
    Integer connectionPoolSize = (Integer)args.get("ConnectionPoolSize");
    poolSize = (connectionPoolSize==null)?50:connectionPoolSize;

    // Initialize the connection pool
    httpConnectionManager = new PoolingHttpClientConnectionManager();
    httpConnectionManager.setMaxTotal(poolSize);
    httpConnectionManager.setDefaultMaxPerRoute(poolSize);
    httpConnectionManager.setValidateAfterInactivity(2000);
    httpConnectionManager.setDefaultSocketConfig(SocketConfig.custom()
            .setTcpNoDelay(true)
            .setSoTimeout(socketTimeOut)
            .build());

    RequestConfig.Builder requestBuilder = RequestConfig.custom()
            .setCircularRedirectsAllowed(true)
            .setSocketTimeout(socketTimeOut)
            .setExpectContinueEnabled(true)
            .setConnectTimeout(connectionTimeOut)
            .setConnectionRequestTimeout(socketTimeOut);

    HttpClientBuilder clientBuilder = HttpClients.custom()
            .setConnectionManager(httpConnectionManager)
            .disableAutomaticRetries()
            .setDefaultRequestConfig(requestBuilder.build())
            .setRedirectStrategy(new DefaultRedirectStrategy());           

    client = clientBuilder.build();

  }