Example usage for org.apache.solr.client.solrj SolrRequest getBasicAuthUser

List of usage examples for org.apache.solr.client.solrj SolrRequest getBasicAuthUser

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj SolrRequest getBasicAuthUser.

Prototype

public String getBasicAuthUser() 

Source Link

Usage

From source file:com.ilscipio.scipio.solr.util.ScipioHttpSolrClient.java

License:Apache License

/**
 * Sets basic auth header to either the one in the SolrRequest or the one stored in this client.
 * <p>/*from  w  w  w.j  a va2s .  c  om*/
 * DEV NOTE: Derived from {@link HttpSolrClient#setBasicAuthHeader}, which is private in superclass.
 */
@SuppressWarnings("rawtypes")
protected void setBasicAuthHeaderScipio(SolrRequest request, HttpRequestBase method)
        throws UnsupportedEncodingException {
    if (request.getBasicAuthUser() != null && request.getBasicAuthPassword() != null) {
        setBasicAuthHeader(method, request.getBasicAuthUser(), request.getBasicAuthPassword());
    } else if (this.solrUsername != null && this.solrPassword != null) {
        setBasicAuthHeader(method, this.solrUsername, this.solrPassword);
    }
}