mirror of
https://github.com/ChronosX88/KademliaDHT.git
synced 2024-11-22 10:12:19 +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.KadContent;
|
||||||
import kademlia.dht.KademliaDHT;
|
import kademlia.dht.KademliaDHT;
|
||||||
import kademlia.dht.KademliaStorageEntry;
|
import kademlia.dht.KademliaStorageEntry;
|
||||||
import kademlia.dht.StorageEntry;
|
import kademlia.dht.JKademliaStorageEntry;
|
||||||
import kademlia.exceptions.ContentNotFoundException;
|
import kademlia.exceptions.ContentNotFoundException;
|
||||||
import kademlia.exceptions.RoutingException;
|
import kademlia.exceptions.RoutingException;
|
||||||
import kademlia.message.MessageFactory;
|
import kademlia.message.MessageFactory;
|
||||||
@ -262,7 +262,7 @@ public class JKademliaNode implements KademliaNode
|
|||||||
@Override
|
@Override
|
||||||
public int put(KadContent content) throws IOException
|
public int put(KadContent content) throws IOException
|
||||||
{
|
{
|
||||||
return this.put(new StorageEntry(content));
|
return this.put(new JKademliaStorageEntry(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -278,7 +278,7 @@ public class JKademliaNode implements KademliaNode
|
|||||||
@Override
|
@Override
|
||||||
public void putLocally(KadContent content) throws IOException
|
public void putLocally(KadContent content) throws IOException
|
||||||
{
|
{
|
||||||
this.dht.store(new StorageEntry(content));
|
this.dht.store(new JKademliaStorageEntry(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -126,7 +126,7 @@ public class DHT implements KademliaDHT
|
|||||||
@Override
|
@Override
|
||||||
public boolean store(KadContent content) throws IOException
|
public boolean store(KadContent content) throws IOException
|
||||||
{
|
{
|
||||||
return this.store(new StorageEntry(content));
|
return this.store(new JKademliaStorageEntry(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
package kademlia.dht;
|
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
|
* @author Joshua Kissoon
|
||||||
* @since 20140402
|
* @since 20140402
|
||||||
*/
|
*/
|
||||||
public class StorageEntry implements KademliaStorageEntry
|
public class JKademliaStorageEntry implements KademliaStorageEntry
|
||||||
{
|
{
|
||||||
|
|
||||||
private String content;
|
private String content;
|
||||||
private final KademliaStorageEntryMetadata metadata;
|
private final KademliaStorageEntryMetadata metadata;
|
||||||
|
|
||||||
public StorageEntry(final KadContent content)
|
public JKademliaStorageEntry(final KadContent content)
|
||||||
{
|
{
|
||||||
this(content, new StorageEntryMetadata(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.setContent(content.toSerializedForm());
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
Loading…
Reference in New Issue
Block a user