Class AppConfiguration


  • public class AppConfiguration
    extends Object
    A AppConfiguration is used to setup a MongoDB Realm application.

    Instances of a AppConfiguration can only created by using the AppConfiguration.Builder and calling its AppConfiguration.Builder.build() method.

    Configuring a App is only required if the default settings are not enough. Otherwise calling new App("app-id") is sufficient.

    • Method Detail

      • getAppId

        public String getAppId()
        Returns the unique app id that identities the Realm application.
        Returns:
        the app unique identifier.
      • getAppName

        @Nullable
        public String getAppName()
        Returns the name used to describe the Realm application. This is only used as debug information.
        Returns:
        the app name.
      • getAppVersion

        @Nullable
        public String getAppVersion()
        Returns the version of this Realm application. This is only used as debug information.
        Returns:
        the app version.
      • getBaseUrl

        public URL getBaseUrl()
        Returns the base url for this Realm application.
        Returns:
        the app base url.
      • getEncryptionKey

        @Nullable
        public byte[] getEncryptionKey()
        Returns the encryption key, if any, that is used to encrypt Realm users meta data on this device. If no key is returned, the data is not encrypted.
        Returns:
        the encryption key if exists, or null otherwise.
      • getRequestTimeoutMs

        public long getRequestTimeoutMs()
        Returns the default timeout for network requests against the Realm application in milliseconds.
        Returns:
        the default timeout for network requests in milliseconds.
      • getAuthorizationHeaderName

        public String getAuthorizationHeaderName()
        Returns the name of the header used to carry authentication data when making network requests towards MongoDB Realm.
        Returns:
        the authentication header name.
      • getCustomRequestHeaders

        public Map<String,​String> getCustomRequestHeaders()
        Returns any custom configured headers that will be sent alongside other headers when making network requests towards MongoDB Realm.
        Returns:
        a Map of custom configured headers.
      • getDefaultErrorHandler

        public SyncSession.ErrorHandler getDefaultErrorHandler()
        Returns the default error handler used by synced Realms if there are problems with their SyncSession.
        Returns:
        the app default error handler.
      • getDefaultSyncClientResetStrategy

        public SyncClientResetStrategy getDefaultSyncClientResetStrategy()
        Returns the default sync client reset strategy used by synced Realms if there are problems with their SyncSession.
        Returns:
        the app default error handler.
      • getSyncRootDirectory

        public File getSyncRootDirectory()
        Returns the root folder containing all files and Realms used when synchronizing data between the device and MongoDB Realm.
        Returns:
        the sync root directory.
      • getHttpLogObfuscator

        @Nullable
        public HttpLogObfuscator getHttpLogObfuscator()
        Returns the HttpLogObfuscator used in the app, which keeps sensitive information in HTTP requests from being displayed in the logcat.
        Returns:
        the HTTP log obfuscator.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object