peerbase
Class PeerInfo

java.lang.Object
  extended by peerbase.PeerInfo

public class PeerInfo
extends java.lang.Object

Maintains information related to the location of a peer node in the system, along with the peer's (unique) identifier in the peer-to- peer network.

Author:
Nadeem Abdul Hamid

Constructor Summary
PeerInfo(int port)
          Creates a PeerInfo object storing only the TCP port number.
PeerInfo(java.lang.String host, int port)
          Creates and initializes a new PeerInfo object, with the peer's identifier set to "host:port".
PeerInfo(java.lang.String id, java.lang.String host, int port)
          Creates and initializes a new PeerInfo object.
 
Method Summary
 java.lang.String getHost()
           
 java.lang.String getId()
           
 int getPort()
           
 void setHost(java.lang.String host)
           
 void setId(java.lang.String id)
           
 void setPort(int port)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerInfo

public PeerInfo(java.lang.String id,
                java.lang.String host,
                int port)
Creates and initializes a new PeerInfo object.

Parameters:
id - this peer's (unique) identifier in the peer-to-peer system
host - the IP address
port - the TCP port number

PeerInfo

public PeerInfo(java.lang.String host,
                int port)
Creates and initializes a new PeerInfo object, with the peer's identifier set to "host:port".

Parameters:
host - the IP address
port - the TCP port number

PeerInfo

public PeerInfo(int port)
Creates a PeerInfo object storing only the TCP port number.

Method Detail

getHost

public java.lang.String getHost()
Returns:
the host

getId

public java.lang.String getId()
Returns:
the id

getPort

public int getPort()
Returns:
the port

setHost

public void setHost(java.lang.String host)
Parameters:
host - the host to set

setId

public void setId(java.lang.String id)
Parameters:
id - the id to set

setPort

public void setPort(int port)
Parameters:
port - the port to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object