Class TransportAddress
java.lang.Object
org.elasticsearch.common.transport.TransportAddress
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public final class TransportAddress
extends Object
implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
A transport address used for IP socket address (wraps
InetSocketAddress
).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic InetAddress
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.Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionTransportAddress(InetAddress address, int port)
TransportAddress(InetSocketAddress address)
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionaddress()
Returns the enclosedInetSocketAddress
boolean
Returns a string representation of the enclosedInetSocketAddress
int
getPort()
Returns the addresses portint
hashCode()
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(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 Details
-
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 Details
-
TransportAddress
-
TransportAddress
-
TransportAddress
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
getAddress
Returns a string representation of the enclosedInetSocketAddress
- See Also:
NetworkAddress.format(InetAddress)
-
getPort
public int getPort()Returns the addresses port -
address
Returns the enclosedInetSocketAddress
-
equals
-
hashCode
public int hashCode() -
toString
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-