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 voidadd(Address... addresses)voidaddAll(java.util.Collection<Address> addresses)intcompareTo(Address o)java.util.function.Supplier<? extends AnycastAddress>create()Creates an instance of the class implementing this interfacebooleanequals(java.lang.Object o)java.util.Optional<java.util.Collection<Address>>findAddresses()java.util.Collection<Address>getAddresses()inthashCode()protected voidinternalAdd(Address address)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()voidwriteTo(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:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin 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:SizeStreamableReturns the size (in bytes) of the marshalled object- Specified by:
serializedSizein interfaceSizeStreamable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(Address o)
- Specified by:
compareToin interfacejava.lang.Comparable<Address>
-
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- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription 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- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-