From addb142ecd519e14ac95cc8345fbc7e9434e6eca Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Thu, 18 Jun 2015 21:20:00 +0000
Subject: [PATCH] I2CP: Move client-side implementation classes to new package
 net.i2p.client.impl, leaving only the factories and interfaces in
 net.i2p.client

---
 .../net/i2p/client/streaming/impl/PacketLocal.java    |  2 --
 core/java/src/net/i2p/client/I2PClientFactory.java    |  4 +++-
 core/java/src/net/i2p/client/I2PSession.java          |  1 -
 core/java/src/net/i2p/client/I2PSimpleClient.java     |  1 +
 .../i2p/client/{ => impl}/BWLimitsMessageHandler.java |  2 +-
 .../net/i2p/client/{ => impl}/ClientWriterRunner.java |  3 ++-
 .../client/{ => impl}/DestReplyMessageHandler.java    |  2 +-
 .../client/{ => impl}/DisconnectMessageHandler.java   |  3 ++-
 .../src/net/i2p/client/{ => impl}/HandlerImpl.java    |  2 +-
 .../client/{ => impl}/HostReplyMessageHandler.java    |  2 +-
 .../net/i2p/client/{ => impl}/I2CPMessageHandler.java |  2 +-
 .../i2p/client/{ => impl}/I2CPMessageProducer.java    |  4 +++-
 .../src/net/i2p/client/{ => impl}/I2PClientImpl.java  |  7 +++++--
 .../client/{ => impl}/I2PClientMessageHandlerMap.java |  2 +-
 .../client/{ => impl}/I2PSessionDemultiplexer.java    |  6 +++++-
 .../src/net/i2p/client/{ => impl}/I2PSessionImpl.java |  7 ++++++-
 .../net/i2p/client/{ => impl}/I2PSessionImpl2.java    |  8 +++++++-
 .../i2p/client/{ => impl}/I2PSessionMuxedImpl.java    |  9 +++++++--
 .../net/i2p/client/{ => impl}/I2PSimpleSession.java   |  6 ++++--
 .../{ => impl}/MessagePayloadMessageHandler.java      |  3 ++-
 .../src/net/i2p/client/{ => impl}/MessageState.java   |  4 +++-
 .../{ => impl}/MessageStatusMessageHandler.java       |  3 ++-
 .../{ => impl}/RequestLeaseSetMessageHandler.java     |  3 ++-
 .../RequestVariableLeaseSetMessageHandler.java        |  2 +-
 .../net/i2p/client/{ => impl}/SessionIdleTimer.java   |  3 ++-
 .../{ => impl}/SessionStatusMessageHandler.java       |  3 ++-
 .../i2p/client/{ => impl}/SetDateMessageHandler.java  |  2 +-
 .../src/net/i2p/client/{ => impl}/SubSession.java     |  4 +++-
 core/java/src/net/i2p/client/impl/package.html        | 11 +++++++++++
 core/java/src/net/i2p/client/package.html             | 11 +++++++++--
 router/java/src/net/i2p/router/Router.java            |  2 +-
 .../i2p/router/client/ClientManagerFacadeImpl.java    |  2 +-
 32 files changed, 91 insertions(+), 35 deletions(-)
 rename core/java/src/net/i2p/client/{ => impl}/BWLimitsMessageHandler.java (96%)
 rename core/java/src/net/i2p/client/{ => impl}/ClientWriterRunner.java (98%)
 rename core/java/src/net/i2p/client/{ => impl}/DestReplyMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/DisconnectMessageHandler.java (95%)
 rename core/java/src/net/i2p/client/{ => impl}/HandlerImpl.java (96%)
 rename core/java/src/net/i2p/client/{ => impl}/HostReplyMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/I2CPMessageHandler.java (95%)
 rename core/java/src/net/i2p/client/{ => impl}/I2CPMessageProducer.java (99%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PClientImpl.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PClientMessageHandlerMap.java (99%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PSessionDemultiplexer.java (96%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PSessionImpl.java (99%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PSessionImpl2.java (98%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PSessionMuxedImpl.java (98%)
 rename core/java/src/net/i2p/client/{ => impl}/I2PSimpleSession.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/MessagePayloadMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/MessageState.java (98%)
 rename core/java/src/net/i2p/client/{ => impl}/MessageStatusMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/RequestLeaseSetMessageHandler.java (99%)
 rename core/java/src/net/i2p/client/{ => impl}/RequestVariableLeaseSetMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/SessionIdleTimer.java (98%)
 rename core/java/src/net/i2p/client/{ => impl}/SessionStatusMessageHandler.java (96%)
 rename core/java/src/net/i2p/client/{ => impl}/SetDateMessageHandler.java (97%)
 rename core/java/src/net/i2p/client/{ => impl}/SubSession.java (98%)
 create mode 100644 core/java/src/net/i2p/client/impl/package.html

diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
index d820338910..542de8f2f8 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
@@ -207,8 +207,6 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
      *
      * @param buffer data to be written
      * @param offset starting point in the buffer
-     * @param ctx Application Context
-     * @param key signing key
      * @return Count of bytes written
      * @throws IllegalStateException if there is data missing or otherwise b0rked
      * @since 0.9.20 moved from Packet
diff --git a/core/java/src/net/i2p/client/I2PClientFactory.java b/core/java/src/net/i2p/client/I2PClientFactory.java
index 86fbdaa8ce..01a37b599f 100644
--- a/core/java/src/net/i2p/client/I2PClientFactory.java
+++ b/core/java/src/net/i2p/client/I2PClientFactory.java
@@ -9,6 +9,8 @@ package net.i2p.client;
  *
  */
 
+import net.i2p.client.impl.I2PClientImpl;
+
 /**
  * Provide a means of hooking into an appropriate I2PClient implementation
  *
@@ -21,4 +23,4 @@ public class I2PClientFactory {
     public static I2PClient createClient() {
         return new I2PClientImpl();
     }
-}
\ No newline at end of file
+}
diff --git a/core/java/src/net/i2p/client/I2PSession.java b/core/java/src/net/i2p/client/I2PSession.java
index 016293ea7f..458b9a892d 100644
--- a/core/java/src/net/i2p/client/I2PSession.java
+++ b/core/java/src/net/i2p/client/I2PSession.java
@@ -260,7 +260,6 @@ public interface I2PSession {
     public I2PSession addSubsession(InputStream privateKeyStream, Properties opts) throws I2PSessionException;
     
     /**
-     *  @return a list of subsessions, non-null, does not include the primary session
      *  @since 0.9.21
      */
     public void removeSubsession(I2PSession session);
diff --git a/core/java/src/net/i2p/client/I2PSimpleClient.java b/core/java/src/net/i2p/client/I2PSimpleClient.java
index 38286f2b1b..c8b1fdcf45 100644
--- a/core/java/src/net/i2p/client/I2PSimpleClient.java
+++ b/core/java/src/net/i2p/client/I2PSimpleClient.java
@@ -12,6 +12,7 @@ import java.util.Properties;
 
 import net.i2p.I2PAppContext;
 import net.i2p.I2PException;
+import net.i2p.client.impl.I2PSimpleSession;
 import net.i2p.crypto.SigType;
 import net.i2p.data.Certificate;
 import net.i2p.data.Destination;
diff --git a/core/java/src/net/i2p/client/BWLimitsMessageHandler.java b/core/java/src/net/i2p/client/impl/BWLimitsMessageHandler.java
similarity index 96%
rename from core/java/src/net/i2p/client/BWLimitsMessageHandler.java
rename to core/java/src/net/i2p/client/impl/BWLimitsMessageHandler.java
index 34fa81ec8e..6e199af46a 100644
--- a/core/java/src/net/i2p/client/BWLimitsMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/BWLimitsMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * Released into the public domain 
diff --git a/core/java/src/net/i2p/client/ClientWriterRunner.java b/core/java/src/net/i2p/client/impl/ClientWriterRunner.java
similarity index 98%
rename from core/java/src/net/i2p/client/ClientWriterRunner.java
rename to core/java/src/net/i2p/client/impl/ClientWriterRunner.java
index 35ecce19d4..dfe20bc1de 100644
--- a/core/java/src/net/i2p/client/ClientWriterRunner.java
+++ b/core/java/src/net/i2p/client/impl/ClientWriterRunner.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 import java.io.BufferedOutputStream;
 import java.io.IOException;
@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.i2cp.I2CPMessage;
 import net.i2p.data.i2cp.I2CPMessageException;
 import net.i2p.internal.PoisonI2CPMessage;
diff --git a/core/java/src/net/i2p/client/DestReplyMessageHandler.java b/core/java/src/net/i2p/client/impl/DestReplyMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/DestReplyMessageHandler.java
rename to core/java/src/net/i2p/client/impl/DestReplyMessageHandler.java
index 2207a56c51..e15a55779d 100644
--- a/core/java/src/net/i2p/client/DestReplyMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/DestReplyMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * Released into the public domain 
diff --git a/core/java/src/net/i2p/client/DisconnectMessageHandler.java b/core/java/src/net/i2p/client/impl/DisconnectMessageHandler.java
similarity index 95%
rename from core/java/src/net/i2p/client/DisconnectMessageHandler.java
rename to core/java/src/net/i2p/client/impl/DisconnectMessageHandler.java
index 8dd47f10b2..20582ddcb2 100644
--- a/core/java/src/net/i2p/client/DisconnectMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/DisconnectMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -10,6 +10,7 @@ package net.i2p.client;
  */
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.i2cp.DisconnectMessage;
 import net.i2p.data.i2cp.I2CPMessage;
 import net.i2p.util.I2PAppThread;
diff --git a/core/java/src/net/i2p/client/HandlerImpl.java b/core/java/src/net/i2p/client/impl/HandlerImpl.java
similarity index 96%
rename from core/java/src/net/i2p/client/HandlerImpl.java
rename to core/java/src/net/i2p/client/impl/HandlerImpl.java
index d1b5100e27..081d8e0c42 100644
--- a/core/java/src/net/i2p/client/HandlerImpl.java
+++ b/core/java/src/net/i2p/client/impl/HandlerImpl.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
diff --git a/core/java/src/net/i2p/client/HostReplyMessageHandler.java b/core/java/src/net/i2p/client/impl/HostReplyMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/HostReplyMessageHandler.java
rename to core/java/src/net/i2p/client/impl/HostReplyMessageHandler.java
index 94cce4758c..4cce11ab91 100644
--- a/core/java/src/net/i2p/client/HostReplyMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/HostReplyMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * Released into the public domain 
diff --git a/core/java/src/net/i2p/client/I2CPMessageHandler.java b/core/java/src/net/i2p/client/impl/I2CPMessageHandler.java
similarity index 95%
rename from core/java/src/net/i2p/client/I2CPMessageHandler.java
rename to core/java/src/net/i2p/client/impl/I2CPMessageHandler.java
index a0f14f8378..a0a60d69da 100644
--- a/core/java/src/net/i2p/client/I2CPMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/I2CPMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
diff --git a/core/java/src/net/i2p/client/I2CPMessageProducer.java b/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java
similarity index 99%
rename from core/java/src/net/i2p/client/I2CPMessageProducer.java
rename to core/java/src/net/i2p/client/impl/I2CPMessageProducer.java
index bbabc3a11f..f44b897a3b 100644
--- a/core/java/src/net/i2p/client/I2CPMessageProducer.java
+++ b/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -15,6 +15,8 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReentrantLock;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
+import net.i2p.client.SendMessageOptions;
 import net.i2p.data.DataFormatException;
 import net.i2p.data.Destination;
 import net.i2p.data.LeaseSet;
diff --git a/core/java/src/net/i2p/client/I2PClientImpl.java b/core/java/src/net/i2p/client/impl/I2PClientImpl.java
similarity index 97%
rename from core/java/src/net/i2p/client/I2PClientImpl.java
rename to core/java/src/net/i2p/client/impl/I2PClientImpl.java
index e0c7feea9f..0bda34daa4 100644
--- a/core/java/src/net/i2p/client/I2PClientImpl.java
+++ b/core/java/src/net/i2p/client/impl/I2PClientImpl.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -17,6 +17,9 @@ import java.util.Properties;
 
 import net.i2p.I2PAppContext;
 import net.i2p.I2PException;
+import net.i2p.client.I2PClient;
+import net.i2p.client.I2PSession;
+import net.i2p.client.I2PSessionException;
 import net.i2p.crypto.KeyGenerator;
 import net.i2p.crypto.SigType;
 import net.i2p.data.Certificate;
@@ -36,7 +39,7 @@ import net.i2p.util.RandomSource;
  *
  * @author jrandom
  */
-class I2PClientImpl implements I2PClient {
+public class I2PClientImpl implements I2PClient {
 
     /**
      * Create a destination with a DSA 1024/160 signature type and a null certificate.
diff --git a/core/java/src/net/i2p/client/I2PClientMessageHandlerMap.java b/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java
similarity index 99%
rename from core/java/src/net/i2p/client/I2PClientMessageHandlerMap.java
rename to core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java
index bd2de83d63..4cea850b79 100644
--- a/core/java/src/net/i2p/client/I2PClientMessageHandlerMap.java
+++ b/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
diff --git a/core/java/src/net/i2p/client/I2PSessionDemultiplexer.java b/core/java/src/net/i2p/client/impl/I2PSessionDemultiplexer.java
similarity index 96%
rename from core/java/src/net/i2p/client/I2PSessionDemultiplexer.java
rename to core/java/src/net/i2p/client/impl/I2PSessionDemultiplexer.java
index ea1ef2437f..5b29e80180 100644
--- a/core/java/src/net/i2p/client/I2PSessionDemultiplexer.java
+++ b/core/java/src/net/i2p/client/impl/I2PSessionDemultiplexer.java
@@ -1,9 +1,13 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Map;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSession;
+import net.i2p.client.I2PSessionException;
+import net.i2p.client.I2PSessionListener;
+import net.i2p.client.I2PSessionMuxedListener;
 import net.i2p.util.Log;
 
 /*
diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java
similarity index 99%
rename from core/java/src/net/i2p/client/I2PSessionImpl.java
rename to core/java/src/net/i2p/client/impl/I2PSessionImpl.java
index 6532b1f9f0..0be40f87f5 100644
--- a/core/java/src/net/i2p/client/I2PSessionImpl.java
+++ b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -29,6 +29,11 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import net.i2p.CoreVersion;
 import net.i2p.I2PAppContext;
+import net.i2p.client.DomainSocketFactory;
+import net.i2p.client.I2PClient;
+import net.i2p.client.I2PSession;
+import net.i2p.client.I2PSessionException;
+import net.i2p.client.I2PSessionListener;
 import net.i2p.data.Base32;
 import net.i2p.data.DataFormatException;
 import net.i2p.data.Destination;
diff --git a/core/java/src/net/i2p/client/I2PSessionImpl2.java b/core/java/src/net/i2p/client/impl/I2PSessionImpl2.java
similarity index 98%
rename from core/java/src/net/i2p/client/I2PSessionImpl2.java
rename to core/java/src/net/i2p/client/impl/I2PSessionImpl2.java
index d6fe3ad365..4eddcc30ec 100644
--- a/core/java/src/net/i2p/client/I2PSessionImpl2.java
+++ b/core/java/src/net/i2p/client/impl/I2PSessionImpl2.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -20,6 +20,12 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PClient;
+import net.i2p.client.I2PSessionException;
+import net.i2p.client.I2PSessionListener;
+import net.i2p.client.I2PSessionMuxedListener;
+import net.i2p.client.SendMessageOptions;
+import net.i2p.client.SendMessageStatusListener;
 import net.i2p.data.DataHelper;
 import net.i2p.data.Destination;
 import net.i2p.data.SessionKey;
diff --git a/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java b/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java
similarity index 98%
rename from core/java/src/net/i2p/client/I2PSessionMuxedImpl.java
rename to core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java
index 653fddc9ac..46e551e495 100644
--- a/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java
+++ b/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * public domain
@@ -8,9 +8,14 @@ import java.io.InputStream;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.Properties;
 import java.util.Set;
-
 import java.util.concurrent.atomic.AtomicBoolean;
+
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
+import net.i2p.client.I2PSessionListener;
+import net.i2p.client.I2PSessionMuxedListener;
+import net.i2p.client.SendMessageOptions;
+import net.i2p.client.SendMessageStatusListener;
 import net.i2p.data.DataHelper;
 import net.i2p.data.Destination;
 import net.i2p.data.SessionKey;
diff --git a/core/java/src/net/i2p/client/I2PSimpleSession.java b/core/java/src/net/i2p/client/impl/I2PSimpleSession.java
similarity index 97%
rename from core/java/src/net/i2p/client/I2PSimpleSession.java
rename to core/java/src/net/i2p/client/impl/I2PSimpleSession.java
index ce0ef254f3..dd59ea463c 100644
--- a/core/java/src/net/i2p/client/I2PSimpleSession.java
+++ b/core/java/src/net/i2p/client/impl/I2PSimpleSession.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * Released into the public domain 
@@ -16,6 +16,8 @@ import java.util.Properties;
 
 import net.i2p.CoreVersion;
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PClient;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.i2cp.BandwidthLimitsMessage;
 import net.i2p.data.i2cp.DestReplyMessage;
 import net.i2p.data.i2cp.DisconnectMessage;
@@ -37,7 +39,7 @@ import net.i2p.util.OrderedProperties;
  *
  * @author zzz
  */
-class I2PSimpleSession extends I2PSessionImpl2 {
+public class I2PSimpleSession extends I2PSessionImpl2 {
 
     private static final int BUF_SIZE = 1024;
 
diff --git a/core/java/src/net/i2p/client/MessagePayloadMessageHandler.java b/core/java/src/net/i2p/client/impl/MessagePayloadMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/MessagePayloadMessageHandler.java
rename to core/java/src/net/i2p/client/impl/MessagePayloadMessageHandler.java
index 39dc99403e..47beb2101e 100644
--- a/core/java/src/net/i2p/client/MessagePayloadMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/MessagePayloadMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -10,6 +10,7 @@ package net.i2p.client;
  */
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.DataFormatException;
 import net.i2p.data.Payload;
 import net.i2p.data.i2cp.I2CPMessage;
diff --git a/core/java/src/net/i2p/client/MessageState.java b/core/java/src/net/i2p/client/impl/MessageState.java
similarity index 98%
rename from core/java/src/net/i2p/client/MessageState.java
rename to core/java/src/net/i2p/client/impl/MessageState.java
index e56eb9a8a3..267a9cb19e 100644
--- a/core/java/src/net/i2p/client/MessageState.java
+++ b/core/java/src/net/i2p/client/impl/MessageState.java
@@ -1,8 +1,10 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 import java.util.concurrent.atomic.AtomicLong;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSession;
+import net.i2p.client.SendMessageStatusListener;
 import net.i2p.data.i2cp.MessageId;
 import net.i2p.data.i2cp.MessageStatusMessage;
 import net.i2p.util.Log;
diff --git a/core/java/src/net/i2p/client/MessageStatusMessageHandler.java b/core/java/src/net/i2p/client/impl/MessageStatusMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/MessageStatusMessageHandler.java
rename to core/java/src/net/i2p/client/impl/MessageStatusMessageHandler.java
index f967ad9568..4654eafa38 100644
--- a/core/java/src/net/i2p/client/MessageStatusMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/MessageStatusMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -10,6 +10,7 @@ package net.i2p.client;
  */
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.i2cp.I2CPMessage;
 import net.i2p.data.i2cp.MessageStatusMessage;
 import net.i2p.data.i2cp.ReceiveMessageBeginMessage;
diff --git a/core/java/src/net/i2p/client/RequestLeaseSetMessageHandler.java b/core/java/src/net/i2p/client/impl/RequestLeaseSetMessageHandler.java
similarity index 99%
rename from core/java/src/net/i2p/client/RequestLeaseSetMessageHandler.java
rename to core/java/src/net/i2p/client/impl/RequestLeaseSetMessageHandler.java
index 68f8f07b8e..09dab72ff4 100644
--- a/core/java/src/net/i2p/client/RequestLeaseSetMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/RequestLeaseSetMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -14,6 +14,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.crypto.KeyGenerator;
 import net.i2p.crypto.SigType;
 import net.i2p.data.DataFormatException;
diff --git a/core/java/src/net/i2p/client/RequestVariableLeaseSetMessageHandler.java b/core/java/src/net/i2p/client/impl/RequestVariableLeaseSetMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/RequestVariableLeaseSetMessageHandler.java
rename to core/java/src/net/i2p/client/impl/RequestVariableLeaseSetMessageHandler.java
index 6ba03d8f69..41cc9eb931 100644
--- a/core/java/src/net/i2p/client/RequestVariableLeaseSetMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/RequestVariableLeaseSetMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
diff --git a/core/java/src/net/i2p/client/SessionIdleTimer.java b/core/java/src/net/i2p/client/impl/SessionIdleTimer.java
similarity index 98%
rename from core/java/src/net/i2p/client/SessionIdleTimer.java
rename to core/java/src/net/i2p/client/impl/SessionIdleTimer.java
index 444f73167f..5b4fa513e1 100644
--- a/core/java/src/net/i2p/client/SessionIdleTimer.java
+++ b/core/java/src/net/i2p/client/impl/SessionIdleTimer.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -8,6 +8,7 @@ package net.i2p.client;
 import java.util.Properties;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.DataHelper;
 import net.i2p.util.Log;
 import net.i2p.util.SimpleTimer;
diff --git a/core/java/src/net/i2p/client/SessionStatusMessageHandler.java b/core/java/src/net/i2p/client/impl/SessionStatusMessageHandler.java
similarity index 96%
rename from core/java/src/net/i2p/client/SessionStatusMessageHandler.java
rename to core/java/src/net/i2p/client/impl/SessionStatusMessageHandler.java
index 92bd7db82a..ec0b0d6741 100644
--- a/core/java/src/net/i2p/client/SessionStatusMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/SessionStatusMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
@@ -10,6 +10,7 @@ package net.i2p.client;
  */
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.i2cp.I2CPMessage;
 import net.i2p.data.i2cp.SessionStatusMessage;
 import net.i2p.util.Log;
diff --git a/core/java/src/net/i2p/client/SetDateMessageHandler.java b/core/java/src/net/i2p/client/impl/SetDateMessageHandler.java
similarity index 97%
rename from core/java/src/net/i2p/client/SetDateMessageHandler.java
rename to core/java/src/net/i2p/client/impl/SetDateMessageHandler.java
index 68adb2d60e..723bb7e2fe 100644
--- a/core/java/src/net/i2p/client/SetDateMessageHandler.java
+++ b/core/java/src/net/i2p/client/impl/SetDateMessageHandler.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 /*
  * free (adj.): unencumbered; not under the control of others
diff --git a/core/java/src/net/i2p/client/SubSession.java b/core/java/src/net/i2p/client/impl/SubSession.java
similarity index 98%
rename from core/java/src/net/i2p/client/SubSession.java
rename to core/java/src/net/i2p/client/impl/SubSession.java
index 0e2fca90b6..51c5f0b164 100644
--- a/core/java/src/net/i2p/client/SubSession.java
+++ b/core/java/src/net/i2p/client/impl/SubSession.java
@@ -1,4 +1,4 @@
-package net.i2p.client;
+package net.i2p.client.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -9,6 +9,8 @@ import java.util.Map;
 import java.util.Properties;
 
 import net.i2p.I2PAppContext;
+import net.i2p.client.I2PSession;
+import net.i2p.client.I2PSessionException;
 import net.i2p.data.Destination;
 import net.i2p.data.Hash;
 import net.i2p.data.PrivateKey;
diff --git a/core/java/src/net/i2p/client/impl/package.html b/core/java/src/net/i2p/client/impl/package.html
new file mode 100644
index 0000000000..393014d7b8
--- /dev/null
+++ b/core/java/src/net/i2p/client/impl/package.html
@@ -0,0 +1,11 @@
+<html><body>
+<p>Implements the base I2P SDK for developing applications that communicate 
+through I2P.</p>
+
+<p>
+These classes are for implementing the client side of I2CP
+and are not to be used externally.
+Subject to change and not part of the public API.
+Moved from net.i2p.client in 0.9.21.
+</p>
+</body></html>
diff --git a/core/java/src/net/i2p/client/package.html b/core/java/src/net/i2p/client/package.html
index f7287d5ac0..9d250b4dfb 100644
--- a/core/java/src/net/i2p/client/package.html
+++ b/core/java/src/net/i2p/client/package.html
@@ -1,6 +1,13 @@
 <html><body>
-<p>Implements the base I2P SDK for developing applications that communicate 
-through I2P.</p>
+<p>
+Interfaces and factories for
+the base I2P SDK used to develop applications that communicate 
+through I2P.
+</p>
+
+<p>
+Implementation moved to net.i2p.client.impl in 0.9.21.
+</p>
 
 <p>When a client application wants to communicate over I2P, the first thing it 
 needs to do is get a {@link net.i2p.client.I2PClient} from the 
diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java
index 364648ce6d..c2994666e5 100644
--- a/router/java/src/net/i2p/router/Router.java
+++ b/router/java/src/net/i2p/router/Router.java
@@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap;
 
 import gnu.getopt.Getopt;
 
-import net.i2p.client.I2PSessionImpl;
+import net.i2p.client.impl.I2PSessionImpl;
 import net.i2p.crypto.SigUtil;
 import net.i2p.data.Base64;
 import net.i2p.data.Certificate;
diff --git a/router/java/src/net/i2p/router/client/ClientManagerFacadeImpl.java b/router/java/src/net/i2p/router/client/ClientManagerFacadeImpl.java
index cc82592d5a..385d3bd2be 100644
--- a/router/java/src/net/i2p/router/client/ClientManagerFacadeImpl.java
+++ b/router/java/src/net/i2p/router/client/ClientManagerFacadeImpl.java
@@ -132,7 +132,7 @@ public class ClientManagerFacadeImpl extends ClientManagerFacade implements Inte
      * LeaseSet.
      *
      * @param dest Destination from which the LeaseSet's authorization should be requested
-     * @param ls  LeaseSet with requested leases - this object must be updated to contain the 
+     * @param set LeaseSet with requested leases - this object must be updated to contain the 
      *            signed version (as well as any changed/added/removed Leases).
      *            The LeaseSet contains Leases only; it is unsigned and does not have the destination set.
      */
-- 
GitLab