Package io.realm.mongodb
Class AppConfiguration
- java.lang.Object
-
- io.realm.mongodb.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 itsAppConfiguration.Builder.build()
method.Configuring a App is only required if the default settings are not enough. Otherwise calling
new App("app-id")
is sufficient.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AppConfiguration.Builder
Builder used to construct instances of aAppConfiguration
in a fluent manner.
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_AUTHORIZATION_HEADER_NAME
The default header name used to carry authorization data when making network requests towards MongoDB Realm.static String
DEFAULT_BASE_URL
The default url for MongoDB Realm applications.static CodecRegistry
DEFAULT_BSON_CODEC_REGISTRY
Default BSON codec registry for encoding/decoding arguments and results to/from MongoDB Realm backend.static long
DEFAULT_REQUEST_TIMEOUT
The default request timeout for network requests towards MongoDB Realm in seconds.static Map<String,io.realm.internal.log.obfuscator.RegexPatternObfuscator>
loginObfuscators
Default obfuscators for login requests used in a MongoDB Realm app.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
String
getAppId()
Returns the unique app id that identities the Realm application.String
getAppName()
Returns the name used to describe the Realm application.String
getAppVersion()
Returns the version of this Realm application.String
getAuthorizationHeaderName()
Returns the name of the header used to carry authentication data when making network requests towards MongoDB Realm.URL
getBaseUrl()
Returns the base url for this Realm application.Map<String,String>
getCustomRequestHeaders()
Returns any custom configured headers that will be sent alongside other headers when making network requests towards MongoDB Realm.SyncSession.ClientResetHandler
getDefaultClientResetHandler()
Deprecated.replaced bygetDefaultSyncClientResetStrategy()
CodecRegistry
getDefaultCodecRegistry()
Returns the default codec registry used to encode and decode BSON arguments and results when calling remote RealmFunctions
and accessing a remoteMongoDatabase
.SyncSession.ErrorHandler
getDefaultErrorHandler()
Returns the default error handler used by synced Realms if there are problems with theirSyncSession
.SyncClientResetStrategy
getDefaultSyncClientResetStrategy()
Returns the default sync client reset strategy used by synced Realms if there are problems with theirSyncSession
.byte[]
getEncryptionKey()
Returns the encryption key, if any, that is used to encrypt Realm users meta data on this device.HttpLogObfuscator
getHttpLogObfuscator()
Returns theHttpLogObfuscator
used in the app, which keeps sensitive information in HTTP requests from being displayed in the logcat.long
getRequestTimeoutMs()
Returns the default timeout for network requests against the Realm application in milliseconds.File
getSyncRootDirectory()
Returns the root folder containing all files and Realms used when synchronizing data between the device and MongoDB Realm.int
hashCode()
-
-
-
Field Detail
-
DEFAULT_BASE_URL
public static final String DEFAULT_BASE_URL
The default url for MongoDB Realm applications.
-
DEFAULT_REQUEST_TIMEOUT
public static final long DEFAULT_REQUEST_TIMEOUT
The default request timeout for network requests towards MongoDB Realm in seconds.
-
DEFAULT_AUTHORIZATION_HEADER_NAME
public static final String DEFAULT_AUTHORIZATION_HEADER_NAME
The default header name used to carry authorization data when making network requests towards MongoDB Realm.- See Also:
- Constant Field Values
-
DEFAULT_BSON_CODEC_REGISTRY
public static final CodecRegistry DEFAULT_BSON_CODEC_REGISTRY
Default BSON codec registry for encoding/decoding arguments and results to/from MongoDB Realm backend.This will encode/decode most primitive types, list and map types and BsonValues.
-
loginObfuscators
public static final Map<String,io.realm.internal.log.obfuscator.RegexPatternObfuscator> loginObfuscators
Default obfuscators for login requests used in a MongoDB Realm app.This map is needed to instantiate the default
HttpLogObfuscator
, which will keep all login-sensitive information from being shown in Logcat.This map's keys represent the different login identity providers which can be used to authenticate against an app and the values are the concrete obfuscators used for that provider.
- See Also:
Credentials.Provider
,RegexPatternObfuscator
,ApiKeyObfuscator
,TokenObfuscator
,CustomFunctionObfuscator
,EmailPasswordObfuscator
,HttpLogObfuscator
-
-
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 theirSyncSession
.- Returns:
- the app default error handler.
-
getDefaultClientResetHandler
@Deprecated public SyncSession.ClientResetHandler getDefaultClientResetHandler()
Deprecated.replaced bygetDefaultSyncClientResetStrategy()
Returns the default Client Reset handler used by synced Realms if there are problems with theirSyncSession
.- 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 theirSyncSession
.- 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.
-
getDefaultCodecRegistry
public CodecRegistry getDefaultCodecRegistry()
Returns the default codec registry used to encode and decode BSON arguments and results when calling remote RealmFunctions
and accessing a remoteMongoDatabase
.- Returns:
- The default codec registry for the App.
- See Also:
DEFAULT_BSON_CODEC_REGISTRY
,getDefaultCodecRegistry()
-
getHttpLogObfuscator
@Nullable public HttpLogObfuscator getHttpLogObfuscator()
Returns theHttpLogObfuscator
used in the app, which keeps sensitive information in HTTP requests from being displayed in the logcat.- Returns:
- the HTTP log obfuscator.
-
-