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 aTarantoolServerAddress
instanceTarantoolServerAddress(InetSocketAddress socketAddress)
Auxiliary constructor for conversion betweenInetSocketAddress
andTarantoolServerAddress
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getHost()
Get the hostnameint
getPort()
Get the port numberInetSocketAddress
getSocketAddress()
Get the socket addressint
hashCode()
String
toString()
-
-
-
Constructor Detail
-
TarantoolServerAddress
public TarantoolServerAddress()
Creates a TarantoolServerAddress with default host and port
-
TarantoolServerAddress
public TarantoolServerAddress(String host, int port)
Creates aTarantoolServerAddress
instance- 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 betweenInetSocketAddress
andTarantoolServerAddress
- 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
-
-