mirror of
https://github.com/ChronosX88/Influence-P2P.git
synced 2024-11-22 07:12:19 +00:00
Fixed package in classes of kademlia package.
This commit is contained in:
parent
61fb0e5a27
commit
724c3c8da7
@ -19,10 +19,15 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
def room_version = "2.1.0-alpha04"
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation 'com.google.code.gson:gson:2.8.5'
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -11,26 +11,26 @@ import java.net.InetAddress;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.dht.DHT;
|
||||
import com.github.joshuakissoon.kademlia.dht.KadContent;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.message.MessageFactory;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import com.github.joshuakissoon.kademlia.operation.ConnectOperation;
|
||||
import com.github.joshuakissoon.kademlia.operation.ContentLookupOperation;
|
||||
import com.github.joshuakissoon.kademlia.operation.Operation;
|
||||
import com.github.joshuakissoon.kademlia.operation.KadRefreshOperation;
|
||||
import com.github.joshuakissoon.kademlia.operation.StoreOperation;
|
||||
import com.github.joshuakissoon.kademlia.routing.JKademliaRoutingTable;
|
||||
import com.github.joshuakissoon.kademlia.routing.KademliaRoutingTable;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonDHTSerializer;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonRoutingTableSerializer;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.dht.DHT;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KadContent;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.message.MessageFactory;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.operation.ConnectOperation;
|
||||
import io.github.chronosx88.influence.kademlia.operation.ContentLookupOperation;
|
||||
import io.github.chronosx88.influence.kademlia.operation.Operation;
|
||||
import io.github.chronosx88.influence.kademlia.operation.KadRefreshOperation;
|
||||
import io.github.chronosx88.influence.kademlia.operation.StoreOperation;
|
||||
import io.github.chronosx88.influence.kademlia.routing.JKademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.routing.KademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonDHTSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonRoutingTableSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonSerializer;
|
||||
|
||||
/**
|
||||
* The main Kademlia Node on the network, this node manages everything for this local system.
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
/**
|
||||
* Interface that defines a KadConfiguration object
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -13,11 +13,11 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.KadServerDownException;
|
||||
import com.github.joshuakissoon.kademlia.message.KademliaMessageFactory;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.message.Receiver;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.KadServerDownException;
|
||||
import io.github.chronosx88.influence.kademlia.message.KademliaMessageFactory;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.message.Receiver;
|
||||
|
||||
/**
|
||||
* The server that handles sending and receiving messages between nodes on the Kad Network
|
||||
@ -104,7 +104,7 @@ public class KadServer
|
||||
* @return Integer The communication ID of this message
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.KadServerDownException
|
||||
* @throws KadServerDownException
|
||||
*/
|
||||
public synchronized int sendMessage(Node to, Message msg, Receiver recv) throws IOException, KadServerDownException
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
/**
|
||||
* Specification for class that keeps statistics for a Kademlia instance.
|
||||
|
@ -1,15 +1,15 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.dht.KadContent;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.routing.KademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KadContent;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.routing.KademliaRoutingTable;
|
||||
|
||||
/**
|
||||
* The main Kademlia Node on the network, this node manages everything for this local system.
|
||||
@ -105,7 +105,7 @@ public interface KademliaNode
|
||||
* @return DHTContent The content
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException
|
||||
* @throws ContentNotFoundException
|
||||
*/
|
||||
public JKademliaStorageEntry get(GetParameter param) throws NoSuchElementException, IOException, ContentNotFoundException;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia;
|
||||
package io.github.chronosx88.influence.kademlia;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -9,12 +9,12 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentExistException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonSerializer;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.KadSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentExistException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.KadSerializer;
|
||||
|
||||
/**
|
||||
* The main Distributed Hash Table class that manages the entire DHT
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* A GET request can get content based on Key, Owner, Type, etc
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
/**
|
||||
* A JKademliaStorageEntry class that is used to store a content on the DHT
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Any piece of content that needs to be stored on the DHT
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.KadSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.KadSerializer;
|
||||
|
||||
/**
|
||||
* The main Distributed Hash Table interface that manages the entire DHT
|
||||
@ -100,7 +100,7 @@ public interface KademliaDHT
|
||||
* @param content The Content to Remove
|
||||
*
|
||||
*
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException
|
||||
* @throws ContentNotFoundException
|
||||
*/
|
||||
public void remove(KadContent content) throws ContentNotFoundException;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
/**
|
||||
* A StorageEntry interface for the storage entry class used to store a content on the DHT
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Keeps track of data for a Content stored in the DHT
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Keeps track of data for a Content stored in the DHT
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.github.joshuakissoon.kademlia.dht;
|
||||
package io.github.chronosx88.influence.kademlia.dht;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentExistException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentExistException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* It would be infeasible to keep all content in memory to be send when requested
|
||||
@ -46,7 +46,7 @@ class StoredContentManager
|
||||
{
|
||||
if (!this.entries.containsKey(entry.getKey()))
|
||||
{
|
||||
this.entries.put(entry.getKey(), new ArrayList<>());
|
||||
this.entries.put(entry.getKey(), new ArrayList<KademliaStorageEntryMetadata>());
|
||||
}
|
||||
|
||||
/* If this entry doesn't already exist, then we add it */
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.exceptions;
|
||||
package io.github.chronosx88.influence.kademlia.exceptions;
|
||||
|
||||
/**
|
||||
* An exception used to indicate that a content already exist on the DHT
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.exceptions;
|
||||
package io.github.chronosx88.influence.kademlia.exceptions;
|
||||
|
||||
/**
|
||||
* An exception used to indicate that a content does not exist on the DHT
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.exceptions;
|
||||
package io.github.chronosx88.influence.kademlia.exceptions;
|
||||
|
||||
/**
|
||||
* An exception to be thrown whenever the Kad Server is down
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.exceptions;
|
||||
package io.github.chronosx88.influence.kademlia.exceptions;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.exceptions;
|
||||
package io.github.chronosx88.influence.kademlia.exceptions;
|
||||
|
||||
/**
|
||||
* An exception used to indicate an unknown message type or communication identifier
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* A message used to acknowledge a request from a node; can be used in many situations.
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* A message sent to another node requesting to connect to them.
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
|
||||
/**
|
||||
* Receives a ConnectMessage and sends an AcknowledgeMessage as reply.
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonSerializer;
|
||||
|
||||
/**
|
||||
* Messages used to send to another node requesting content.
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
|
||||
/**
|
||||
* Responds to a ContentLookupMessage by sending a ContentMessage containing the requested content;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonSerializer;
|
||||
|
||||
/**
|
||||
* A Message used to send content between nodes
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
|
||||
/**
|
||||
* A factory that handles creating messages and receivers
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
public interface Message extends Streamable
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
|
||||
/**
|
||||
* Handles creating messages and receivers
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* A message sent to other nodes requesting the K-Closest nodes to a key sent in this message.
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* Receives a NodeLookupMessage and sends a NodeReplyMessage as reply with the K-Closest nodes to the ID sent.
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* A message used to connect nodes.
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.util.serializer.JsonSerializer;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.util.serializer.JsonSerializer;
|
||||
|
||||
/**
|
||||
* A StoreContentMessage used to send a store message to a node
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
|
||||
/**
|
||||
* Receiver for incoming StoreContentMessage
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.message;
|
||||
package io.github.chronosx88.influence.kademlia.message;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @created 20140215
|
||||
* @desc Represents a Kademlia Node ID
|
||||
*/
|
||||
package com.github.joshuakissoon.kademlia.node;
|
||||
package io.github.chronosx88.influence.kademlia.node;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -13,7 +13,7 @@ import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
import java.util.BitSet;
|
||||
import java.util.Random;
|
||||
import com.github.joshuakissoon.kademlia.message.Streamable;
|
||||
import io.github.chronosx88.influence.kademlia.message.Streamable;
|
||||
|
||||
public class KademliaId implements Streamable, Serializable
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.node;
|
||||
package io.github.chronosx88.influence.kademlia.node;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Comparator;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.node;
|
||||
package io.github.chronosx88.influence.kademlia.node;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -6,7 +6,7 @@ import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import com.github.joshuakissoon.kademlia.message.Streamable;
|
||||
import io.github.chronosx88.influence.kademlia.message.Streamable;
|
||||
|
||||
/**
|
||||
* A Node in the Kademlia network - Contains basic node network information.
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* At each time interval t, nodes need to refresh their K-Buckets
|
||||
|
@ -3,19 +3,19 @@
|
||||
* @created 20140218
|
||||
* @desc Operation that handles connecting to an existing Kademlia network using a bootstrap node
|
||||
*/
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.message.Receiver;
|
||||
import io.github.chronosx88.influence.kademlia.message.Receiver;
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.message.AcknowledgeMessage;
|
||||
import com.github.joshuakissoon.kademlia.message.ConnectMessage;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.message.AcknowledgeMessage;
|
||||
import io.github.chronosx88.influence.kademlia.message.ConnectMessage;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
public class ConnectOperation implements Operation, Receiver
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.message.Receiver;
|
||||
import io.github.chronosx88.influence.kademlia.message.Receiver;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -10,21 +10,21 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.UnknownMessageException;
|
||||
import com.github.joshuakissoon.kademlia.message.ContentLookupMessage;
|
||||
import com.github.joshuakissoon.kademlia.message.ContentMessage;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.message.NodeReplyMessage;
|
||||
import com.github.joshuakissoon.kademlia.node.KeyComparator;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.util.RouteLengthChecker;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.UnknownMessageException;
|
||||
import io.github.chronosx88.influence.kademlia.message.ContentLookupMessage;
|
||||
import io.github.chronosx88.influence.kademlia.message.ContentMessage;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.message.NodeReplyMessage;
|
||||
import io.github.chronosx88.influence.kademlia.node.KeyComparator;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.util.RouteLengthChecker;
|
||||
|
||||
/**
|
||||
* Looks up a specified identifier and returns the value associated with it
|
||||
@ -92,7 +92,7 @@ public class ContentLookupOperation implements Operation, Receiver
|
||||
|
||||
/**
|
||||
* @throws java.io.IOException
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.RoutingException
|
||||
* @throws RoutingException
|
||||
*/
|
||||
@Override
|
||||
public synchronized void execute() throws IOException, RoutingException
|
||||
@ -318,7 +318,7 @@ public class ContentLookupOperation implements Operation, Receiver
|
||||
/**
|
||||
* @return The list of all content found during the lookup operation
|
||||
*
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException
|
||||
* @throws ContentNotFoundException
|
||||
*/
|
||||
public JKademliaStorageEntry getContentFound() throws ContentNotFoundException
|
||||
{
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntryMetadata;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.message.StoreContentMessage;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntryMetadata;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.message.StoreContentMessage;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* Refresh/Restore the data on this node by sending the data to the K-Closest nodes to the data
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
|
||||
/**
|
||||
* An operation that handles refreshing the entire Kademlia Systems including buckets and content
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.message.Receiver;
|
||||
import io.github.chronosx88.influence.kademlia.message.Receiver;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
@ -8,16 +8,16 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.message.NodeLookupMessage;
|
||||
import com.github.joshuakissoon.kademlia.message.NodeReplyMessage;
|
||||
import com.github.joshuakissoon.kademlia.node.KeyComparator;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.message.NodeLookupMessage;
|
||||
import io.github.chronosx88.influence.kademlia.message.NodeReplyMessage;
|
||||
import io.github.chronosx88.influence.kademlia.node.KeyComparator;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Finds the K closest nodes to a specified identifier
|
||||
@ -78,7 +78,7 @@ public class NodeLookupOperation implements Operation, Receiver
|
||||
|
||||
/**
|
||||
* @throws java.io.IOException
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.RoutingException
|
||||
* @throws RoutingException
|
||||
*/
|
||||
@Override
|
||||
public synchronized void execute() throws IOException, RoutingException
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
|
||||
/**
|
||||
* An operation in the Kademlia routing protocol
|
||||
@ -15,7 +15,7 @@ public interface Operation
|
||||
/**
|
||||
* Starts an operation and returns when the operation is finished
|
||||
*
|
||||
* @throws com.github.joshuakissoon.kademlia.exceptions.RoutingException
|
||||
* @throws RoutingException
|
||||
*/
|
||||
public void execute() throws IOException, RoutingException;
|
||||
}
|
||||
|
@ -5,12 +5,12 @@
|
||||
* @author Joshua Kissoon
|
||||
* @since 20140218
|
||||
*/
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.RoutingException;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.RoutingException;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
public class PingOperation implements Operation
|
||||
{
|
||||
|
@ -1,15 +1,15 @@
|
||||
package com.github.joshuakissoon.kademlia.operation;
|
||||
package io.github.chronosx88.influence.kademlia.operation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.KadServer;
|
||||
import com.github.joshuakissoon.kademlia.KademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.JKademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import com.github.joshuakissoon.kademlia.message.Message;
|
||||
import com.github.joshuakissoon.kademlia.message.StoreContentMessage;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.KadServer;
|
||||
import io.github.chronosx88.influence.kademlia.KademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.JKademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.message.Message;
|
||||
import io.github.chronosx88.influence.kademlia.message.StoreContentMessage;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* Operation that stores a DHT Content onto the K closest nodes to the content Key
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* Keeps information about contacts of the Node; Contacts are stored in the Buckets in the Routing Table.
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.TreeSet;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* A bucket in the Kademlia routing table
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.node.KeyComparator;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.node.KeyComparator;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Implementation of a Kademlia routing table
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* A bucket used to store Contacts in the routing table.
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.joshuakissoon.kademlia.routing;
|
||||
package io.github.chronosx88.influence.kademlia.routing;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Specification for Kademlia's Routing Table
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import com.github.joshuakissoon.kademlia.DefaultConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.DefaultConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing the Kademlia Auto Content and Node table refresh operations
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import com.github.joshuakissoon.kademlia.DefaultConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.DefaultConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing the Kademlia Auto Content and Node table refresh operations
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing sending and receiving content between 2 Nodes on a network
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing sending and receiving content between 2 Nodes on a network
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.github.joshuakissoon.kademlia.dht.KadContent;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KadContent;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* A simple DHT Content object to test DHT storage
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing connecting 2 nodes to each other
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.exceptions.ContentNotFoundException;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.exceptions.ContentNotFoundException;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing sending and receiving content between 2 Nodes on a network
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import com.github.joshuakissoon.kademlia.routing.KademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.routing.KademliaRoutingTable;
|
||||
|
||||
/**
|
||||
* Testing how the routing table works and checking if everything works properly
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Scanner;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.KadContent;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KadContent;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing how the routing table works and it's state after different operations
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing the save and retrieve state operations
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.dht.GetParameter;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntry;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.dht.GetParameter;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntry;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
|
||||
/**
|
||||
* Testing the save and retrieve state operations.
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.github.joshuakissoon.kademlia.JKademliaNode;
|
||||
import com.github.joshuakissoon.kademlia.message.SimpleMessage;
|
||||
import com.github.joshuakissoon.kademlia.node.KademliaId;
|
||||
import com.github.joshuakissoon.kademlia.message.SimpleReceiver;
|
||||
import io.github.chronosx88.influence.kademlia.JKademliaNode;
|
||||
import io.github.chronosx88.influence.kademlia.message.SimpleMessage;
|
||||
import io.github.chronosx88.influence.kademlia.node.KademliaId;
|
||||
import io.github.chronosx88.influence.kademlia.message.SimpleReceiver;
|
||||
|
||||
/**
|
||||
* Test 1: Try sending a simple message between nodes
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.simulations;
|
||||
package io.github.chronosx88.influence.kademlia.simulations;
|
||||
|
||||
/**
|
||||
* A class that specifies the structure for simulations.
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.util;
|
||||
package io.github.chronosx88.influence.kademlia.util;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.joshuakissoon.kademlia.util;
|
||||
package io.github.chronosx88.influence.kademlia.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import com.github.joshuakissoon.kademlia.node.Node;
|
||||
import io.github.chronosx88.influence.kademlia.node.Node;
|
||||
|
||||
/**
|
||||
* Class that helps compute the route length taken to complete an operation.
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.util.serializer;
|
||||
package io.github.chronosx88.influence.kademlia.util.serializer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
@ -11,9 +11,9 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.dht.DHT;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaDHT;
|
||||
import com.github.joshuakissoon.kademlia.dht.KademliaStorageEntryMetadata;
|
||||
import io.github.chronosx88.influence.kademlia.dht.DHT;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaDHT;
|
||||
import io.github.chronosx88.influence.kademlia.dht.KademliaStorageEntryMetadata;
|
||||
|
||||
/**
|
||||
* A KadSerializer that serializes DHT to JSON format
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.util.serializer;
|
||||
package io.github.chronosx88.influence.kademlia.util.serializer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
@ -9,12 +9,12 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import com.github.joshuakissoon.kademlia.routing.JKademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.routing.JKademliaRoutingTable;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import com.github.joshuakissoon.kademlia.KadConfiguration;
|
||||
import com.github.joshuakissoon.kademlia.routing.Contact;
|
||||
import com.github.joshuakissoon.kademlia.routing.KademliaRoutingTable;
|
||||
import io.github.chronosx88.influence.kademlia.KadConfiguration;
|
||||
import io.github.chronosx88.influence.kademlia.routing.Contact;
|
||||
import io.github.chronosx88.influence.kademlia.routing.KademliaRoutingTable;
|
||||
|
||||
/**
|
||||
* A KadSerializer that serializes routing tables to JSON format
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.util.serializer;
|
||||
package io.github.chronosx88.influence.kademlia.util.serializer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.joshuakissoon.kademlia.util.serializer;
|
||||
package io.github.chronosx88.influence.kademlia.util.serializer;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
Loading…
Reference in New Issue
Block a user