Class BaseConfig


  • public class BaseConfig
    extends java.lang.Object
    A configuration class for several common settings.
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseConfig​(java.lang.String apiKey)
      Create a new BaseConfig with a required apiKey.
      BaseConfig​(java.lang.String apiKey, boolean auditLoggingEnabled)
      Create a new BaseConfig with a required apiKey and a setting for auditLoggingEnabled.
      BaseConfig​(java.lang.String apiKey, boolean auditLoggingEnabled, java.lang.String secondaryUserAgent)
      Creates a new BaseConfig.
    • Constructor Detail

      • BaseConfig

        public BaseConfig​(java.lang.String apiKey)
        Create a new BaseConfig with a required apiKey. Audit logging will default to disabled and there will be no secondary user agent.
        Parameters:
        apiKey - the API insert key required for the sdk to send telemetry.
      • BaseConfig

        public BaseConfig​(java.lang.String apiKey,
                          boolean auditLoggingEnabled)
        Create a new BaseConfig with a required apiKey and a setting for auditLoggingEnabled. If auditLoggingEnabled is true, the SDK will be extra verbose, which can help when troubleshooting. There will be no secondary user agent.
        Parameters:
        apiKey - The API insert key required for the sdk to send telemetry.
        auditLoggingEnabled - true to turn on audit/verbose logging
      • BaseConfig

        public BaseConfig​(java.lang.String apiKey,
                          boolean auditLoggingEnabled,
                          java.lang.String secondaryUserAgent)
        Creates a new BaseConfig.
        Parameters:
        apiKey - the API insert key required for the sdk to send telemetry.
        auditLoggingEnabled - true to turn on audit/verbose logging
        secondaryUserAgent - an extra string to put into the HTTP user agent
    • Method Detail

      • getApiKey

        public java.lang.String getApiKey()
        Returns:
        the New Relic api key
      • isAuditLoggingEnabled

        public boolean isAuditLoggingEnabled()
        Returns:
        true if verbose audit logging is enabled
      • getSecondaryUserAgent

        public java.lang.String getSecondaryUserAgent()
        Returns:
        the secondary http user agent string, which may be null