Package com.caucho.hessian.client
Class HessianURLConnection
- java.lang.Object
-
- com.caucho.hessian.client.AbstractHessianConnection
-
- com.caucho.hessian.client.HessianURLConnection
-
- All Implemented Interfaces:
HessianConnection
public class HessianURLConnection extends AbstractHessianConnection
Internal connection to a server. The default connection is based on java.net
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(java.lang.String key, java.lang.String value)Adds a HTTP header.voidclose()Close/free the connectionvoiddestroy()Disconnect the connectionjava.lang.StringgetContentEncoding()Returns the content encodingjava.io.InputStreamgetInputStream()Returns the InputStream to the resultjava.io.OutputStreamgetOutputStream()Returns the output stream for the request.intgetStatusCode()Returns the status code.java.lang.StringgetStatusMessage()Returns the status string.protected voidparseResponseHeaders(java.net.HttpURLConnection conn)voidsendRequest()Sends the request
-
-
-
Method Detail
-
addHeader
public void addHeader(java.lang.String key, java.lang.String value)Adds a HTTP header.- Specified by:
addHeaderin interfaceHessianConnection- Overrides:
addHeaderin classAbstractHessianConnection
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOExceptionReturns the output stream for the request.- Specified by:
getOutputStreamin interfaceHessianConnection- Specified by:
getOutputStreamin classAbstractHessianConnection- Throws:
java.io.IOException
-
sendRequest
public void sendRequest() throws java.io.IOExceptionSends the request- Specified by:
sendRequestin interfaceHessianConnection- Specified by:
sendRequestin classAbstractHessianConnection- Throws:
java.io.IOException
-
parseResponseHeaders
protected void parseResponseHeaders(java.net.HttpURLConnection conn) throws java.io.IOException- Throws:
java.io.IOException
-
getStatusCode
public int getStatusCode()
Returns the status code.- Specified by:
getStatusCodein interfaceHessianConnection- Specified by:
getStatusCodein classAbstractHessianConnection
-
getStatusMessage
public java.lang.String getStatusMessage()
Returns the status string.- Specified by:
getStatusMessagein interfaceHessianConnection- Specified by:
getStatusMessagein classAbstractHessianConnection
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionReturns the InputStream to the result- Specified by:
getInputStreamin interfaceHessianConnection- Specified by:
getInputStreamin classAbstractHessianConnection- Throws:
java.io.IOException
-
getContentEncoding
public java.lang.String getContentEncoding()
Description copied from interface:HessianConnectionReturns the content encoding- Specified by:
getContentEncodingin interfaceHessianConnection- Overrides:
getContentEncodingin classAbstractHessianConnection
-
close
public void close()
Close/free the connection- Specified by:
closein interfaceHessianConnection- Overrides:
closein classAbstractHessianConnection
-
destroy
public void destroy()
Disconnect the connection- Specified by:
destroyin interfaceHessianConnection- Specified by:
destroyin classAbstractHessianConnection
-
-