hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r514850 - in /jakarta/httpcomponents/httpcore/trunk: module-main/src/main/java/org/apache/http/impl/ module-nio/src/main/java/org/apache/http/impl/nio/ module-nio/src/main/java/org/apache/http/impl/nio/codecs/
Date Mon, 05 Mar 2007 20:21:59 GMT
Author: olegk
Date: Mon Mar  5 12:21:58 2007
New Revision: 514850

URL: http://svn.apache.org/viewvc?view=rev&rev=514850
Log:
Added Object#toString() method to connection and codec classes

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityEncoder.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedEncoder.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
Mon Mar  5 12:21:58 2007
@@ -58,4 +58,18 @@
         super.bind(socket, params);
     }
 
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("HTTP client connection (");
+        if (isOpen()) {
+            buffer.append(this.socket.getLocalAddress());
+            buffer.append("->");
+            buffer.append(this.socket.getInetAddress());
+        } else {
+            buffer.append("closed");
+        }
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
Mon Mar  5 12:21:58 2007
@@ -55,5 +55,19 @@
         assertNotOpen();
         super.bind(socket, params);
     }
+
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("HTTP server connection (");
+        if (isOpen()) {
+            buffer.append(this.socket.getLocalAddress());
+            buffer.append("->");
+            buffer.append(this.socket.getInetAddress());
+        } else {
+            buffer.append("closed");
+        }
+        buffer.append(")");
+        return buffer.toString();
+    }
     
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnection.java
Mon Mar  5 12:21:58 2007
@@ -199,4 +199,18 @@
         resetOutput();
     }
     
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("HTTP client connection (");
+        if (isOpen()) {
+            buffer.append(this.session.getLocalAddress());
+            buffer.append("->");
+            buffer.append(this.session.getRemoteAddress());
+        } else {
+            buffer.append("closed");
+        }
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnection.java
Mon Mar  5 12:21:58 2007
@@ -198,4 +198,18 @@
         resetInput();
     }
     
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("HTTP server connection (");
+        if (isOpen()) {
+            buffer.append(this.session.getLocalAddress());
+            buffer.append("->");
+            buffer.append(this.session.getRemoteAddress());
+        } else {
+            buffer.append("closed");
+        }
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
Mon Mar  5 12:21:58 2007
@@ -226,5 +226,13 @@
             return new Header[] {};
         }
     }
+
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Chunk decoder (completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
     
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkEncoder.java
Mon Mar  5 12:21:58 2007
@@ -78,4 +78,12 @@
         this.completed = true;
     }
     
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Chunk encoder (completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java
Mon Mar  5 12:21:58 2007
@@ -63,4 +63,12 @@
         return bytesRead;
     }
 
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Identity decoder (completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityEncoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityEncoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityEncoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityEncoder.java
Mon Mar  5 12:21:58 2007
@@ -54,5 +54,13 @@
         assertNotCompleted();
         return this.channel.write(src);
     }
+ 
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Identity encoder (completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
     
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
Mon Mar  5 12:21:58 2007
@@ -85,4 +85,16 @@
         return bytesRead;
     }
 
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Length delimited decoder (content length: ");
+        buffer.append(this.contentLength);
+        buffer.append("; pos: ");
+        buffer.append(this.len);
+        buffer.append("; completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
+    
 }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedEncoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedEncoder.java?view=diff&rev=514850&r1=514849&r2=514850
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedEncoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedEncoder.java
Mon Mar  5 12:21:58 2007
@@ -78,5 +78,17 @@
         }
         return bytesWritten;
     }
+
+    public String toString() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Length delimited encoder (content length: ");
+        buffer.append(this.contentLength);
+        buffer.append("; pos: ");
+        buffer.append(this.len);
+        buffer.append("; completed: ");
+        buffer.append(this.completed);
+        buffer.append(")");
+        return buffer.toString();
+    }
     
 }



Mime
View raw message