diff options
Diffstat (limited to 'src/org/apache/http/io')
-rw-r--r-- | src/org/apache/http/io/HttpMessageParser.java | 53 | ||||
-rw-r--r-- | src/org/apache/http/io/HttpMessageWriter.java | 53 | ||||
-rw-r--r-- | src/org/apache/http/io/HttpTransportMetrics.java | 46 | ||||
-rw-r--r-- | src/org/apache/http/io/SessionInputBuffer.java | 63 | ||||
-rw-r--r-- | src/org/apache/http/io/SessionOutputBuffer.java | 63 | ||||
-rw-r--r-- | src/org/apache/http/io/package.html | 47 |
6 files changed, 325 insertions, 0 deletions
diff --git a/src/org/apache/http/io/HttpMessageParser.java b/src/org/apache/http/io/HttpMessageParser.java new file mode 100644 index 0000000..5c24736 --- /dev/null +++ b/src/org/apache/http/io/HttpMessageParser.java @@ -0,0 +1,53 @@ +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/HttpMessageParser.java $ + * $Revision: 567370 $ + * $Date: 2007-08-19 01:13:21 -0700 (Sun, 19 Aug 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ + +package org.apache.http.io; + +import java.io.IOException; + +import org.apache.http.HttpException; +import org.apache.http.HttpMessage; + +/** + * Generic message parser interface. + * + * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> + * + * @version $Revision: 567370 $ + * + * @since 4.0 + */ +public interface HttpMessageParser { + + HttpMessage parse() + throws IOException, HttpException; + +} diff --git a/src/org/apache/http/io/HttpMessageWriter.java b/src/org/apache/http/io/HttpMessageWriter.java new file mode 100644 index 0000000..b6ac7c1 --- /dev/null +++ b/src/org/apache/http/io/HttpMessageWriter.java @@ -0,0 +1,53 @@ +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/HttpMessageWriter.java $ + * $Revision: 567370 $ + * $Date: 2007-08-19 01:13:21 -0700 (Sun, 19 Aug 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ + +package org.apache.http.io; + +import java.io.IOException; + +import org.apache.http.HttpException; +import org.apache.http.HttpMessage; + +/** + * Generic message writer interface. + * + * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> + * + * @version $Revision: 567370 $ + * + * @since 4.0 + */ +public interface HttpMessageWriter { + + void write(HttpMessage message) + throws IOException, HttpException; + +} diff --git a/src/org/apache/http/io/HttpTransportMetrics.java b/src/org/apache/http/io/HttpTransportMetrics.java new file mode 100644 index 0000000..f88e036 --- /dev/null +++ b/src/org/apache/http/io/HttpTransportMetrics.java @@ -0,0 +1,46 @@ +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/HttpTransportMetrics.java $ + * $Revision: 536667 $ + * $Date: 2007-05-09 14:48:41 -0700 (Wed, 09 May 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ + +package org.apache.http.io; + +public interface HttpTransportMetrics { + + /** + * Returns the number of bytes trasferred. + */ + long getBytesTransferred(); + + /** + * Resets the counts + */ + void reset(); + +} diff --git a/src/org/apache/http/io/SessionInputBuffer.java b/src/org/apache/http/io/SessionInputBuffer.java new file mode 100644 index 0000000..d7824d9 --- /dev/null +++ b/src/org/apache/http/io/SessionInputBuffer.java @@ -0,0 +1,63 @@ +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/SessionInputBuffer.java $ + * $Revision: 560528 $ + * $Date: 2007-07-28 04:34:17 -0700 (Sat, 28 Jul 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ + +package org.apache.http.io; + +import java.io.IOException; + +import org.apache.http.util.CharArrayBuffer; + +/** + * Session input buffer for blocking connections. + * + * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> + * + * @version $Revision: 560528 $ + * + * @since 4.0 + */ +public interface SessionInputBuffer { + + int read(byte[] b, int off, int len) throws IOException; + + int read(byte[] b) throws IOException; + + int read() throws IOException; + + int readLine(CharArrayBuffer buffer) throws IOException; + + String readLine() throws IOException; + + boolean isDataAvailable(int timeout) throws IOException; + + HttpTransportMetrics getMetrics(); + +} diff --git a/src/org/apache/http/io/SessionOutputBuffer.java b/src/org/apache/http/io/SessionOutputBuffer.java new file mode 100644 index 0000000..6587a26 --- /dev/null +++ b/src/org/apache/http/io/SessionOutputBuffer.java @@ -0,0 +1,63 @@ +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/SessionOutputBuffer.java $ + * $Revision: 560528 $ + * $Date: 2007-07-28 04:34:17 -0700 (Sat, 28 Jul 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ + +package org.apache.http.io; + +import java.io.IOException; + +import org.apache.http.util.CharArrayBuffer; + +/** + * Session output buffer for blocking connections. + * + * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> + * + * @version $Revision: 560528 $ + * + * @since 4.0 + */ +public interface SessionOutputBuffer { + + void write(byte[] b, int off, int len) throws IOException; + + void write(byte[] b) throws IOException; + + void write(int b) throws IOException; + + void writeLine(String s) throws IOException; + + void writeLine(CharArrayBuffer buffer) throws IOException; + + void flush() throws IOException; + + HttpTransportMetrics getMetrics(); + +} diff --git a/src/org/apache/http/io/package.html b/src/org/apache/http/io/package.html new file mode 100644 index 0000000..da9fabf --- /dev/null +++ b/src/org/apache/http/io/package.html @@ -0,0 +1,47 @@ +<html> +<head> +<!-- +/* + * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/io/package.html $ + * $Revision: 503192 $ + * $Date: 2007-02-03 03:55:49 -0800 (Sat, 03 Feb 2007) $ + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + * + */ +--> +</head> +<body> +The transport layer abstraction of the HTTP components. + +This layer is used to transfer messages over connections. +Connections are typically based on sockets: plain or secure, +direct or via SOCKS hosts, with bandwidth throttling, or +whatever else you might think of. +However, opening connections is not within the responsibility +of HttpCore. + +</body> +</html> |