A few small changes

This commit is contained in:
Joshua Kissoon 2014-06-02 15:22:19 +05:30
parent 4a9fd713fd
commit 7a4cc2e91c
3 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ import kademlia.dht.DHT;
import kademlia.dht.KadContent;
import kademlia.dht.KademliaDHT;
import kademlia.dht.KademliaStorageEntry;
import kademlia.dht.StorageEntry;
import kademlia.dht.JKademliaStorageEntry;
import kademlia.exceptions.ContentNotFoundException;
import kademlia.exceptions.RoutingException;
import kademlia.message.MessageFactory;
@ -262,7 +262,7 @@ public class JKademliaNode implements KademliaNode
@Override
public int put(KadContent content) throws IOException
{
return this.put(new StorageEntry(content));
return this.put(new JKademliaStorageEntry(content));
}
@Override
@ -278,7 +278,7 @@ public class JKademliaNode implements KademliaNode
@Override
public void putLocally(KadContent content) throws IOException
{
this.dht.store(new StorageEntry(content));
this.dht.store(new JKademliaStorageEntry(content));
}
@Override

View File

@ -126,7 +126,7 @@ public class DHT implements KademliaDHT
@Override
public boolean store(KadContent content) throws IOException
{
return this.store(new StorageEntry(content));
return this.store(new JKademliaStorageEntry(content));
}
@Override

View File

@ -1,23 +1,23 @@
package kademlia.dht;
/**
* A StorageEntry class that is used to store a content on the DHT
* A JKademliaStorageEntry class that is used to store a content on the DHT
*
* @author Joshua Kissoon
* @since 20140402
*/
public class StorageEntry implements KademliaStorageEntry
public class JKademliaStorageEntry implements KademliaStorageEntry
{
private String content;
private final KademliaStorageEntryMetadata metadata;
public StorageEntry(final KadContent content)
public JKademliaStorageEntry(final KadContent content)
{
this(content, new StorageEntryMetadata(content));
}
public StorageEntry(final KadContent content, final KademliaStorageEntryMetadata metadata)
public JKademliaStorageEntry(final KadContent content, final KademliaStorageEntryMetadata metadata)
{
this.setContent(content.toSerializedForm());
this.metadata = metadata;