com.sleepycat.je.rep.impl
Class RepNodeImpl

java.lang.Object
  extended by com.sleepycat.je.rep.impl.RepNodeImpl
All Implemented Interfaces:
ReplicationNode

public class RepNodeImpl
extends Object
implements ReplicationNode

Describes a node that is a member of the replication group.


Field Summary
(package private) static int NULL_CHANGE
           
 
Constructor Summary
RepNodeImpl(NameIdPair nameIdPair, NodeType type, boolean quorumAck, boolean isRemoved, String hostName, int port, int changeVersion)
           
RepNodeImpl(NameIdPair nameIdPair, NodeType type, boolean quorumAck, boolean isRemoved, String hostName, int port, RepGroupImpl.BarrierState barrierState, int changeVersion)
           
RepNodeImpl(NameIdPair nameIdPair, NodeType type, String hostName, int port)
           
RepNodeImpl(Protocol.NodeGroupInfo mi)
           
RepNodeImpl(ReplicationConfig repConfig)
           
RepNodeImpl(String nodeName, String hostName, int port)
           
 
Method Summary
 boolean equals(Object obj)
           
 boolean equivalent(RepNodeImpl mi)
          Like the equals method.
 RepGroupImpl.BarrierState getBarrierState()
           
 int getChangeVersion()
           
 String getHostName()
          Returns the host name associated with the node.
 String getHostPortPair()
           
 String getName()
          Returns the unique name associated with the node.
 NameIdPair getNameIdPair()
           
 int getNodeId()
           
 int getPort()
          Returns the port number associated with the node.
 InetSocketAddress getSocketAddress()
          The socket address used by other nodes in the replication group to communicate with this node.
 NodeType getType()
          Returns the type associated with the node.
 int hashCode()
           
 boolean isQuorumAck()
           
 boolean isRemoved()
           
 RepGroupImpl.BarrierState setBarrierState(RepGroupImpl.BarrierState barrierState)
           
 void setChangeVersion(int changeVersion)
           
 void setHostName(String hostName)
           
 void setPort(int port)
           
 void setQuorumAck(boolean quorumAck)
           
 void setRemoved(boolean isRemoved)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_CHANGE

static final int NULL_CHANGE
See Also:
Constant Field Values
Constructor Detail

RepNodeImpl

public RepNodeImpl(NameIdPair nameIdPair,
                   NodeType type,
                   boolean quorumAck,
                   boolean isRemoved,
                   String hostName,
                   int port,
                   RepGroupImpl.BarrierState barrierState,
                   int changeVersion)

RepNodeImpl

public RepNodeImpl(NameIdPair nameIdPair,
                   NodeType type,
                   boolean quorumAck,
                   boolean isRemoved,
                   String hostName,
                   int port,
                   int changeVersion)

RepNodeImpl

public RepNodeImpl(NameIdPair nameIdPair,
                   NodeType type,
                   String hostName,
                   int port)

RepNodeImpl

public RepNodeImpl(ReplicationConfig repConfig)

RepNodeImpl

public RepNodeImpl(String nodeName,
                   String hostName,
                   int port)

RepNodeImpl

public RepNodeImpl(Protocol.NodeGroupInfo mi)
Method Detail

getSocketAddress

public InetSocketAddress getSocketAddress()
Description copied from interface: ReplicationNode
The socket address used by other nodes in the replication group to communicate with this node.

Specified by:
getSocketAddress in interface ReplicationNode
Returns:
the socket address

isQuorumAck

public boolean isQuorumAck()

isRemoved

public boolean isRemoved()

setChangeVersion

public void setChangeVersion(int changeVersion)

getChangeVersion

public int getChangeVersion()

getNameIdPair

public NameIdPair getNameIdPair()

getName

public String getName()
Description copied from interface: ReplicationNode
Returns the unique name associated with the node.

Specified by:
getName in interface ReplicationNode
Returns:
the name of the node.

getNodeId

public int getNodeId()

getType

public NodeType getType()
Description copied from interface: ReplicationNode
Returns the type associated with the node.

Specified by:
getType in interface ReplicationNode
Returns:
one of ELECTABLE or MONITOR

getHostName

public String getHostName()
Description copied from interface: ReplicationNode
Returns the host name associated with the node.

Specified by:
getHostName in interface ReplicationNode
Returns:
the host name of the node.

setHostName

public void setHostName(String hostName)

getPort

public int getPort()
Description copied from interface: ReplicationNode
Returns the port number associated with the node.

Specified by:
getPort in interface ReplicationNode
Returns:
the port number of the node.

setPort

public void setPort(int port)

getHostPortPair

public String getHostPortPair()

getBarrierState

public RepGroupImpl.BarrierState getBarrierState()

setBarrierState

public RepGroupImpl.BarrierState setBarrierState(RepGroupImpl.BarrierState barrierState)

setQuorumAck

public void setQuorumAck(boolean quorumAck)

setRemoved

public void setRemoved(boolean isRemoved)

toString

public String toString()
Overrides:
toString in class Object

equivalent

public boolean equivalent(RepNodeImpl mi)
Like the equals method. It considers all fields except for the quorumAck field and the nodeId (since it may not have been resolved as yet)

Parameters:
mi - the other object in the comparison
Returns:
true if the two are equivalent

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright (c) 2004-2012 Oracle. All rights reserved.