public class HttpConnection extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpConnection.HttpConnectionParams |
static class |
HttpConnection.HttpConnectionParamsBuilder |
Modifier and Type | Field and Description |
---|---|
protected HttpURLConnection |
connection |
Constructor and Description |
---|
HttpConnection(URL url,
HttpConnection.HttpConnectionParams connParams,
String logIdentifier,
org.apache.tez.common.security.JobTokenSecretManager jobTokenSecretManager)
HttpConnection
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup(boolean disconnect)
Cleanup the connection.
|
boolean |
connect()
Connect to source
|
boolean |
connect(int connectionTimeout)
Connect to source with specific timeout
|
DataInputStream |
getInputStream()
Get the inputstream from the connection
|
void |
validate() |
protected HttpURLConnection connection
public HttpConnection(URL url, HttpConnection.HttpConnectionParams connParams, String logIdentifier, org.apache.tez.common.security.JobTokenSecretManager jobTokenSecretManager) throws IOException
url
- connParams
- logIdentifier
- jobTokenSecretManager
- IOException
public boolean connect() throws IOException
IOException
- upon connection failurepublic boolean connect(int connectionTimeout) throws IOException
connectionTimeout
- IOException
- upon connection failurepublic void validate() throws IOException
IOException
public DataInputStream getInputStream() throws IOException
IOException
public void cleanup(boolean disconnect) throws IOException
disconnect
- Close the connection if this is true; otherwise respect keepaliveIOException
Copyright © 2015 Apache Software Foundation. All rights reserved.