public abstract class CollectorChannel
extends java.lang.Object
Constructor and Description |
---|
CollectorChannel() |
Modifier and Type | Method and Description |
---|---|
void |
addRequestProperty(java.lang.String property,
java.lang.String value)
Adds a header to the request.
|
int |
getConnectTimeout()
Gets the connection timeout, in milliseconds
|
abstract java.io.InputStream |
getErrorStream()
Sends the request, if it hasn't been sent already, and opens a stream for reading the response body.
|
abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaderFields()
Sends the request, if it hasn't been sent already, and returns the response headers
|
abstract java.io.InputStream |
getInputStream()
Sends the request, if it hasn't been sent already, and opens a stream for reading the response body.
|
abstract java.io.OutputStream |
getOutputStream()
Opens a stream for writing a request body.
|
int |
getReadTimeout()
Gets the read timeout, in milliseconds
|
java.lang.String |
getRequestMethod() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getRequestProperties()
Gets all the request properties as a list
|
abstract int |
getResponseCode()
Sends the request, if it hasn't been sent already, and returns the response status code.
|
abstract java.lang.String |
getResponseMessage()
Sends the request, if it hasn't been sent already, and returns the http response status message.
|
java.net.URL |
getURL()
Gets the URL that the request is being sent to
|
void |
setConnectTimeout(int connectTimeout)
Sets the timeout, in milliseconds, for establishing a connection to the collector.
|
void |
setReadTimeout(int readTimeout)
Sets the timeout, in milliseconds, for reading data from the InputStream established
with the collector.
|
void |
setRequestMethod(java.lang.String requestMethod)
Sets the HTTP method used to make the request.
|
void |
setURL(java.net.URL url)
Sets the URL to which the request should be sent.
|
public void setURL(java.net.URL url)
url
- The URL of the Collector Channelpublic java.net.URL getURL()
public void setConnectTimeout(int connectTimeout)
connectTimeout
- The https connection timeout in millisecondspublic int getConnectTimeout()
public void setReadTimeout(int readTimeout)
readTimeout
- Timeout, in milliseconds, if data is not read on the input stream from the Collectorpublic int getReadTimeout()
public void addRequestProperty(java.lang.String property, java.lang.String value)
property
- The name of the header.value
- The value of the header.public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestProperties()
public void setRequestMethod(java.lang.String requestMethod)
requestMethod
- The request method, such as "GET" or "POST".public java.lang.String getRequestMethod()
public abstract java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic abstract java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic abstract java.io.InputStream getErrorStream() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic abstract int getResponseCode() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic abstract java.lang.String getResponseMessage() throws java.io.IOException
java.io.IOException
- if an I/O error occurs