// Path: src/dosna/dhtAbstraction/DataManager.java
// public interface DataManager
// {
// 
//     /**
//      * Put data onto the network.
//      * This will put the data onto the network based on the routing protocol.
//      * It may or may not store data locally.
//      *
//      * @param content The content to be stored on the network
//      *
//      * @return How many nodes was this content stored on
//      *
//      * @throws java.io.IOException
//      */
//     public int put(final DOSNAContent content) throws IOException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param gp
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final GetParameter gp) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param key
//      * @param type
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final KademliaId key, final String type) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param key
//      * @param type
//      * @param ownerId
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final KademliaId key, final String type, final String ownerId) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Run an update call to update the data stored locally on this computer.
//      * This may involve deleting some data and adding some other data.
//      */
//     public void updateStorage();
// 
//     /**
//      * Save the state of the DataManager and shutdown
//      *
//      * @param saveState Whether to save the state of the application or not
//      *
//      * @throws java.io.IOException
//      */
//     public void shutdown(final boolean saveState) throws IOException;
// 
//     /**
//      * @return The JKademliaNode used by this DataManager
//      */
//     public JKademliaNode getKademliaNode();
// }


import dosna.dhtAbstraction.DataManager;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.TreeSet;
import kademlia.exceptions.ContentNotFoundException;

     * @return Whether the connection exist
     */
    public boolean hasConnection(final Actor conn)
    {
        for (Relationship r : this.connections)
        {
            if (r.getConnectionUid().equals(conn.getId()))
            {
                return true;
            }
        }

        return false;
    }

    /**
     * @return The set of all relationships that this actor has
     */
    public Collection<Relationship> getRelationships()
    {
        return this.connections;
    }

    /**
     * Here we load all Actors that are connected with this actor.
     *
     * @param dataManager DataManager to be used to load the connections
     *
     * @return The set of Actors connected to this actor
     */

// Path: src/dosna/dhtAbstraction/DataManager.java
// public interface DataManager
// {
// 
//     /**
//      * Put data onto the network.
//      * This will put the data onto the network based on the routing protocol.
//      * It may or may not store data locally.
//      *
//      * @param content The content to be stored on the network
//      *
//      * @return How many nodes was this content stored on
//      *
//      * @throws java.io.IOException
//      */
//     public int put(final DOSNAContent content) throws IOException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param gp
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final GetParameter gp) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param key
//      * @param type
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final KademliaId key, final String type) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Get entries for the required data from the network
//      *
//      * @param key
//      * @param type
//      * @param ownerId
//      *
//      * @return A single data entry
//      *
//      * @throws java.io.IOException
//      * @throws kademlia.exceptions.ContentNotFoundException
//      */
//     public KademliaStorageEntry get(final KademliaId key, final String type, final String ownerId) throws IOException, NoSuchElementException, ContentNotFoundException;
// 
//     /**
//      * Run an update call to update the data stored locally on this computer.
//      * This may involve deleting some data and adding some other data.
//      */
//     public void updateStorage();
// 
//     /**
//      * Save the state of the DataManager and shutdown
//      *
//      * @param saveState Whether to save the state of the application or not
//      *
//      * @throws java.io.IOException
//      */
//     public void shutdown(final boolean saveState) throws IOException;
// 
//     /**
//      * @return The JKademliaNode used by this DataManager
//      */
//     public JKademliaNode getKademliaNode();
// }


// Path: src/dosna/osn/actor/ActorConnectionsManager.java
import dosna.dhtAbstraction.DataManager;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.TreeSet;
import kademlia.exceptions.ContentNotFoundException;

     * @return Whether the connection exist
     */
    public boolean hasConnection(final Actor conn)
    {
        for (Relationship r : this.connections)
        {
            if (r.getConnectionUid().equals(conn.getId()))
            {
                return true;
            }
        }

        return false;
    }

    /**
     * @return The set of all relationships that this actor has
     */
    public Collection<Relationship> getRelationships()
    {
        return this.connections;
    }

    /**
     * Here we load all Actors that are connected with this actor.
     *
     * @param dataManager DataManager to be used to load the connections
     *
     * @return The set of Actors connected to this actor
     */

    public Collection<Actor> loadConnections(final DataManager dataManager)
