Package com.hazelcast.cluster
Class Address
java.lang.Object
com.hazelcast.cluster.Address
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public final class Address extends Object implements IdentifiedDataSerializable
Represents an address of a member in the cluster.
-
Constructor Summary
Constructors Constructor Description Address()
Address(Address address)
Address(String host, int port)
Address(String hostname, InetAddress inetAddress, int port)
Address(InetAddress inetAddress, int port)
Address(InetSocketAddress inetSocketAddress)
Creates a new Address -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.String
getHost()
InetAddress
getInetAddress()
InetSocketAddress
getInetSocketAddress()
int
getPort()
String
getScopedHost()
String
getScopeId()
int
hashCode()
boolean
isIPv4()
boolean
isIPv6()
void
readData(ObjectDataInput in)
Reads fields from the input streamvoid
setScopeId(String scopeId)
String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
Constructor Details
-
Address
public Address() -
Address
- Throws:
UnknownHostException
-
Address
-
Address
Creates a new Address- Parameters:
inetSocketAddress
- the InetSocketAddress to use- Throws:
NullPointerException
- if inetSocketAddress is nullIllegalArgumentException
- if the address can't be resolved.
-
Address
-
Address
-
-
Method Details
-
getHost
-
getPort
public int getPort() -
getInetAddress
- Throws:
UnknownHostException
-
getInetSocketAddress
- Throws:
UnknownHostException
-
isIPv4
public boolean isIPv4() -
isIPv6
public boolean isIPv6() -
getScopeId
-
setScopeId
-
getScopedHost
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode() -
toString
-