Class ConfigurationBuilder

    • Method Detail

      • withCertificateValidation

        public ConfigurationBuilder withCertificateValidation​(boolean enabled)
        Enables/disables certificate validation. The default value is true.
        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
      • 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 is false.
        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 is false.
        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 is false.
        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 is false.
        Parameters:
        enabled - true, if crashes should be reported
        Returns:
        the ConfigurationBuilder object
      • withCommunicationProblemListener

        public ConfigurationBuilder withCommunicationProblemListener​(CommunicationProblemListener listener)
        Sets a CommunicationProblemListener 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:
        the ConfigurationBuilder object
      • withActivityMonitoring

        public ConfigurationBuilder withActivityMonitoring​(boolean enabled)
        Enables/disables lifecycle monitoring for the class Activity. 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:
        the ConfigurationBuilder object
        Since:
        8.223
      • 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