public abstract class NewRelicClient extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
The default port for New Relic.
|
protected HttpContext |
httpContext |
protected HttpClientProvider |
provider |
Constructor and Description |
---|
NewRelicClient()
Default constructor.
|
NewRelicClient(String hostname,
int port,
HttpClientProvider provider)
Constructor that takes a hostname, port and provider.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialize()
Initialise the HTTP client provider and context.
|
HttpContext |
getHttpContext()
Returns the context used to make calls and deserialize payloads.
|
String |
getUriPrefix()
Returns the uri prefix for resources used by the client.
|
boolean |
handleErrors()
Returns
true if errors should be handled rather than ignored. |
NewRelicClient |
initialize()
Called after setting configuration properties.
|
void |
setHandleErrors(boolean b)
Set to
true if errors should be handled rather than ignored. |
void |
setHostname(String hostname)
Sets the name of the host to connect to.
|
void |
setHttpClientProvider(HttpClientProvider provider)
Sets the HTTP client provider.
|
void |
setPort(int port)
Sets the port of the host to connect to.
|
public static final int DEFAULT_PORT
protected HttpContext httpContext
protected HttpClientProvider provider
public NewRelicClient()
public NewRelicClient(String hostname, int port, HttpClientProvider provider)
hostname
- The hostname of the serverport
- The port of the serverprovider
- The HTTP client providerpublic NewRelicClient initialize()
public void setHttpClientProvider(HttpClientProvider provider)
provider
- The interface for the underlying Jersey client providerpublic void setHostname(String hostname)
hostname
- The name of the hostpublic void setPort(int port)
The default port is 443.
port
- The port of the hostpublic HttpContext getHttpContext()
public void setHandleErrors(boolean b)
true
if errors should be handled rather than ignored.b
- true
if errors should be handledpublic boolean handleErrors()
true
if errors should be handled rather than ignored.true
if errors should be handledpublic String getUriPrefix()
Defaults to an empty prefix. Where used, should always start with a "/".
protected void checkInitialize()
Copyright © 2018. All rights reserved.