public class AppConfiguration extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
AppConfiguration.Builder
Builder used to construct instances of a
AppConfiguration in a fluent manner. |
Modifier and Type | Field and 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,RegexPatternObfuscator> |
loginObfuscators
Default obfuscators for login requests used in a MongoDB Realm app.
|
Modifier and Type | Method and 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()
Returns the default Client Reset handler used by synced Realms if there are problems with their
SyncSession . |
CodecRegistry |
getDefaultCodecRegistry()
Returns the default codec registry used to encode and decode BSON arguments and results when
calling remote Realm
Functions and accessing a remote
MongoDatabase . |
SyncSession.ErrorHandler |
getDefaultErrorHandler()
Returns the default error handler used by synced Realms if there are problems with their
SyncSession . |
byte[] |
getEncryptionKey()
Returns the encryption key, if any, that is used to encrypt Realm users meta data on this
device.
|
HttpLogObfuscator |
getHttpLogObfuscator()
Returns the
HttpLogObfuscator 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() |
public static final String DEFAULT_BASE_URL
public static final long DEFAULT_REQUEST_TIMEOUT
public static final String DEFAULT_AUTHORIZATION_HEADER_NAME
public static final CodecRegistry DEFAULT_BSON_CODEC_REGISTRY
This will encode/decode most primitive types, list and map types and BsonValues.
getDefaultCodecRegistry()
,
AppConfiguration.Builder.codecRegistry(CodecRegistry)
,
ValueCodecProvider
,
BsonValueCodecProvider
,
IterableCodecProvider
,
MapCodecProvider
,
DocumentCodecProvider
public static final Map<String,RegexPatternObfuscator> loginObfuscators
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.
Credentials.Provider
,
RegexPatternObfuscator
,
ApiKeyObfuscator
,
TokenObfuscator
,
CustomFunctionObfuscator
,
EmailPasswordObfuscator
,
HttpLogObfuscator
public String getAppId()
public String getAppName()
public String getAppVersion()
public URL getBaseUrl()
public byte[] getEncryptionKey()
null
otherwise.public long getRequestTimeoutMs()
public String getAuthorizationHeaderName()
public Map<String,String> getCustomRequestHeaders()
Map
of custom configured headers.public SyncSession.ErrorHandler getDefaultErrorHandler()
SyncSession
.public SyncSession.ClientResetHandler getDefaultClientResetHandler()
SyncSession
.public File getSyncRootDirectory()
public CodecRegistry getDefaultCodecRegistry()
Functions
and accessing a remote
MongoDatabase
.DEFAULT_BSON_CODEC_REGISTRY
,
getDefaultCodecRegistry()
public HttpLogObfuscator getHttpLogObfuscator()
HttpLogObfuscator
used in the app, which keeps sensitive information in
HTTP requests from being displayed in the logcat.