ostore.tapestry.patchwork
Class RouterFaultMsg

java.lang.Object
  |
  +--ostore.network.NetworkMessage
        |
        +--ostore.tapestry.patchwork.RouterFaultMsg
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable

public class RouterFaultMsg
extends NetworkMessage
implements QuickSerializable

This is a message sent out by a testing stage to inform a peer's Router to start dropping messages.

Version:
$Id: RouterFaultMsg.java,v 1.5 2003/02/05 22:35:04 hling Exp $
Author:
Jeremy Stribling

Field Summary
 boolean allNodes
           
 boolean isPercent
           
 NodeId nodeToDrop
           
 int value
           
 
Fields inherited from class ostore.network.NetworkMessage
comp_q, inbound, peer, sender, tries, user_data
 
Constructor Summary
RouterFaultMsg(InputBuffer buffer)
           
RouterFaultMsg(NodeId peer, int value, boolean isPercent)
          Constucts a fault injection message, which will let a peer know that it should begin dropping messages.
RouterFaultMsg(NodeId peer, int value, boolean isPercent, boolean allNodes)
          Constucts a fault injection message, which will let a peer know that it should begin dropping messages.
RouterFaultMsg(NodeId peer, int value, boolean isPercent, NodeId nodeToDrop)
          Constucts a fault injection message, which will let a peer know that it should begin dropping messages.
 
Method Summary
 Object clone()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isPercent

public boolean isPercent

value

public int value

allNodes

public boolean allNodes

nodeToDrop

public NodeId nodeToDrop
Constructor Detail

RouterFaultMsg

public RouterFaultMsg(NodeId peer,
                      int value,
                      boolean isPercent,
                      NodeId nodeToDrop)
Constucts a fault injection message, which will let a peer know that it should begin dropping messages. Either an absolute number of messages can be specified, or a percentage of messages for an indefinite amount of time. Note that if a percentage is given, it can be removed by sending another fault injection message with the value at 0. Any arriving fault message overrides the previous one.
Parameters:
peer - the node to contact
value - the amount of messages to drop, either as a number of messages or a percent of messages
isPercent - true if value specifies a percentage
nodeToDrop - Drop messages from this node, rather than the sender

RouterFaultMsg

public RouterFaultMsg(NodeId peer,
                      int value,
                      boolean isPercent,
                      boolean allNodes)
Constucts a fault injection message, which will let a peer know that it should begin dropping messages. Either an absolute number of messages can be specified, or a percentage of messages for an indefinite amount of time. Note that if a percentage is given, it can be removed by sending another fault injection message with the value at 0. Any arriving fault message overrides the previous one.
Parameters:
peer - the node to contact
value - the amount of messages to drop, either as a number of messages or a percent of messages
isPercent - true if value specifies a percentage
allNodes - true if the router should apply these faults to all nodes

RouterFaultMsg

public RouterFaultMsg(NodeId peer,
                      int value,
                      boolean isPercent)
Constucts a fault injection message, which will let a peer know that it should begin dropping messages. Either an absolute number of messages can be specified, or a percentage of messages for an indefinite amount of time. Note that if a percentage is given, it can be removed by sending another fault injection message with the value at 0. Any arriving fault message overrides the previous one.
Parameters:
peer - the node to contact
value - the amount of messages to drop, either as a number of messages or a percent of messages
isPercent - true if value specifies a percentage

RouterFaultMsg

public RouterFaultMsg(InputBuffer buffer)
               throws QSException
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.
Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class NetworkMessage
Following copied from interface: ostore.util.QuickSerializable
Parameters:
buffer - the output buffer to add the object to

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class NetworkMessage

toString

public String toString()
Overrides:
toString in class NetworkMessage