jgroup.relacs.mss
Class MssHost

java.lang.Object
  extended by jgroup.relacs.mss.MssHost
All Implemented Interfaces:
MssConstants, MssTag

public class MssHost
extends java.lang.Object
implements MssConstants, MssTag

The MssHost class

Since:
Jgroup 0.5
Author:
Salvatore Cammarrata, Hein Meling

Field Summary
 
Fields inherited from interface jgroup.relacs.mss.MssConstants
ALL, EHANDLER_PRIORITY, HEADER_SIZE, MINIMUM_ALIVE_VALUE, MSS_HEADER_SIZE, MSSUSER_PRIORITY, NACKSUPPRESSION, NI_PRIORITY, OVERHEAD_SIZE, ROUTING_ENABLED, TRAILER_SIZE, UNDEF, UNREACHABLE
 
Fields inherited from interface jgroup.relacs.mss.MssTag
ASYN, CONGESTION, EXTERNFC, FWDROUTING, IAMALIVE, JG, LOCALFC, NACK, NOTLASTFRAGMENT, PING_OBJECT, QSYN, REMOTENACK, ROUTING, SENT, SENTNACK, SYN, TAGTYPE, TOPOLOGY
 
Constructor Summary
MssHost(TransportConfig config, EndPoint hostEndPoint, jgroup.relacs.mss.NI ni, jgroup.relacs.mss.Cluster cluster, EventHandler ehandler)
          Builds a host object identified by hostEndPoint.
 
Method Summary
 void abortTimeout()
          Aborts the timeout that has been set up for performing periodic synchronization ping.
 boolean checkSynId(int msgId)
          Checks if the given message identifier corresponds to the last SYN message sent from this host.
 boolean equals(java.lang.Object obj)
          Compares two objects for content equality.
 void flush()
          Flush the sent queue up until the last message ACKed.
 void flush(int lastMsgAcked)
          Flush the sent queue up until the last message ACKed.
 jgroup.relacs.mss.Cluster getCluster()
           
 int getClusterIndex()
          Get this host's position (index) in the cluster.
 EndPoint getEndPoint()
           
 int getIncarnationId()
           
 int getIndex()
          Get this host's position (index) in the hosttable.
 jgroup.relacs.mss.MsgFlowRcvrSide getMsgFlow()
           
 int getTimeout()
          Returns the timeout value associated with this host.
 int hashCode()
          Returns a hash code value for this host.
 boolean isIn(jgroup.relacs.mss.Cluster theCluster)
          Returns true if this host is in the given cluster; otherwise false is returned.
 boolean isLocal()
           
 boolean isReachable()
          Returns true if this host is considered reachable.
 boolean isReachable(int threshold)
          Returns true if this host is considered reachable within the given threshold.
 void printReachParams()
          Method used to print the reachability and timeout parameters associated with this host, if they have changed since its last invocation.
 void scheduleTimeout()
          Schedule a timer for the synchronization (QSYN) message sent to this member.
 void setAsReachable()
          Mark this host as reachable.
 void setClusterIndex(int index)
          Set this host's position (index) in the cluster.
 void setIncarnationId(int incarnationId)
           
 void setIndex(int index)
          Set this host's position (index) in the hosttable.
 java.lang.String toString()
          Returns a string representation of this object.
 void updateTimeout(int t)
          Recompute the round-trip timeout, standard deviation and timeout values associated with this host.
 boolean wasReachable()
          Returns true if this host was reachable on prior to the last reachability update.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MssHost

public MssHost(TransportConfig config,
               EndPoint hostEndPoint,
               jgroup.relacs.mss.NI ni,
               jgroup.relacs.mss.Cluster cluster,
               EventHandler ehandler)
        throws ConfigurationException
Builds a host object identified by hostEndPoint.

Throws:
ConfigurationException
Method Detail

getEndPoint

public EndPoint getEndPoint()

isLocal

public boolean isLocal()

getIncarnationId

public int getIncarnationId()

setIncarnationId

public void setIncarnationId(int incarnationId)

isIn

public boolean isIn(jgroup.relacs.mss.Cluster theCluster)
Returns true if this host is in the given cluster; otherwise false is returned.


getCluster

public jgroup.relacs.mss.Cluster getCluster()

getClusterIndex

public int getClusterIndex()
Get this host's position (index) in the cluster.


setClusterIndex

public void setClusterIndex(int index)
Set this host's position (index) in the cluster.


setIndex

public void setIndex(int index)
Set this host's position (index) in the hosttable.


getIndex

public int getIndex()
Get this host's position (index) in the hosttable.


getTimeout

public int getTimeout()
Returns the timeout value associated with this host.


updateTimeout

public void updateTimeout(int t)
Recompute the round-trip timeout, standard deviation and timeout values associated with this host.

Parameters:
t - an int value

abortTimeout

public void abortTimeout()
Aborts the timeout that has been set up for performing periodic synchronization ping.


scheduleTimeout

public void scheduleTimeout()
Schedule a timer for the synchronization (QSYN) message sent to this member. The initial QSYN message is sent after no delay.


checkSynId

public boolean checkSynId(int msgId)
Checks if the given message identifier corresponds to the last SYN message sent from this host. True is returned if this is the case; false otherwise.

Parameters:
msgId - The message identifier to check if was the last SYN message sent.
Returns:
True is returned if the last SYN message sent by this MssHost is equal to the given message identifier; otherwise false is returned.

isReachable

public boolean isReachable(int threshold)
Returns true if this host is considered reachable within the given threshold.


isReachable

public boolean isReachable()
Returns true if this host is considered reachable. That is with a reachability threshold equal to MINIMUM_ALIVE_VALUE.


wasReachable

public boolean wasReachable()
Returns true if this host was reachable on prior to the last reachability update.


setAsReachable

public void setAsReachable()
Mark this host as reachable.


flush

public void flush()
Flush the sent queue up until the last message ACKed.


flush

public void flush(int lastMsgAcked)
Flush the sent queue up until the last message ACKed.

Parameters:
lastMsgAcked - The last message ACKed.

getMsgFlow

public jgroup.relacs.mss.MsgFlowRcvrSide getMsgFlow()

printReachParams

public void printReachParams()
Method used to print the reachability and timeout parameters associated with this host, if they have changed since its last invocation.


hashCode

public int hashCode()
Returns a hash code value for this host.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compares two objects for content equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with
Returns:
true if these objects are equal; false otherwise.


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.