/*******************************************************************************
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ******************************************************************************/
package lbms.plugins.mldht;

import java.net.InetAddress;
import java.nio.file.Path;
import java.util.function.Predicate;

public interface DHTConfiguration {
	
	public boolean isPersistingID();

	public Path getStoragePath();

	public int getListeningPort();
	
	public boolean noRouterBootstrap();

	/**
	 * If true one DHT node per globally routable unicast address will be used. Recommended for IPv6 nodes or servers-class machines directly connected to the internet.<br>
	 * If false only one node will be bound. Usually to the the default route. Recommended for IPv4 nodes.
	 */
	public boolean allowMultiHoming();
	
	/**
	 * A DHT node will automatically select socket bind addresses based on internal policies from available addresses,
	 * the predicate can be used to limit this selection to a subset.
	 * 
	 * A predicate that allows any the <em>any local address</em> of a particular address family is considered to allow all addresses of that family
	 * 
	 * The default implementation does not apply any restrictions.
	 * 
	 * The predicate may be be evaluated frequently, implementations should be approximately constant-time.
	 */
	public default Predicate<InetAddress> filterBindAddress() {
		return (unused) -> true;
	}
}

@@ -386,16 +386,52 @@
 mldht;%0A%0A
+import lbms.plugins.mldht.kad.DHT;%0A%0A
 import j
@@ -559,107 +559,675 @@
 %0A%09%0A%09
-public boolean isPersistingID();%0A%0A%09public Path getStoragePath();%0A%0A%09public int getListeningPort();%0A%09
+/**%0A%09 * if true and combined with an existing storage directory the base ID from which individual RPCServer IDs are derived will be returned%0A%09 */%0A%09public boolean isPersistingID();%0A%0A%09/**%0A%09 * If a Path that points to an existing, writable directory is returned then the routing table%0A%09 * will be persisted to that directory periodically and during shutdown%0A%09 */%0A%09public Path getStoragePath();%0A%0A%09public int getListeningPort();%0A%09%0A%09/**%0A%09 * if true then no attempt to bootstrap through well-known nodes is made.%0A%09 * you either must have a persisted routing table which can be loaded or%0A%09 * manually seed the routing table by calling %7B@link DHT#addDHTNode(String, int)%7D%0A%09 */
 %0A%09pu
@@ -1804,20 +1804,16 @@
  allows 
-any 
 the %3Cem%3E
@@ -1903,16 +1903,20 @@
 dresses 
+%3Cem%3E
 of that 
@@ -1921,16 +1921,21 @@
 t family
+%3C/em%3E
 %0A%09 * %0A%09 

add javadocs