final Node node = nb.node();
client = node.client();
} else {
Logger.info("Connecting Play! to Elastic Search in Client Mode");
final TransportClient c = new TransportClient(settings);
if (Play.configuration.getProperty("elasticsearch.client") == null) {
throw new RuntimeException("Configuration required - elasticsearch.client when local model is disabled!");
}
final String[] hosts = getHosts().trim().split(",");
boolean done = false;
for (final String host : hosts) {
final String[] parts = host.split(":");
if (parts.length != 2) {
throw new RuntimeException("Invalid Host: " + host);
}
Logger.info("Transport Client - Host: %s Port: %s", parts[0], parts[1]);
if (Integer.valueOf(parts[1]) == 9200)
Logger.info("Note: Port 9200 is usually used by the HTTP Transport. You might want to use 9300 instead.");
c.addTransportAddress(new InetSocketTransportAddress(parts[0], Integer.valueOf(parts[1])));
done = true;
}
if (done == false) {
throw new RuntimeException("No Hosts Provided for Elastic Search!");
}