Package com.newrelic.telemetry
Class SenderConfiguration.SenderConfigurationBuilder
- java.lang.Object
-
- com.newrelic.telemetry.SenderConfiguration.SenderConfigurationBuilder
-
- Enclosing class:
- SenderConfiguration
public static class SenderConfiguration.SenderConfigurationBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SenderConfigurationBuilder(java.lang.String defaultUrl, java.lang.String basePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SenderConfiguration.SenderConfigurationBuilder
apiKey(java.lang.String apiKey)
Configure the New Relic Insert API key to use.SenderConfiguration.SenderConfigurationBuilder
auditLoggingEnabled(boolean auditLoggingEnabled)
Configure whether audit logging is enabled.SenderConfiguration
build()
java.net.URL
constructUrlWithHost(java.net.URI hostUri)
SenderConfiguration.SenderConfigurationBuilder
endpoint(java.lang.String scheme, java.lang.String host, int port)
Configure the endpoint for data to be sent to.SenderConfiguration.SenderConfigurationBuilder
endpointWithPath(java.net.URL endpointUrl)
Configure the *full* endpoint URL for data to be sent to, including the path.SenderConfiguration.SenderConfigurationBuilder
httpPoster(HttpPoster httpPoster)
SenderConfiguration.SenderConfigurationBuilder
secondaryUserAgent(java.lang.String secondaryUserAgent)
Configure a secondary User-Agent value to use when sending data.
-
-
-
Method Detail
-
apiKey
public SenderConfiguration.SenderConfigurationBuilder apiKey(java.lang.String apiKey)
Configure the New Relic Insert API key to use.- Returns:
- this builder;
-
httpPoster
public SenderConfiguration.SenderConfigurationBuilder httpPoster(HttpPoster httpPoster)
-
endpointWithPath
public SenderConfiguration.SenderConfigurationBuilder endpointWithPath(java.net.URL endpointUrl)
Configure the *full* endpoint URL for data to be sent to, including the path.- Parameters:
endpointUrl
- A fullURL
, including the path.- Returns:
- this builder.
-
endpoint
public SenderConfiguration.SenderConfigurationBuilder endpoint(java.lang.String scheme, java.lang.String host, int port) throws java.net.MalformedURLException
Configure the endpoint for data to be sent to. The default path will be used.- Parameters:
scheme
- A valid URL scheme, such as "https"host
- The host portion of the URL.port
- The port portion of the URL.- Returns:
- this builder.
- Throws:
java.net.MalformedURLException
- If a valid URL cannot be constructed from the pieces provided.
-
auditLoggingEnabled
public SenderConfiguration.SenderConfigurationBuilder auditLoggingEnabled(boolean auditLoggingEnabled)
Configure whether audit logging is enabled. Note: audit logging will log all data payloads sent to New Relic at DEBUG level, in plain text.- Returns:
- this builder.
-
secondaryUserAgent
public SenderConfiguration.SenderConfigurationBuilder secondaryUserAgent(java.lang.String secondaryUserAgent)
Configure a secondary User-Agent value to use when sending data. This will be appended to the default User-Agent that the SDK sends, and is useful for monitoring various sources of data coming into the New Relic systems.- Returns:
- this builder.
-
build
public SenderConfiguration build()
-
constructUrlWithHost
public java.net.URL constructUrlWithHost(java.net.URI hostUri) throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
-
-