Package io.tarantool.driver.api
Class TarantoolServerAddress
- java.lang.Object
-
- io.tarantool.driver.api.TarantoolServerAddress
-
- All Implemented Interfaces:
Serializable
public class TarantoolServerAddress extends Object implements Serializable
Represents the location of a Tarantool server - server name and port number- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TarantoolServerAddress()Creates a TarantoolServerAddress with default host and portTarantoolServerAddress(String address)Create a TarantoolServerAddress from connection string e.g. 127.0.0.1:3301, localhost:3301, [::1]:3301, user:password@localhost:3301, user:password@[::1]:3301TarantoolServerAddress(String host, int port)Creates aTarantoolServerAddressinstanceTarantoolServerAddress(InetSocketAddress socketAddress)Auxiliary constructor for conversion betweenInetSocketAddressandTarantoolServerAddress
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetHost()Get the hostnameintgetPort()Get the port numberInetSocketAddressgetSocketAddress()Get the socket addressinthashCode()StringtoString()
-
-
-
Constructor Detail
-
TarantoolServerAddress
public TarantoolServerAddress()
Creates a TarantoolServerAddress with default host and port
-
TarantoolServerAddress
public TarantoolServerAddress(String host, int port)
Creates aTarantoolServerAddressinstance- Parameters:
host- hostname
-
TarantoolServerAddress
public TarantoolServerAddress(String address)
Create a TarantoolServerAddress from connection string e.g. 127.0.0.1:3301, localhost:3301, [::1]:3301, user:password@localhost:3301, user:password@[::1]:3301- Parameters:
address- address to Tarantool
-
TarantoolServerAddress
public TarantoolServerAddress(InetSocketAddress socketAddress)
Auxiliary constructor for conversion betweenInetSocketAddressandTarantoolServerAddress- Parameters:
socketAddress- remote server address
-
-
Method Detail
-
getHost
public String getHost()
Get the hostname- Returns:
- hostname
-
getPort
public int getPort()
Get the port number- Returns:
- port
-
getSocketAddress
public InetSocketAddress getSocketAddress() throws TarantoolSocketException
Get the socket address- Returns:
- socket address
- Throws:
TarantoolSocketException
-
-