Package org.jgroups.stack
Class IpAddressUUID
- java.lang.Object
-
- org.jgroups.stack.IpAddress
-
- org.jgroups.stack.IpAddressUUID
-
- All Implemented Interfaces:
java.lang.Comparable<Address>,Address,Constructable<IpAddress>,PhysicalAddress,SizeStreamable,Streamable
public class IpAddressUUID extends IpAddress
IpAddress with a 'semi'-UUID to prevent reincarnation when the port is fixed. The randomness is given through a long and an int. On 64-bit architectures, this increases the memory size from 24 to 32 bytes per instance.See https://issues.jboss.org/browse/JGRP-2080 for details
- Since:
- 4.0
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Modifier Constructor Description IpAddressUUID()IpAddressUUID(int port)IpAddressUUID(int port, boolean set_default_host)IpAddressUUID(java.lang.String addr_port)IpAddressUUID(java.lang.String i, int p)IpAddressUUID(java.net.InetAddress i, int p)protectedIpAddressUUID(java.net.InetAddress i, int p, long low, int high)IpAddressUUID(java.net.InetSocketAddress sock_addr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Address o)implements the java.lang.Comparable interfaceIpAddresscopy()java.util.function.Supplier<? extends IpAddress>create()Creates an instance of the class implementing this interfaceprotected static long[]createUUID()booleanequals(java.lang.Object obj)voidreadFrom(java.io.DataInput in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedintserializedSize()Returns the size (in bytes) of the marshalled objectjava.lang.StringtoString()java.lang.StringtoString(boolean detailed)voidwriteTo(java.io.DataOutput out)Write the entire state of the current object (including superclasses) to outstream.-
Methods inherited from class org.jgroups.stack.IpAddress
getIpAddress, getPort, hashCode, printIpAddress, printIpAddress2, setAddressToLocalHost
-
-
-
-
Constructor Detail
-
IpAddressUUID
public IpAddressUUID()
-
IpAddressUUID
public IpAddressUUID(java.lang.String addr_port) throws java.lang.Exception- Throws:
java.lang.Exception
-
IpAddressUUID
public IpAddressUUID(java.net.InetAddress i, int p)
-
IpAddressUUID
public IpAddressUUID(java.lang.String i, int p) throws java.net.UnknownHostException- Throws:
java.net.UnknownHostException
-
IpAddressUUID
public IpAddressUUID(int port)
-
IpAddressUUID
public IpAddressUUID(int port, boolean set_default_host)
-
IpAddressUUID
public IpAddressUUID(java.net.InetSocketAddress sock_addr)
-
IpAddressUUID
protected IpAddressUUID(java.net.InetAddress i, int p, long low, int high)
-
-
Method Detail
-
compareTo
public int compareTo(Address o)
Description copied from class:IpAddressimplements the java.lang.Comparable interface- Specified by:
compareToin interfacejava.lang.Comparable<Address>- Overrides:
compareToin classIpAddress- Parameters:
o- - the Object to be compared- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- See Also:
Comparable
-
create
public java.util.function.Supplier<? extends IpAddress> create()
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<IpAddress>- Overrides:
createin classIpAddress
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classIpAddress- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classIpAddress- Throws:
java.io.IOException
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object- Specified by:
serializedSizein interfaceSizeStreamable- Overrides:
serializedSizein classIpAddress
-
toString
public java.lang.String toString(boolean detailed)
-
createUUID
protected static long[] createUUID()
-
-