Package org.jgroups
Class AnycastAddress
- java.lang.Object
-
- org.jgroups.AnycastAddress
-
- All Implemented Interfaces:
java.lang.Comparable<Address>
,Address
,Constructable<AnycastAddress>
,SizeStreamable
,Streamable
public class AnycastAddress extends java.lang.Object implements Address, Constructable<AnycastAddress>
This type of address represents a subset of the cluster members in which the total order properties must be applied, e.g. if the cluster membership is {A,B,C,D,E}, an AnycastAddress could be {D,E}.- Since:
- 3.1
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<Address>
destinations
-
Fields inherited from interface org.jgroups.Address
IP_ADDR, IP_ADDR_UUID, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
-
-
Constructor Summary
Constructors Constructor Description AnycastAddress()
AnycastAddress(java.util.Collection<Address> addresses)
AnycastAddress(Address... addresses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Address... addresses)
void
addAll(java.util.Collection<Address> addresses)
int
compareTo(Address o)
java.util.function.Supplier<? extends AnycastAddress>
create()
Creates an instance of the class implementing this interfaceboolean
equals(java.lang.Object o)
java.util.Optional<java.util.Collection<Address>>
findAddresses()
java.util.Collection<Address>
getAddresses()
int
hashCode()
protected void
internalAdd(Address address)
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()
void
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
-
-
-
Field Detail
-
destinations
protected java.util.Collection<Address> destinations
-
-
Method Detail
-
create
public java.util.function.Supplier<? extends AnycastAddress> create()
Description copied from interface:Constructable
Creates an instance of the class implementing this interface- Specified by:
create
in interfaceConstructable<AnycastAddress>
-
add
public void add(Address... addresses)
-
internalAdd
protected void internalAdd(Address address)
-
addAll
public void addAll(java.util.Collection<Address> addresses)
-
getAddresses
public java.util.Collection<Address> getAddresses()
-
findAddresses
public java.util.Optional<java.util.Collection<Address>> findAddresses()
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object- Specified by:
serializedSize
in interfaceSizeStreamable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(Address o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Address>
-
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
- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
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
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-