Class TransportAddress
- java.lang.Object
-
- org.elasticsearch.common.transport.TransportAddress
-
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
public final class TransportAddress extends Object implements Writeable, ToXContentFragment
A transport address used for IP socket address (wrapsInetSocketAddress).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static InetAddressMETA_ADDRESSA non-routeable v4 meta transport address that can be used for testing or in scenarios where targets should be marked as non-applicable from a transport perspective.-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description TransportAddress(InetAddress address, int port)TransportAddress(InetSocketAddress address)TransportAddress(StreamInput in)Read from a stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetSocketAddressaddress()Returns the enclosedInetSocketAddressbooleanequals(Object o)StringgetAddress()Returns a string representation of the enclosedInetSocketAddressintgetPort()Returns the addresses portinthashCode()StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
META_ADDRESS
public static final InetAddress META_ADDRESS
A non-routeable v4 meta transport address that can be used for testing or in scenarios where targets should be marked as non-applicable from a transport perspective.
-
-
Constructor Detail
-
TransportAddress
public TransportAddress(InetAddress address, int port)
-
TransportAddress
public TransportAddress(InetSocketAddress address)
-
TransportAddress
public TransportAddress(StreamInput in) throws IOException
Read from a stream.- Throws:
IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getAddress
public String getAddress()
Returns a string representation of the enclosedInetSocketAddress- See Also:
NetworkAddress.format(InetAddress)
-
getPort
public int getPort()
Returns the addresses port
-
address
public InetSocketAddress address()
Returns the enclosedInetSocketAddress
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
-