Class ConfigurationBuilder
- Direct Known Subclasses:
AppMonConfigurationBuilder
,DynatraceConfigurationBuilder
Configuration
.-
Method Summary
Modifier and TypeMethodDescriptioncom.dynatrace.android.agent.conf.Configuration
Builds the agent configuration object.withActivityMonitoring
(boolean enabled) Enables/disables lifecycle monitoring for the classActivity
.withAutoUserActionModifier
(UserActionModifier modifier) Sets aUserActionModifier
that is invoked each time a new user action is created via auto-instrumentation.withCertificateValidation
(boolean enabled) Deprecated.As of version 8.257, instead provide a proper certificate to the applications Network Security Configuration.Sets aCommunicationProblemListener
that will be asynchronously notified when the agent can't successfully communicate with the beacon.withCrashReporting
(boolean enabled) Enables/disables crash reporting.withDebugLogging
(boolean enabled) Enables/disables debug logging.withFileDomainCookies
(boolean fileDomainCookies) Enables/disables file scheme cookies and automatically adds the cookies to thefile://
domain.withHybridMonitoring
(boolean enabled) Enables/disables the hybrid monitoring feature.withKeyManagers
(KeyManager[] keyManagers) Deprecated.As of version 8.257, no replacementwithKeyStore
(KeyStore keyStore) Deprecated.As of version 8.257, instead add your self-signed certificate to the Network Security Configuration.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.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.withStartupLoadBalancing
(boolean enabled) Enables/disables advanced load balancing for the agent startup.withUserOptIn
(boolean enabled) Enables/disables the user opt-in feature.
-
Method Details
-
withCertificateValidation
Deprecated.As of version 8.257, instead provide a proper certificate to the applications Network Security Configuration.Enables/disables certificate validation.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.
Do not deactivate certificate validation in production.
The default value is
true
.- Parameters:
enabled
- the certificate validation flag- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - See Also:
-
withKeyStore
Deprecated.As of version 8.257, instead add your self-signed certificate to the Network Security Configuration.Allows the agent to verify self-signed certificates.With Android SDK 24, this feature became obsolete. Please use the Network Security Configuration instead.
- Parameters:
keyStore
- the key store holding the certificate(s) for SSL communications- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - See Also:
-
withKeyManagers
Deprecated.As of version 8.257, no replacementAllows the agent to use client certificates.Has to be used in combination with the method
withKeyStore(KeyStore)
.- Parameters:
keyManagers
- an array of key managers.- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - See Also:
-
withMonitoredDomains
For hybrid applications using the JavaScript library, cookies need to be set for each instrumented domain or server the application communicates with.Specify domains, hosts 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:
- this
ConfigurationBuilder
object (for usage as fluent API) - See Also:
-
withMonitoredHttpsDomains
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:
- this
ConfigurationBuilder
object (for usage as fluent API) - Since:
- 8.237
- See Also:
-
withHybridMonitoring
Enables/disables the hybrid monitoring feature.The default value is
false
.- Parameters:
enabled
- the hybrid monitoring flag- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API)
-
withFileDomainCookies
Enables/disables file scheme cookies and automatically adds the cookies to thefile://
domain.The default value is
true
.- Parameters:
fileDomainCookies
- true, if file domain cookies should be enabled- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - Since:
- 8.271
-
withDebugLogging
Enables/disables debug logging.WARNING: Do NOT activate debug logging for your production apps.
- Parameters:
enabled
- the debug logging flag- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API)
-
withUserOptIn
Enables/disables the user opt-in feature.This feature allows the user to dynamically adjust the privacy settings.
The default value is
false
.- Parameters:
enabled
- the user opt-in flag- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API)
-
withStartupLoadBalancing
Enables/disables advanced load balancing for the agent startup.The default value is
false
.- Parameters:
enabled
- true, if advanced load balancing for the startup should be enabled- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - Since:
- 8.203
-
withCrashReporting
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 is
false
.- Parameters:
enabled
- true, if crashes should be reported- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API)
-
withCommunicationProblemListener
Sets aCommunicationProblemListener
that will be asynchronously notified when the agent can't successfully communicate with the beacon.If a
CommunicationProblemListener
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:
- this
ConfigurationBuilder
object (for usage as fluent API)
-
withActivityMonitoring
Enables/disables lifecycle monitoring for the classActivity
.If enabled, the agent will monitor the lifecycle events of activities.
The default value is
true
.- Parameters:
enabled
- true, if lifecycle events of activities should be monitored- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - Since:
- 8.223
-
withAutoUserActionModifier
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 via
Dynatrace.enterAction(String)
.- Parameters:
modifier
- modifications that should be applied to the newly created user action- Returns:
- this
ConfigurationBuilder
object (for usage as fluent API) - 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
-