io.agora.rtc

## Class AgoraServiceConfig

- java.lang.Object
- - io.agora.rtc.AgoraServiceConfig

-     public class AgoraServiceConfig
      extends java.lang.Object

  Configuration class for Agora service initialization.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AgoraApmConfig` | `apmConfig` APM configuration
    `private Constants.ApmMode` | `apmMode` APM module mode Default: DISABLE
    `private java.lang.String` | `appId` The App ID of your project.
    `private int` | `areaCode` The supported area code, default is AREA_CODE_GLOB
    `private int` | `audioScenario` The audio scenario.
    `private int` | `channelProfile` The channel profile.
    `private java.lang.String` | `configDir` The config file path, default is NULL for default config path
    `private java.lang.Object` | `context` The user context.
    `private java.lang.String` | `dataDir` The data file path, default is NULL for default data path
    `private int` | `domainLimit` Determines whether to enable domain limit.
    `private int` | `enableAudioDevice` Whether to enable the audio device module.
    `private int` | `enableAudioProcessor` Whether to enable the audio processing module.
    `private int` | `enableVideo` Whether to enable video.
    `private java.lang.String` | `logFilePath` The log file path, default is NULL for default log path
    `private int` | `logFileSize` The log file size, KB , set 5MB to use default log size
    `private int` | `logFilters` The log level, set LOG_LEVEL_INFO to use default log level
    `private int` | `useStringUid` Whether to enable string user id.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraServiceConfig()` Default constructor for AgoraServiceConfig.
    `AgoraServiceConfig(int enableAudioProcessor, int enableAudioDevice, int enableVideo, java.lang.Object context, java.lang.String appId, int areaCode, int channelProfile, int audioScenario, int useStringUid, java.lang.String logFilePath, int logFileSize, int logFilters, int domainLimit, java.lang.String configDir, java.lang.String dataDir, Constants.ApmMode apmMode, AgoraApmConfig apmConfig)` Constructs an AgoraServiceConfig with all parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AgoraApmConfig` | `getApmConfig()` Gets the APM configuration.
    `Constants.ApmMode` | `getApmMode()` Gets the APM mode.
    `java.lang.String` | `getAppId()` Gets the application ID.
    `int` | `getAreaCode()` Gets the area code.
    `int` | `getAudioScenario()` Gets the audio scenario.
    `int` | `getChannelProfile()` Gets the channel profile.
    `java.lang.String` | `getConfigDir()` Gets the configuration directory.
    `java.lang.Object` | `getContext()` Gets the user context.
    `java.lang.String` | `getDataDir()` Gets the data directory.
    `int` | `getDomainLimit()` Gets the domain limit.
    `int` | `getEnableAudioDevice()` Gets whether audio device is enabled.
    `int` | `getEnableAudioProcessor()` Gets whether audio processor is enabled.
    `int` | `getEnableVideo()` Gets whether video is enabled.
    `java.lang.String` | `getLogFilePath()` Gets the log file path.
    `int` | `getLogFileSize()` Gets the log file size.
    `int` | `getLogFilters()` Gets the log filters.
    `int` | `getUseStringUid()` Gets whether string UID is used.
    `void` | `setApmConfig(AgoraApmConfig apmConfig)` Sets the APM configuration.
    `void` | `setApmMode(Constants.ApmMode apmMode)` Sets the APM mode.
    `void` | `setAppId(java.lang.String appId)` Sets the application ID.
    `void` | `setAreaCode(int areaCode)` Sets the area code.
    `void` | `setAudioScenario(int audioScenario)` Sets the audio scenario.
    `void` | `setChannelProfile(int channelProfile)` Sets the channel profile.
    `void` | `setConfigDir(java.lang.String configDir)` Sets the configuration directory.
    `void` | `setContext(java.lang.Object context)` Sets the user context.
    `void` | `setDataDir(java.lang.String dataDir)` Sets the data directory.
    `void` | `setDomainLimit(int domainLimit)` Sets the domain limit.
    `void` | `setEnableAudioDevice(int enableAudioDevice)` Sets whether audio device is enabled.
    `void` | `setEnableAudioProcessor(int enableAudioProcessor)` Sets whether audio processor is enabled.
    `void` | `setEnableVideo(int enableVideo)` Sets whether video is enabled.
    `void` | `setLogFilePath(java.lang.String logFilePath)` Sets the log file path.
    `void` | `setLogFileSize(int logFileSize)` Sets the log file size.
    `void` | `setLogFilters(int logFilters)` Sets the log filters.
    `void` | `setUseStringUid(int useStringUid)` Sets whether to use string UID.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### enableAudioProcessor

          private int enableAudioProcessor

      Whether to enable the audio processing module. - `1` : (Default)Enable the audio processing module. - `0`: Disable the audio processing module. If you disable the audio processing module, you cannot create audio tracks.

    - #### enableAudioDevice

          private int enableAudioDevice

      Whether to enable the audio device module. The function of the audio device module is to manage audio devices, such as recording and playing audio. - `1`: Enable the audio device module. Audio recording and playback is available. - `0`: (Default)Disable the audio device module. Audio recording and playback is unavailable. Important: If you set `enableAudioDevice` as `false` and set `enableAudioProcessor` as `true`, you cannot use audio devices, but you can push PCM audio data.

    - #### enableVideo

          private int enableVideo

      Whether to enable video. - `1`: Enable video. - `0`: (Default)Disable video.

    - #### context

          private java.lang.Object context

      The user context. - For Windows, it is the handle of the window that loads the video. Specify this value to support plugging or unplugging the video devices while the host is powered on. - For Android, it is the context of activity.

    - #### appId

          private java.lang.String appId

      The App ID of your project.

    - #### areaCode

          private int areaCode

      The supported area code, default is AREA_CODE_GLOB

    - #### channelProfile

          private int channelProfile

      The channel profile. For details, see \ref agora::CHANNEL_PROFILE_TYPE "CHANNEL_PROFILE_TYPE". The default channel profile is `CHANNEL_PROFILE_LIVE_BROADCASTING`.

    - #### audioScenario

          private int audioScenario

      The audio scenario. See \ref agora::rtc::AUDIO_SCENARIO_TYPE "AUDIO_SCENARIO_TYPE". The default value is `AUDIO_SCENARIO_AI_SERVER`.

    - #### useStringUid

          private int useStringUid

      Whether to enable string user id. - `1`: Enable string user id. - `0`: (Default) Disable string user id.

    - #### logFilePath

          private java.lang.String logFilePath

      The log file path, default is NULL for default log path

    - #### logFileSize

          private int logFileSize

      The log file size, KB , set 5MB to use default log size

    - #### logFilters

          private int logFilters

      The log level, set LOG_LEVEL_INFO to use default log level

    - #### domainLimit

          private int domainLimit

      Determines whether to enable domain limit. - `1`: only connect to servers that already parsed by DNS - `0`: (Default) connect to servers with no limit

    - #### configDir

          private java.lang.String configDir

      The config file path, default is NULL for default config path

    - #### dataDir

          private java.lang.String dataDir

      The data file path, default is NULL for default data path

    - #### apmMode

          private Constants.ApmMode apmMode

      APM module mode Default: DISABLE

    - #### apmConfig

          private AgoraApmConfig apmConfig

      APM configuration

  - ### Constructor Detail

    - #### AgoraServiceConfig

          public AgoraServiceConfig()

      Default constructor for AgoraServiceConfig.

    - #### AgoraServiceConfig

          public AgoraServiceConfig(int enableAudioProcessor,
                                    int enableAudioDevice,
                                    int enableVideo,
                                    java.lang.Object context,
                                    java.lang.String appId,
                                    int areaCode,
                                    int channelProfile,
                                    int audioScenario,
                                    int useStringUid,
                                    java.lang.String logFilePath,
                                    int logFileSize,
                                    int logFilters,
                                    int domainLimit,
                                    java.lang.String configDir,
                                    java.lang.String dataDir,
                                    Constants.ApmMode apmMode,
                                    AgoraApmConfig apmConfig)

      Constructs an AgoraServiceConfig with all parameters.
      Parameters:
        `enableAudioProcessor` - Whether to enable audio processor
        `enableAudioDevice` - Whether to enable audio device
        `enableVideo` - Whether to enable video
        `context` - User context
        `appId` - Application ID
        `areaCode` - Area code
        `channelProfile` - Channel profile
        `audioScenario` - Audio scenario
        `useStringUid` - Whether to use string UID
        `logFilePath` - Log file path
        `logFileSize` - Log file size
        `logFilters` - Log filters
        `domainLimit` - Domain limit
        `configDir` - Configuration directory
        `dataDir` - Data directory
        `apmMode` - APM mode
        `apmConfig` - APM configuration

  - ### Method Detail

    - #### getEnableAudioProcessor

          public int getEnableAudioProcessor()

      Gets whether audio processor is enabled.
      Returns:
        1 if enabled, 0 if disabled

    - #### setEnableAudioProcessor

          public void setEnableAudioProcessor(int enableAudioProcessor)

      Sets whether audio processor is enabled.
      Parameters:
        `enableAudioProcessor` - 1 to enable, 0 to disable

    - #### getEnableAudioDevice

          public int getEnableAudioDevice()

      Gets whether audio device is enabled.
      Returns:
        1 if enabled, 0 if disabled

    - #### setEnableAudioDevice

          public void setEnableAudioDevice(int enableAudioDevice)

      Sets whether audio device is enabled.
      Parameters:
        `enableAudioDevice` - 1 to enable, 0 to disable

    - #### getEnableVideo

          public int getEnableVideo()

      Gets whether video is enabled.
      Returns:
        1 if enabled, 0 if disabled

    - #### setEnableVideo

          public void setEnableVideo(int enableVideo)

      Sets whether video is enabled.
      Parameters:
        `enableVideo` - 1 to enable, 0 to disable

    - #### getContext

          public java.lang.Object getContext()

      Gets the user context.
      Returns:
        User context object

    - #### setContext

          public void setContext(java.lang.Object context)

      Sets the user context.
      Parameters:
        `context` - User context object

    - #### getAppId

          public java.lang.String getAppId()

      Gets the application ID.
      Returns:
        Application ID

    - #### setAppId

          public void setAppId(java.lang.String appId)

      Sets the application ID.
      Parameters:
        `appId` - Application ID

    - #### getAreaCode

          public int getAreaCode()

      Gets the area code.
      Returns:
        Area code

    - #### setAreaCode

          public void setAreaCode(int areaCode)

      Sets the area code.
      Parameters:
        `areaCode` - Area code

    - #### getChannelProfile

          public int getChannelProfile()

      Gets the channel profile.
      Returns:
        Channel profile

    - #### setChannelProfile

          public void setChannelProfile(int channelProfile)

      Sets the channel profile.
      Parameters:
        `channelProfile` - Channel profile

    - #### getAudioScenario

          public int getAudioScenario()

      Gets the audio scenario.
      Returns:
        Audio scenario

    - #### setAudioScenario

          public void setAudioScenario(int audioScenario)

      Sets the audio scenario.
      Parameters:
        `audioScenario` - Audio scenario

    - #### getUseStringUid

          public int getUseStringUid()

      Gets whether string UID is used.
      Returns:
        1 if string UID is used, 0 otherwise

    - #### setUseStringUid

          public void setUseStringUid(int useStringUid)

      Sets whether to use string UID.
      Parameters:
        `useStringUid` - 1 to use string UID, 0 otherwise

    - #### getLogFilePath

          public java.lang.String getLogFilePath()

      Gets the log file path.
      Returns:
        Log file path

    - #### setLogFilePath

          public void setLogFilePath(java.lang.String logFilePath)

      Sets the log file path.
      Parameters:
        `logFilePath` - Log file path

    - #### getLogFileSize

          public int getLogFileSize()

      Gets the log file size.
      Returns:
        Log file size

    - #### setLogFileSize

          public void setLogFileSize(int logFileSize)

      Sets the log file size.
      Parameters:
        `logFileSize` - Log file size

    - #### getLogFilters

          public int getLogFilters()

      Gets the log filters.
      Returns:
        Log filters

    - #### setLogFilters

          public void setLogFilters(int logFilters)

      Sets the log filters.
      Parameters:
        `logFilters` - Log filters

    - #### getDomainLimit

          public int getDomainLimit()

      Gets the domain limit.
      Returns:
        Domain limit

    - #### setDomainLimit

          public void setDomainLimit(int domainLimit)

      Sets the domain limit.
      Parameters:
        `domainLimit` - Domain limit

    - #### getConfigDir

          public java.lang.String getConfigDir()

      Gets the configuration directory.
      Returns:
        Configuration directory path

    - #### setConfigDir

          public void setConfigDir(java.lang.String configDir)

      Sets the configuration directory.
      Parameters:
        `configDir` - Configuration directory path

    - #### getDataDir

          public java.lang.String getDataDir()

      Gets the data directory.
      Returns:
        Data directory path

    - #### setDataDir

          public void setDataDir(java.lang.String dataDir)

      Sets the data directory.
      Parameters:
        `dataDir` - Data directory path

    - #### getApmMode

          public Constants.ApmMode getApmMode()

      Gets the APM mode.
      Returns:
        APM mode

    - #### setApmMode

          public void setApmMode(Constants.ApmMode apmMode)

      Sets the APM mode.
      Parameters:
        `apmMode` - APM mode

    - #### getApmConfig

          public AgoraApmConfig getApmConfig()

      Gets the APM configuration.
      Returns:
        APM configuration

    - #### setApmConfig

          public void setApmConfig(AgoraApmConfig apmConfig)

      Sets the APM configuration.
      Parameters:
        `apmConfig` - APM configuration

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`