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)
protected
IpAddressUUID(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 int
compareTo(Address o)
implements the java.lang.Comparable interfaceIpAddress
copy()
java.util.function.Supplier<? extends IpAddress>
create()
Creates an instance of the class implementing this interfaceprotected static long[]
createUUID()
boolean
equals(java.lang.Object obj)
void
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedint
serializedSize()
Returns the size (in bytes) of the marshalled objectjava.lang.String
toString()
java.lang.String
toString(boolean detailed)
void
writeTo(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:IpAddress
implements the java.lang.Comparable interface- Specified by:
compareTo
in interfacejava.lang.Comparable<Address>
- Overrides:
compareTo
in 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:Constructable
Creates an instance of the class implementing this interface- Specified by:
create
in interfaceConstructable<IpAddress>
- Overrides:
create
in classIpAddress
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeTo
in interfaceStreamable
- Overrides:
writeTo
in classIpAddress
- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException
Description copied from interface:Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classIpAddress
- Throws:
java.io.IOException
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object- Specified by:
serializedSize
in interfaceSizeStreamable
- Overrides:
serializedSize
in classIpAddress
-
toString
public java.lang.String toString(boolean detailed)
-
createUUID
protected static long[] createUUID()
-
-