make some classes and methods package private

ElasticsearchResponseException, as well as ElasticsearchResponse, should only be created from o.e.client package.
RequestLogger should only be used from this package too.
This commit is contained in:
javanna 2016-05-27 13:42:50 +02:00 committed by Luca Cavanna
parent 6490355cb6
commit 29b1f8d44a
4 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ public class ElasticsearchResponseException extends IOException {
private ElasticsearchResponse elasticsearchResponse;
private final String responseBody;
public ElasticsearchResponseException(ElasticsearchResponse elasticsearchResponse, String responseBody) throws IOException {
ElasticsearchResponseException(ElasticsearchResponse elasticsearchResponse, String responseBody) throws IOException {
super(buildMessage(elasticsearchResponse,responseBody));
this.elasticsearchResponse = elasticsearchResponse;
this.responseBody = responseBody;

View File

@ -30,7 +30,7 @@ final class HttpDeleteWithEntity extends HttpEntityEnclosingRequestBase {
final static String METHOD_NAME = HttpDelete.METHOD_NAME;
public HttpDeleteWithEntity(final URI uri) {
HttpDeleteWithEntity(final URI uri) {
setURI(uri);
}

View File

@ -30,7 +30,7 @@ final class HttpGetWithEntity extends HttpEntityEnclosingRequestBase {
final static String METHOD_NAME = HttpGet.METHOD_NAME;
public HttpGetWithEntity(final URI uri) {
HttpGetWithEntity(final URI uri) {
setURI(uri);
}

View File

@ -41,7 +41,7 @@ import java.nio.charset.StandardCharsets;
* Helper class that exposes static methods to unify the way requests are logged.
* Includes trace logging to log complete requests and responses in curl format.
*/
public final class RequestLogger {
final class RequestLogger {
private static final Log tracer = LogFactory.getLog("tracer");
@ -51,7 +51,7 @@ public final class RequestLogger {
/**
* Logs a request that yielded a response
*/
public static void log(Log logger, String message, HttpUriRequest request, HttpHost host, HttpResponse httpResponse) {
static void log(Log logger, String message, HttpUriRequest request, HttpHost host, HttpResponse httpResponse) {
logger.debug(message + " [" + request.getMethod() + " " + host + request.getRequestLine().getUri() +
"] [" + httpResponse.getStatusLine() + "]");
@ -77,7 +77,7 @@ public final class RequestLogger {
/**
* Logs a request that failed
*/
public static void log(Log logger, String message, HttpUriRequest request, HttpHost host, IOException e) {
static void log(Log logger, String message, HttpUriRequest request, HttpHost host, IOException e) {
logger.debug(message + " [" + request.getMethod() + " " + host + request.getRequestLine().getUri() + "]", e);
if (logger.isTraceEnabled()) {
String traceRequest;