mirror of
https://github.com/ChronosX88/KademliaDHT.git
synced 2024-11-21 17:52:21 +00:00
A few small changes
This commit is contained in:
parent
4a9fd713fd
commit
7a4cc2e91c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
Loading…
Reference in New Issue
Block a user