// Path: src/main/java/org/nudge/elasticstack/context/elasticsearch/ESVersion.java
// public enum ESVersion {
// 	ES2, ES5, ES6
// }
// 
// Path: src/main/java/org/nudge/elasticstack/exception/NudgeESConnectorException.java
// @SuppressWarnings("serial")
// public class NudgeESConnectorException extends Exception {
// 
// 	public NudgeESConnectorException(String m) {
// 		super(m);
// 	}
// 
// 	public NudgeESConnectorException(String m, Throwable t) {
// 		super(m, t);
// 	}
// }
// 
// Path: src/main/java/org/nudge/elasticstack/exception/UnsupportedElasticStackException.java
// @SuppressWarnings("serial")
// public class UnsupportedElasticStackException extends RuntimeException {
// 
// 	public UnsupportedElasticStackException(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedElasticStackException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.log4j.Logger;
import org.nudge.elasticstack.context.elasticsearch.ESVersion;
import org.nudge.elasticstack.exception.NudgeESConnectorException;
import org.nudge.elasticstack.exception.UnsupportedElasticStackException;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
			return;
		}

		String requestLog = httpMethod.toString() + " " + resource;
		if (body != null) {
			requestLog = requestLog + " with body : \n" + body;
		}
		LOG.debug(requestLog);
	}


	public void createAndUseIndex(String esIndex) {
		esHostIndexURL = elasticHost + esIndex + "/";
		try {
			put("", null);
		} catch (NudgeESConnectorException e) {
			LOG.info("Index \"" + esIndex + "\" already exists");
		}
	}

	public ESVersion getEsVersion() {
		return esVersion;
	}

	private ESVersion determineESVersion(Metadata metadata) throws UnsupportedElasticStackException {
		int numberVersion = Integer.parseInt(this.metadata.getVersion().getNumber().split("\\.")[0]);
		switch (numberVersion) {
			case 2:
				return ESVersion.ES2;
			case 5:
// Path: src/main/java/org/nudge/elasticstack/context/elasticsearch/ESVersion.java
// public enum ESVersion {
// 	ES2, ES5, ES6
// }
// 
// Path: src/main/java/org/nudge/elasticstack/exception/NudgeESConnectorException.java
// @SuppressWarnings("serial")
// public class NudgeESConnectorException extends Exception {
// 
// 	public NudgeESConnectorException(String m) {
// 		super(m);
// 	}
// 
// 	public NudgeESConnectorException(String m, Throwable t) {
// 		super(m, t);
// 	}
// }
// 
// Path: src/main/java/org/nudge/elasticstack/exception/UnsupportedElasticStackException.java
// @SuppressWarnings("serial")
// public class UnsupportedElasticStackException extends RuntimeException {
// 
// 	public UnsupportedElasticStackException(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedElasticStackException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


// Path: src/main/java/org/nudge/elasticstack/connection/ElasticConnection.java
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.log4j.Logger;
import org.nudge.elasticstack.context.elasticsearch.ESVersion;
import org.nudge.elasticstack.exception.NudgeESConnectorException;
import org.nudge.elasticstack.exception.UnsupportedElasticStackException;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;

			return;
		}

		String requestLog = httpMethod.toString() + " " + resource;
		if (body != null) {
			requestLog = requestLog + " with body : \n" + body;
		}
		LOG.debug(requestLog);
	}


	public void createAndUseIndex(String esIndex) {
		esHostIndexURL = elasticHost + esIndex + "/";
		try {
			put("", null);
		} catch (NudgeESConnectorException e) {
			LOG.info("Index \"" + esIndex + "\" already exists");
		}
	}

	public ESVersion getEsVersion() {
		return esVersion;
	}

	private ESVersion determineESVersion(Metadata metadata) throws UnsupportedElasticStackException {
		int numberVersion = Integer.parseInt(this.metadata.getVersion().getNumber().split("\\.")[0]);
		switch (numberVersion) {
			case 2:
				return ESVersion.ES2;
			case 5:
				return ESVersion.ES5;