Package com.dynatrace.android.agent.conf
Class ConfigurationBuilder
- java.lang.Object
-
- com.dynatrace.android.agent.conf.ConfigurationBuilder
-
- Direct Known Subclasses:
AppMonConfigurationBuilder
,DynatraceConfigurationBuilder
public class ConfigurationBuilder extends Object
This class is needed for generating the agentConfiguration
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.dynatrace.android.agent.conf.Configuration
buildConfiguration()
Builds the agent configuration object.ConfigurationBuilder
withActivityMonitoring(boolean enabled)
Enables/disables lifecycle monitoring for the classActivity
.ConfigurationBuilder
withAutoUserActionModifier(UserActionModifier modifier)
Sets aUserActionModifier
that is invoked each time a new user action is created via auto-instrumentation.ConfigurationBuilder
withCertificateValidation(boolean enabled)
Enables/disables certificate validation.ConfigurationBuilder
withCommunicationProblemListener(CommunicationProblemListener listener)
Sets aCommunicationProblemListener
that will be asynchronously notified when the agent can't successfully communicate with the beacon.ConfigurationBuilder
withCrashReporting(boolean enabled)
Enables/disables crash reporting.ConfigurationBuilder
withDebugLogging(boolean enabled)
Enables/disables debug logging.ConfigurationBuilder
withHybridMonitoring(boolean enabled)
Enables/disables the hybrid monitoring feature.ConfigurationBuilder
withKeyManagers(KeyManager[] keyManagers)
Allows the agent to use client certificates.ConfigurationBuilder
withKeyStore(KeyStore keyStore)
Allows the agent to verify self-signed certificates.ConfigurationBuilder
withMonitoredDomains(String... monitoredDomains)
For hybrid applications using the JavaScript library, cookies need to be set for each instrumented domain or server the application communicates with.ConfigurationBuilder
withMonitoredHttpsDomains(String... monitoredHttpsDomains)
For hybrid applications using the JavaScript library, cookies need to be set for each instrumented domain or server the application communicates with.ConfigurationBuilder
withStartupLoadBalancing(boolean enabled)
Enables/disables advanced load balancing for the agent startup The default value isfalse
.ConfigurationBuilder
withUserOptIn(boolean enabled)
Enables/disables the user opt-in feature.
-
-
-
Method Detail
-
withCertificateValidation
public ConfigurationBuilder withCertificateValidation(boolean enabled)
Enables/disables certificate validation. The default value istrue
.
WARNING: If the certificate validation is deactivated, the agent will not verify the server certificate and therefore the agent communication is vulnerable to malicious attacks.- Parameters:
enabled
- the certificate validation flag- Returns:
- the
ConfigurationBuilder
object
-
withKeyStore
public ConfigurationBuilder withKeyStore(KeyStore keyStore)
Allows the agent to verify self-signed certificates. Instead of this method also the Network Security Configuration feature can be used.- Parameters:
keyStore
- the key store holding the certificate(s) for SSL communications- Returns:
- the
ConfigurationBuilder
object - See Also:
- Network Security Configuration
-
withKeyManagers
public ConfigurationBuilder withKeyManagers(KeyManager[] keyManagers)
Allows the agent to use client certificates. Has to be used in combination with the methodwithKeyStore(KeyStore)
.- Parameters:
keyManagers
- an array of key managers.- Returns:
- the
ConfigurationBuilder
object
-
withMonitoredDomains
public ConfigurationBuilder withMonitoredDomains(String... monitoredDomains)
For hybrid applications using the JavaScript library, cookies need to be set for each instrumented domain or server the application communicates with. You can specify domains, host or IP addresses. Domains or sub-domains must start with a dot.- To set a domain-level cookie, use .company.com
- To set a subdomain-level cookie, use .subdomain.company.com
- To set a server-specific cookie, use server.company.com
- To set a cookie for an IP address, use the IP address of that system
- Parameters:
monitoredDomains
- a list of domains, hosts or IP addresses- Returns:
- the
ConfigurationBuilder
object - See Also:
withHybridMonitoring(boolean)
-
withMonitoredHttpsDomains
public ConfigurationBuilder withMonitoredHttpsDomains(String... monitoredHttpsDomains)
For hybrid applications using the JavaScript library, cookies need to be set for each instrumented domain or server the application communicates with. You can specify domains, host or IP addresses. Domains or sub-domains must start with a dot. Domains added here will create secure cookies.- To set a domain-level cookie, use https://.company.com
- To set a subdomain-level cookie, use https://.subdomain.company.com
- To set a server-specific cookie, use https://server.company.com
- To set a cookie for an IP address, use the IP address of that system plus https://
- Parameters:
monitoredHttpsDomains
- a list of domains, hosts or IP addresses- Returns:
- the
ConfigurationBuilder
object - Since:
- 8.232
- See Also:
withHybridMonitoring(boolean)
-
withHybridMonitoring
public ConfigurationBuilder withHybridMonitoring(boolean enabled)
Enables/disables the hybrid monitoring feature. The default value isfalse
.- Parameters:
enabled
- the hybrid monitoring flag- Returns:
- the
ConfigurationBuilder
object
-
withDebugLogging
public ConfigurationBuilder withDebugLogging(boolean enabled)
Enables/disables debug logging.
WARNING: Do NOT activate debug logging for your production apps.- Parameters:
enabled
- the debug logging flag- Returns:
- the
ConfigurationBuilder
object
-
withUserOptIn
public ConfigurationBuilder withUserOptIn(boolean enabled)
Enables/disables the user opt-in feature. This feature allows the user to dynamically adjust the privacy settings. The default value isfalse
.- Parameters:
enabled
- the user opt-in flag- Returns:
- the
ConfigurationBuilder
object
-
withStartupLoadBalancing
public ConfigurationBuilder withStartupLoadBalancing(boolean enabled)
Enables/disables advanced load balancing for the agent startup The default value isfalse
.- Parameters:
enabled
- true, if advanced load balancing for the startup should be enabled- Returns:
- the
ConfigurationBuilder
object - Since:
- 8.203
-
withCrashReporting
public ConfigurationBuilder withCrashReporting(boolean enabled)
Enables/disables crash reporting. If enabled, the agent captures all uncaught exceptions and errors. The captured crashes will be sent immediately to the server and will pass the exception to the previous default uncaught exception handler. The default value isfalse
.- Parameters:
enabled
- true, if crashes should be reported- Returns:
- the
ConfigurationBuilder
object
-
withCommunicationProblemListener
public ConfigurationBuilder withCommunicationProblemListener(CommunicationProblemListener listener)
Sets aCommunicationProblemListener
that will be asynchronously notified when the agent can't successfully communicate with the beacon. If aCommunicationProblemListener
is used, the agent will not reconnect to the beacon endpoint, when the communication fails with an invalid response code.- Parameters:
listener
- the object that should be notified- Returns:
- the
ConfigurationBuilder
object
-
withActivityMonitoring
public ConfigurationBuilder withActivityMonitoring(boolean enabled)
Enables/disables lifecycle monitoring for the classActivity
. If enabled, the agent will monitor the lifecycle events of activities. The default value istrue
.- Parameters:
enabled
- true, if lifecycle events of activities should be monitored- Returns:
- the
ConfigurationBuilder
object - Since:
- 8.223
-
withAutoUserActionModifier
public ConfigurationBuilder withAutoUserActionModifier(UserActionModifier modifier)
Sets aUserActionModifier
that is invoked each time a new user action is created via auto-instrumentation. It is not invoked for user actions created manually viaDynatrace.enterAction(String)
.- Parameters:
modifier
- modifications that should be applied to the newly created user action- Returns:
- the
ConfigurationBuilder
object - Since:
- 8.241
-
buildConfiguration
public com.dynatrace.android.agent.conf.Configuration buildConfiguration()
Builds the agent configuration object.- Returns:
- the agent configuration or null, if the configuration is invalid
-
-