You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/11/29 03:21:05 UTC

svn commit: r1642392 - in /commons/proper/net/trunk/src: changes/ main/java/org/apache/commons/net/telnet/

Author: sebb
Date: Sat Nov 29 02:21:05 2014
New Revision: 1642392

URL: http://svn.apache.org/r1642392
Log:
NET-554 Simplify TelnetOptionHandler class hierarchy

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/EchoOptionHandler.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SimpleOptionHandler.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SuppressGAOptionHandler.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Sat Nov 29 02:21:05 2014
@@ -68,6 +68,9 @@ This is mainly a bug-fix release. See fu
   IMAPExportMbox (example app) allows IMAP folders to be exported into an mbox file.
   This is the inverse of the IMAPImportMbox example added previously
         ">
+            <action issue="NET-554" type="update" dev="sebb">
+            Simplify TelnetOptionHandler class hierarchy
+            </action>
             <action issue="NET-558" type="fix" dev="sebb" due-to="Ralph Becker">
             FTPClient.getModificationTime(filename) returns complete received line including response code
             </action>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/EchoOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/EchoOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/EchoOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/EchoOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -51,40 +51,4 @@ public class EchoOptionHandler extends T
         super(TelnetOption.ECHO, false, false, false, false);
     }
 
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @param suboptionData - the sequence received, without IAC SB &amp; IAC SE
-     * @param suboptionLength - the length of data in suboption_data
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] answerSubnegotiation(int suboptionData[],
-                                        int suboptionLength)
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationLocal()
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SimpleOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SimpleOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SimpleOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SimpleOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -58,39 +58,4 @@ public class SimpleOptionHandler extends
         super(optcode, false, false, false, false);
     }
 
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @param suboptionData - the sequence received, without IAC SB &amp; IAC SE
-     * @param suboptionLength - the length of data in suboption_data
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationLocal()
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SuppressGAOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SuppressGAOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SuppressGAOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/SuppressGAOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -51,39 +51,4 @@ public class SuppressGAOptionHandler ext
         super(TelnetOption.SUPPRESS_GO_AHEAD, false, false, false, false);
     }
 
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @param suboptionData - the sequence received, without IAC SB &amp; IAC SE
-     * @param suboptionLength - the length of data in suboption_data
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationLocal()
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -191,7 +191,9 @@ public abstract class TelnetOptionHandle
     /***
      * Method called upon reception of a subnegotiation for this option
      * coming from the other end.
-     * Must be implemented by the actual TelnetOptionHandler to specify
+     * <p>
+     * This implementation returns null, and
+     * must be overridden by the actual TelnetOptionHandler to specify
      * which response must be sent for the subnegotiation request.
      * <p>
      * @param suboptionData - the sequence received, without IAC SB &amp; IAC SE
@@ -200,8 +202,9 @@ public abstract class TelnetOptionHandle
      * @return response to be sent to the subnegotiation sequence. TelnetClient
      * will add IAC SB &amp; IAC SE. null means no response
      ***/
-    public abstract int[] answerSubnegotiation(int suboptionData[],
-                            int suboptionLength);
+    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength) {
+        return null;
+    }
 
     /***
      * This method is invoked whenever this option is acknowledged active on
@@ -209,10 +212,15 @@ public abstract class TelnetOptionHandle
      * The method is used to specify a subnegotiation sequence that will be
      * sent by TelnetClient when the option is activated.
      * <p>
+     * This implementation returns null, and must be overriden by 
+     * the actual TelnetOptionHandler to specify
+     * which response must be sent for the subnegotiation request.
      * @return subnegotiation sequence to be sent by TelnetClient. TelnetClient
      * will add IAC SB &amp; IAC SE. null means no subnegotiation.
      ***/
-    public abstract int[] startSubnegotiationLocal();
+    public int[] startSubnegotiationLocal() {
+        return null;
+    }
 
     /***
      * This method is invoked whenever this option is acknowledged active on
@@ -220,10 +228,15 @@ public abstract class TelnetOptionHandle
      * The method is used to specify a subnegotiation sequence that will be
      * sent by TelnetClient when the option is activated.
      * <p>
+     * This implementation returns null, and must be overriden by 
+     * the actual TelnetOptionHandler to specify
+     * which response must be sent for the subnegotiation request.
      * @return subnegotiation sequence to be sent by TelnetClient. TelnetClient
      * will add IAC SB &amp; IAC SE. null means no subnegotiation.
      ***/
-    public abstract int[] startSubnegotiationRemote();
+    public int[] startSubnegotiationRemote() {
+        return null;
+    }
 
     /***
      * Returns a boolean indicating whether a WILL request sent to the other

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -111,26 +111,4 @@ public class TerminalTypeOptionHandler e
         }
         return null;
     }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationLocal()
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java?rev=1642392&r1=1642391&r2=1642392&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java Sat Nov 29 02:21:05 2014
@@ -99,20 +99,6 @@ public class WindowSizeOptionHandler ext
 
     /***
      * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @param suboptionData - the sequence received, without IAC SB &amp; IAC SE
-     * @param suboptionLength - the length of data in suboption_data
-     * <p>
-     * @return terminal type information
-     ***/
-    @Override
-    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
      * This will send the client Height and Width to the server.
      * <p>
      * @return array to send to remote system
@@ -175,14 +161,4 @@ public class WindowSizeOptionHandler ext
         return response;
     }
 
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    @Override
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
 }