package org.sfc.net.p2p;
import java.net.InetAddress;
import java.net.InetSocketAddress;
/**
* This interface is common to all software components that offer p2p
* functionality.
*
* @author Thomas Weise
*/
public interface IPeerToPeer
{
/**
* Add a peer to the internal peer list.
* @param p_port The port where the peer listens, if this parameter is
* invalid, we will try to use the same port we're currently
* running on.
* @param p_i The internet address the peer is located at.
* @return <code>true</code> if and only if the peer was not yet known and
* has been added successfully.
*/
public abstract boolean add_peer (final InetAddress p_i,
final int p_port);
/**
* Add a peer to the internal peer list.
* @param p_isa The internet address and port the peer is located at.
* @return <code>true</code> if and only if the peer was not yet known and
* has been added successfully.
*/
public abstract boolean add_peer (final InetSocketAddress p_isa);
/**
* Remove a peer from the internal peer list.
* @param p_isa The internet address and port the peer is located at.
* @return <code>true</code> if and only if the peer was known and
* has been removed successfully.
*/
public abstract boolean remove_peer (final InetSocketAddress p_isa);
}