[DOCS] Replaces InetSocketTransportAddress in code samples (elastic/x-pack-elasticsearch#4404)
Original commit: elastic/x-pack-elasticsearch@85b11cccc7
This commit is contained in:
parent
fd3f079276
commit
dcedffb0f0
|
@ -43,8 +43,8 @@ TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
|
||||||
.put("xpack.security.user", "transport_client_user:x-pack-test-password")
|
.put("xpack.security.user", "transport_client_user:x-pack-test-password")
|
||||||
...
|
...
|
||||||
.build())
|
.build())
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
.addTransportAddress(new TransportAddress("localhost", 9300))
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9301));
|
.addTransportAddress(new TransportAddress("localhost", 9301));
|
||||||
-------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
WARNING: If you configure a transport client without SSL, passwords are sent in
|
WARNING: If you configure a transport client without SSL, passwords are sent in
|
||||||
|
@ -64,7 +64,7 @@ request:
|
||||||
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
||||||
import org.elasticsearch.common.settings.SecureString;
|
import org.elasticsearch.common.settings.SecureString;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
import org.elasticsearch.xpack.client.PreBuiltXPackTransportClient;
|
import org.elasticsearch.xpack.client.PreBuiltXPackTransportClient;
|
||||||
|
|
||||||
import static UsernamePasswordToken.basicAuthHeaderValue;
|
import static UsernamePasswordToken.basicAuthHeaderValue;
|
||||||
|
@ -76,8 +76,8 @@ TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
|
||||||
...
|
...
|
||||||
.build())
|
.build())
|
||||||
.build()
|
.build()
|
||||||
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300))
|
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300))
|
||||||
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9301))
|
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9301))
|
||||||
|
|
||||||
String token = basicAuthHeaderValue("test_user", new SecureString("x-pack-test-password".toCharArray()));
|
String token = basicAuthHeaderValue("test_user", new SecureString("x-pack-test-password".toCharArray()));
|
||||||
|
|
||||||
|
@ -130,8 +130,8 @@ TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
|
||||||
.put("xpack.security.transport.ssl.enabled", "true")
|
.put("xpack.security.transport.ssl.enabled", "true")
|
||||||
...
|
...
|
||||||
.build())
|
.build())
|
||||||
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300))
|
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300))
|
||||||
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9301))
|
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9301))
|
||||||
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
|
|
||||||
|
@ -158,8 +158,8 @@ TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
|
||||||
.put("xpack.security.transport.ssl.enabled", "true")
|
.put("xpack.security.transport.ssl.enabled", "true")
|
||||||
...
|
...
|
||||||
.build())
|
.build())
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
.addTransportAddress(new TransportAddress("localhost", 9300))
|
||||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9301));
|
.addTransportAddress(new TransportAddress("localhost", 9301));
|
||||||
------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: If you are using a public CA that is already trusted by the Java runtime,
|
NOTE: If you are using a public CA that is already trusted by the Java runtime,
|
||||||
|
|
Loading…
Reference in New Issue