Package org.jgroups.protocols.relay
Class SiteUUID
- java.lang.Object
-
- org.jgroups.util.UUID
-
- org.jgroups.util.FlagsUUID
-
- org.jgroups.util.ExtendedUUID
-
- org.jgroups.protocols.relay.SiteUUID
-
- All Implemented Interfaces:
java.lang.Comparable<Address>
,Address
,Constructable<UUID>
,SiteAddress
,SizeStreamable
,Streamable
- Direct Known Subclasses:
SiteMaster
public class SiteUUID extends ExtendedUUID implements SiteAddress
Implementation of SiteAddress- Since:
- 3.2
- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jgroups.protocols.relay.SiteAddress
SiteAddress.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
protected java.lang.String
site
-
Fields inherited from class org.jgroups.util.ExtendedUUID
keys, print_function, values
-
Fields inherited from class org.jgroups.util.UUID
leastSigBits, mostSigBits, SIZE
-
-
Constructor Summary
Constructors Constructor Description SiteUUID()
SiteUUID(long mostSigBits, long leastSigBits, byte[] name, byte[] site)
Deprecated.SiteUUID(long mostSigBits, long leastSigBits, java.lang.String name, java.lang.String site)
SiteUUID(UUID uuid, java.lang.String name, java.lang.String site)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Address other)
Compares this UUID with the specified UUID.UUID
copy()
java.util.function.Supplier<? extends UUID>
create()
Creates an instance of the class implementing this interfaceboolean
equals(java.lang.Object obj)
Compares this object to the specified object.java.lang.String
getName()
java.lang.String
getSite()
Returns the ID of the site (all sites need to have a unique site ID)int
hashCode()
Returns a hash code for thisUUID
.boolean
isSiteAddress()
Whether or not this address is aSiteAddress
.java.lang.String
print(boolean detailed)
protected java.lang.String
printOthers()
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()
The number of bytes required to serialize this instancejava.lang.String
toString()
void
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.-
Methods inherited from class org.jgroups.util.ExtendedUUID
addContents, get, get, keyExists, keyExists, length, print, put, put, put, randomUUID, randomUUID, read, remove, remove, resize, setPrintFunction, sizeofHashMap, write
-
Methods inherited from class org.jgroups.util.UUID
digits, fromString, generateRandomBytes, getLeastSignificantBits, getMostSignificantBits, printName, toStringLong
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jgroups.Address
isMulticast, isSiteMaster
-
Methods inherited from interface org.jgroups.protocols.relay.SiteAddress
type
-
-
-
-
Constructor Detail
-
SiteUUID
public SiteUUID()
-
SiteUUID
public SiteUUID(long mostSigBits, long leastSigBits, java.lang.String name, java.lang.String site)
-
SiteUUID
@Deprecated(since="5.2.15") public SiteUUID(long mostSigBits, long leastSigBits, byte[] name, byte[] site)
Deprecated.
-
SiteUUID
public SiteUUID(UUID uuid, java.lang.String name, java.lang.String site)
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getSite
public java.lang.String getSite()
Description copied from interface:SiteAddress
Returns the ID of the site (all sites need to have a unique site ID)- Specified by:
getSite
in interfaceSiteAddress
-
create
public java.util.function.Supplier<? extends UUID> create()
Description copied from interface:Constructable
Creates an instance of the class implementing this interface- Specified by:
create
in interfaceConstructable<UUID>
- Overrides:
create
in classExtendedUUID
-
toString
public java.lang.String toString()
- Overrides:
toString
in classExtendedUUID
-
hashCode
public int hashCode()
Description copied from class:UUID
Returns a hash code for thisUUID
.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:UUID
Compares this object to the specified object. The result istrue
if and only if the argument is notnull
, is aUUID
object, has the same variant, and contains the same value, bit for bit, as thisUUID
.
-
compareTo
public int compareTo(Address other)
Description copied from class:UUID
Compares this UUID with the specified UUID.The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID.
-
isSiteAddress
public boolean isSiteAddress()
Description copied from interface:Address
Whether or not this address is aSiteAddress
. Kludgey workaround to avoid the use ofinstanceof SiteAddress
.
Will be removed once the type pollution issue (https://bugs.openjdk.org/browse/JDK-8180450) is fixed.- Specified by:
isSiteAddress
in interfaceAddress
- Returns:
- True if this address is a site address, otherwise false
-
print
public java.lang.String print(boolean detailed)
-
serializedSize
public int serializedSize()
Description copied from class:ExtendedUUID
The number of bytes required to serialize this instance- Specified by:
serializedSize
in interfaceSizeStreamable
- Overrides:
serializedSize
in classExtendedUUID
-
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 classExtendedUUID
- 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 classExtendedUUID
- Throws:
java.io.IOException
-
printOthers
protected java.lang.String printOthers()
-
-