Package com.hazelcast.cluster
Class Address
java.lang.Object
com.hazelcast.cluster.Address
- All Implemented Interfaces:
- DataSerializable,- IdentifiedDataSerializable
Represents an address of a member in the cluster.
- 
Constructor SummaryConstructorsConstructorDescriptionAddress()Address(String hostname, InetAddress inetAddress, int port) Address(InetAddress inetAddress, int port) Address(InetSocketAddress inetSocketAddress) Creates a new Address
- 
Method SummaryModifier and TypeMethodDescriptionstatic AddresscreateUnresolvedAddress(String host, int port) Creates an unresolved address.booleanintReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.getHost()intgetPort()inthashCode()booleanisIPv4()booleanisIPv6()voidReads fields from the input streamvoidsetScopeId(String scopeId) toString()voidWrites object fields to output stream
- 
Constructor Details- 
Addresspublic Address()
- 
Address- Throws:
- UnknownHostException
 
- 
Address
- 
AddressCreates a new Address- Parameters:
- inetSocketAddress- the InetSocketAddress to use
- Throws:
- NullPointerException- if inetSocketAddress is null
- IllegalArgumentException- if the address can't be resolved.
 
- 
Address
- 
Address
 
- 
- 
Method Details- 
getHost
- 
getPortpublic int getPort()
- 
getInetAddress- Throws:
- UnknownHostException
 
- 
getInetSocketAddress- Throws:
- UnknownHostException
 
- 
isIPv4public boolean isIPv4()
- 
isIPv6public boolean isIPv6()
- 
getScopeId
- 
setScopeId
- 
getScopedHost
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
createUnresolvedAddressCreates an unresolved address. This API is used by the client for the case where the hostname can not be resolved. Members achieve the same thing via Serialization where we don't resolve the hostname when Address comes as Data from another member.- Parameters:
- host- hostname or IP
- Returns:
- an unresolved address
 
 
-