public static class AgentConfiguration.Builder
extends java.lang.Object
A class for setting up instances of AgentConfiguration.
| Modifier and Type | Method and Description |
|---|---|
AgentConfiguration |
build()
Generates the agent configuration based on the parameters passed through the other methods.
|
AgentConfiguration.Builder |
withAppKey(java.lang.String appKey)
Sets the application key used by the SDK.
|
AgentConfiguration.Builder |
withApplicationName(java.lang.String applicationName)
Sets the name of this mobile application.
|
AgentConfiguration.Builder |
withCollectorChannelFactory(CollectorChannelFactory collectorChannelFactory)
Sets the collector channel to use.
|
AgentConfiguration.Builder |
withCollectorURL(java.lang.String collectorURL)
Sets the URL of the collector to which the agent will report.
|
AgentConfiguration.Builder |
withCompileTimeInstrumentationCheck(boolean enabled)
Sets whether a check is performed during initialization to check if compile time instrumentation was successful.
|
AgentConfiguration.Builder |
withContext(android.content.Context context)
Sets the context to be used by the SDK.
|
AgentConfiguration.Builder |
withDynamicInfoPointURL(java.lang.String infoPointURL)
Set the URL of InfoPoint endpoint.
|
AgentConfiguration.Builder |
withExcludedUrlPatterns(java.util.Set<java.lang.String> excludedUrlPatterns)
Sets the regex patterns for urls which need to be filtered.
|
AgentConfiguration.Builder |
withLoggingEnabled(boolean loggingEnabled)
Sets whether info logs are enabled or not.
|
AgentConfiguration.Builder |
withLoggingLevel(int loggingLevel)
Sets the logging level of the agent.
|
public AgentConfiguration.Builder withAppKey(java.lang.String appKey)
Sets the application key used by the SDK. This is a required property.
public AgentConfiguration.Builder withContext(android.content.Context context)
Sets the context to be used by the SDK. This is a required property. If unsure, use getApplicationContext().
public AgentConfiguration.Builder withCollectorURL(java.lang.String collectorURL)
Sets the URL of the collector to which the agent will report.
NOTE: Only use this if you are using an on-premise collector.
public AgentConfiguration.Builder withDynamicInfoPointURL(java.lang.String infoPointURL)
Set the URL of InfoPoint endpoint.
NOTE: Do not use this method unless you are using a separate DexGen server with your on-prem installation.
public AgentConfiguration.Builder withApplicationName(java.lang.String applicationName)
Sets the name of this mobile application. If not set, the application name is the package name from the Android Manifest. Most users will not need this.
The parameter applicationName should follow Java-language-style. It may contain uppercase or lowercase letters (‘A’ through ‘Z’), numbers, and underscores (‘_’). Individual package name parts may only start with letters. Reverse-DNS format is recommended.
NOTE: If building AgentConfiguration with this method, all data reported from this application is associated with applicationName, and appears together in dashboards.
public AgentConfiguration.Builder withExcludedUrlPatterns(java.util.Set<java.lang.String> excludedUrlPatterns)
Sets the regex patterns for urls which need to be filtered.
Any urls matching one of defined patterns will not be tracked. This field is optional
public AgentConfiguration.Builder withLoggingEnabled(boolean loggingEnabled)
Sets whether info logs are enabled or not. Overwrites any previous value set using withLoggingLevel(int).
WARNING: Not recommended for production use.
public AgentConfiguration.Builder withLoggingLevel(int loggingLevel)
Sets the logging level of the agent. Default is Instrumentation.LOGGING_LEVEL_NONE. Overwrites any previous value set using withLoggingEnabled(boolean).
Possible values are:
Instrumentation.LOGGING_LEVEL_NONEInstrumentation.LOGGING_LEVEL_INFOInstrumentation.LOGGING_LEVEL_VERBOSEWARNING: Not recommended for production use.
java.lang.IllegalArgumentException - if logging level is invalidpublic AgentConfiguration.Builder withCompileTimeInstrumentationCheck(boolean enabled)
Sets whether a check is performed during initialization to check if compile time instrumentation was successful. Default is enabled.
Compile time instrumentation is required for supporting a number of features such as Network Request reporting, Application Not Responding Reports, Info Points, etc.
By default, agent will throw an exception if you attempt to start it without doing a compile time instrumentation(using one of our build plugins for ant/maven/gradle). You can disable this check by passing in ‘false’.
enabled - false to disable this check, true to enable (default is enabled)public AgentConfiguration.Builder withCollectorChannelFactory(CollectorChannelFactory collectorChannelFactory)
Sets the collector channel to use.
A custom collector channel allows you to have more control over how the SDK communicates with the collector. Most users will not use this mechanism.
public AgentConfiguration build()
Generates the agent configuration based on the parameters passed through the other methods.
java.lang.NullPointerException - if a required parameter is null.