public class View extends Object implements Externalizable, Cloneable, Streamable
Modifier and Type | Field and Description |
---|---|
protected Vector<Address> |
members
A list containing all the members of the view
This list is always ordered, with the coordinator being the first member.
|
protected Map<String,Object> |
payload
Deprecated.
|
protected ViewId |
vid |
Constructor and Description |
---|
View()
creates an empty view, should not be used
|
View(Address creator,
long id,
Collection<Address> members)
Creates a new view
|
View(ViewId vid,
Collection<Address> members) |
View(ViewId vid,
Vector<Address> members)
Creates a new view
|
Modifier and Type | Method and Description |
---|---|
void |
addPayload(String key,
Object value)
Deprecated.
Will be removed in 3.0
|
Object |
clone()
creates a copy of this view
|
boolean |
containsMember(Address mbr)
returns true, if this view contains a certain member
|
View |
copy() |
boolean |
equals(Object obj) |
Address |
getCreator()
returns the creator of this view
if this view was created with the empty constructur, null will be returned
|
Vector<Address> |
getMembers()
Returns a reference to the List of members (ordered)
Do NOT change this list, hence your will invalidate the view
Make a copy if you have to modify it.
|
Object |
getPayload(String key)
Deprecated.
Will be removed in 3.0
|
ViewId |
getVid()
returns the view ID of this view
if this view was created with the empty constructur, null will be returned
|
ViewId |
getViewId() |
int |
hashCode() |
String |
printDetails()
debug only
|
void |
readExternal(ObjectInput in) |
void |
readFrom(DataInputStream in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
Object |
removePayload(String key)
Deprecated.
Will be removed in 3.0
|
int |
serializedSize() |
int |
size()
returns the number of members in this view
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
void |
writeTo(DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected ViewId vid
protected Vector<Address> members
@Deprecated protected Map<String,Object> payload
public View()
public View(ViewId vid, Vector<Address> members)
vid
- The view id of this view (can not be null)members
- Contains a list of all the members in the view, can be empty but not null.public View(ViewId vid, Collection<Address> members)
public View(Address creator, long id, Collection<Address> members)
creator
- The creator of this view (can not be null)id
- The lamport timestamp of this viewmembers
- Contains a list of all the members in the view, can be empty but not null.public ViewId getVid()
public ViewId getViewId()
public Address getCreator()
public Vector<Address> getMembers()
public boolean containsMember(Address mbr)
mbr
- - the address of the member,public int size()
public View copy()
public Object clone()
public String printDetails()
public void addPayload(String key, Object value)
key
- value
- public Object removePayload(String key)
key
- public Object getPayload(String key)
key
- public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeTo(DataOutputStream out) throws IOException
Streamable
writeTo
in interface Streamable
IOException
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
Streamable
readFrom
in interface Streamable
IOException
IllegalAccessException
InstantiationException
public int serializedSize()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.