public abstract class CollectorChannel
extends java.lang.Object
Class for customizing the connection between the agent SDK and the collector.
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.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.
|
java.net.URL |
getURL()
Gets the URL that the request should be 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 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)
Sets the URL to which the request should be sent.
public java.net.URL getURL()
Gets the URL that the request should be sent to
public void setConnectTimeout(int connectTimeout)
Sets the timeout, in milliseconds, for establishing a connection to the collector.
public int getConnectTimeout()
Gets the connection timeout, in milliseconds
public void setReadTimeout(int readTimeout)
Sets the timeout, in milliseconds, for reading data from the collector.
public int getReadTimeout()
Gets the read timeout, in milliseconds
public void addRequestProperty(java.lang.String property, java.lang.String value)
Adds a header to the request.
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()
Gets all the request properties as a list
public void setRequestMethod(java.lang.String requestMethod)
Sets the HTTP method used to make the request.
requestMethod
- The request method, such as “GET” or “POST”.public java.lang.String getRequestMethod()
public abstract java.io.OutputStream getOutputStream() throws java.io.IOException
Opens a stream for writing a request body.
java.io.IOException
- If an I/O error occurs.public abstract java.io.InputStream getInputStream() throws java.io.IOException
Sends the request, if it hasn’t been sent already, and opens a stream for reading the response body.
java.io.IOException
- If an I/O error occurs.public abstract int getResponseCode() throws java.io.IOException
Sends the request, if it hasn’t been sent already, and returns the response status code.
java.io.IOException
- If an I/O error occurs.public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields() throws java.io.IOException
Sends the request, if it hasn’t been sent already, and returns the response headers.
java.io.IOException
- If an I/O error occurs.