org.apache.directory.mitosis.common
Class Replica

java.lang.Object
  extended by org.apache.directory.mitosis.common.Replica

public class Replica
extends java.lang.Object

The class stores a Replica, which is composed of an Id, a server and a port.

Author:
Apache Directory Project

Constructor Summary
Replica(java.lang.String replica)
          Creates a new instance of Replica, from a String.
Replica(java.lang.String id, java.net.InetSocketAddress address)
          Creates a new instance of Replica, from a valid Id and a valid address.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.net.InetSocketAddress getAddress()
           
 java.lang.String getId()
           
 int hashCode()
          Compute the instance's hash code
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Replica

public Replica(java.lang.String replica)
Creates a new instance of Replica, from a String. The String format is the following : @:

Parameters:
replica - The replica to create

Replica

public Replica(java.lang.String id,
               java.net.InetSocketAddress address)
Creates a new instance of Replica, from a valid Id and a valid address.

Parameters:
id - The Replica Id
address - The server address.
Method Detail

getAddress

public java.net.InetSocketAddress getAddress()
Returns:
the replica address

getId

public java.lang.String getId()
Returns:
the replica Id

hashCode

public int hashCode()
Compute the instance's hash code

Overrides:
hashCode in class java.lang.Object
Returns:
the instance's hash code

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
The replica. The format is <replica id> '@' <server> ':' <port>


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.