Package org.jgroups.protocols.relay
Class RelayHeader
- java.lang.Object
-
- org.jgroups.Header
-
- org.jgroups.protocols.relay.RelayHeader
-
- All Implemented Interfaces:
Constructable<Header>
,SizeStreamable
,Streamable
public class RelayHeader extends Header
- Since:
- 5.2.15
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description static byte
DATA
protected Address
final_dest
static byte
MBR_UNREACHABLE
protected short
original_flags
protected Header[]
original_hdrs
protected Address
original_sender
protected boolean
return_entire_cache
static byte
SITE_UNREACHABLE
protected java.util.Set<java.lang.String>
sites
static byte
SITES_DOWN
static byte
SITES_UP
static byte
TOPO_REQ
static byte
TOPO_RSP
protected byte
type
protected java.util.Set<java.lang.String>
visited_sites
-
Constructor Summary
Constructors Constructor Description RelayHeader()
RelayHeader(byte type)
RelayHeader(byte type, Address final_dest, Address original_sender)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RelayHeader
addToSites(java.lang.String... s)
RelayHeader
addToSites(java.util.Collection<java.lang.String> s)
RelayHeader
addToVisitedSites(java.lang.String s)
RelayHeader
addToVisitedSites(java.util.Collection<java.lang.String> list)
protected void
assertNonNullSites()
RelayHeader
copy()
java.util.function.Supplier<? extends Header>
create()
Creates an instance of the class implementing this interfaceAddress
getFinalDest()
short
getMagicId()
Returns the magic-ID.Address
getOriginalSender()
java.lang.String
getSite()
java.util.Set<java.lang.String>
getSites()
byte
getType()
java.util.Set<java.lang.String>
getVisitedSites()
boolean
hasSites()
boolean
hasVisitedSites()
short
originalFlags()
RelayHeader
originalFlags(short fl)
Header[]
originalHeaders()
RelayHeader
originalHeaders(Header[] hdrs)
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 closedboolean
returnEntireCache()
RelayHeader
returnEntireCache(boolean b)
int
serializedSize()
Returns the size (in bytes) of the marshalled objectRelayHeader
setFinalDestination(Address d)
RelayHeader
setOriginalSender(Address s)
protected static int
sizeOf(java.util.Collection<java.lang.String> list)
java.lang.String
toString()
protected static java.lang.String
typeToString(byte type)
void
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
-
-
-
Field Detail
-
DATA
public static final byte DATA
- See Also:
- Constant Field Values
-
SITE_UNREACHABLE
public static final byte SITE_UNREACHABLE
- See Also:
- Constant Field Values
-
MBR_UNREACHABLE
public static final byte MBR_UNREACHABLE
- See Also:
- Constant Field Values
-
SITES_UP
public static final byte SITES_UP
- See Also:
- Constant Field Values
-
SITES_DOWN
public static final byte SITES_DOWN
- See Also:
- Constant Field Values
-
TOPO_REQ
public static final byte TOPO_REQ
- See Also:
- Constant Field Values
-
TOPO_RSP
public static final byte TOPO_RSP
- See Also:
- Constant Field Values
-
type
protected byte type
-
final_dest
protected Address final_dest
-
original_sender
protected Address original_sender
-
sites
protected java.util.Set<java.lang.String> sites
-
visited_sites
protected java.util.Set<java.lang.String> visited_sites
-
return_entire_cache
protected boolean return_entire_cache
-
original_hdrs
protected Header[] original_hdrs
-
original_flags
protected short original_flags
-
-
Method Detail
-
getMagicId
public short getMagicId()
Description copied from class:Header
Returns the magic-ID. If defined in jg-magic-map.xml, the IDs need to be the same- Specified by:
getMagicId
in classHeader
-
create
public java.util.function.Supplier<? extends Header> create()
Description copied from interface:Constructable
Creates an instance of the class implementing this interface
-
getType
public byte getType()
-
getFinalDest
public Address getFinalDest()
-
setFinalDestination
public RelayHeader setFinalDestination(Address d)
-
getOriginalSender
public Address getOriginalSender()
-
setOriginalSender
public RelayHeader setOriginalSender(Address s)
-
getSites
public java.util.Set<java.lang.String> getSites()
-
hasSites
public boolean hasSites()
-
returnEntireCache
public boolean returnEntireCache()
-
returnEntireCache
public RelayHeader returnEntireCache(boolean b)
-
originalHeaders
public Header[] originalHeaders()
-
originalHeaders
public RelayHeader originalHeaders(Header[] hdrs)
-
originalFlags
public short originalFlags()
-
originalFlags
public RelayHeader originalFlags(short fl)
-
getSite
public java.lang.String getSite()
-
addToSites
public RelayHeader addToSites(java.util.Collection<java.lang.String> s)
-
addToSites
public RelayHeader addToSites(java.lang.String... s)
-
addToVisitedSites
public RelayHeader addToVisitedSites(java.lang.String s)
-
addToVisitedSites
public RelayHeader addToVisitedSites(java.util.Collection<java.lang.String> list)
-
hasVisitedSites
public boolean hasVisitedSites()
-
getVisitedSites
public java.util.Set<java.lang.String> getVisitedSites()
-
copy
public RelayHeader copy()
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object
-
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- 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- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
typeToString
protected static java.lang.String typeToString(byte type)
-
sizeOf
protected static int sizeOf(java.util.Collection<java.lang.String> list)
-
assertNonNullSites
protected void assertNonNullSites()
-
-