com.evolution.player.core.network
Interface INetwork


public interface INetwork

Central hub for all network related information. The network knows about the root node (you) all nodes connected to the root node and all known nodes. A network listener can be attached to the network to be notified about changes in the network topology.

Clients must not implement.

Since:
0.6
See Also:
EvolutionPlayerCore.getNetwork()

Nested Class Summary
static class INetwork.NetworkListener
          A listener for changes in the network
 
Method Summary
 void addNetworkListener(INetwork.NetworkListener listener)
          Add the given listener to the list of network listeners.
 IRemoteNetworkNode[] getConnectedNodes()
          Get all nodes to which the root is connected to.
 IRemoteNetworkNode[] getKnownNodes()
          Get all nodes known to the network.
 IRemoteNetworkNode getNode(java.util.UUID uuid)
          Find the node with the given id, if known.
 IClient getRoot()
          The root node of the network.
 void removeNetworkListener(INetwork.NetworkListener listener)
          Remove the given listener from the list of network listeners.
 

Method Detail

getRoot

IClient getRoot()
The root node of the network. The root node is your node.

Returns:
the root node.

getNode

IRemoteNetworkNode getNode(java.util.UUID uuid)
Find the node with the given id, if known.

Parameters:
uuid - the id of the node the retrieve
Returns:
the node with the given id or null

getConnectedNodes

IRemoteNetworkNode[] getConnectedNodes()
Get all nodes to which the root is connected to.

Returns:
all connected nodes.

getKnownNodes

IRemoteNetworkNode[] getKnownNodes()
Get all nodes known to the network.

Returns:
all known nodes

addNetworkListener

void addNetworkListener(INetwork.NetworkListener listener)
Add the given listener to the list of network listeners.

Parameters:
listener - the listener to add

removeNetworkListener

void removeNetworkListener(INetwork.NetworkListener listener)
Remove the given listener from the list of network listeners.

Parameters:
listener - the listener to remove