io.realm.mongodb
A user holds the user's meta data and tokens for accessing Realm App functionality.The user is used to configure Synchronized Realms and gives access to calling Realm App Functions through Functions and accessing remote Realm App
Mongo Databases through a MongoClient .
Tip
io.realm.mongodb.sync.SyncConfiguration.Builder.Builder(User, String)
Nested Class Summary
Modificador y Tipo | Class and Description |
|---|---|
|
Resumen del método
Modificador y Tipo | Método y descripción |
|---|---|
public booleano | |
public String | Returns the current access token for the user. |
public synchronized ApiKeyAuth | getApiKeys () Devuelve un contenedor para gestionar claves API controladas por el usuario actual. |
public App | getApp () Devuelve la aplicación con la que está asociado este usuario. |
public Document | Return the custom user data associated with the user in the Realm App. |
public String | getDeviceId () Returns a unique identifier for the device the user logged in to. |
public Functions | Returns a functions manager for invoking Realm Functions with custom codec registry for encoding and decoding arguments and results. |
public synchronized Functions | getFunctions () Devuelve un administrador de funciones para invocar funciones de MongoDB Realm. |
public String | getId () Returns the server id of the user. |
pública Lista | Returns a new list of the user's identities. |
public synchronized MongoClient | Returns a MongoClient instance for accessing documents in the database. |
public UserProfile | getProfile () Returns the profile for this user. |
public Credentials.Provider | Returns the provider type used to log the user |
public synchronized Push | Devuelve la instancia Push para administrar los registros de notificaciones push. |
public String | Devuelve el token de actualización actual para el usuario. |
public User.State | |
public int | hashCode () |
public booleano | isLoggedIn () Returns true if the user is currently logged in. |
public User | Links the current user with a new user identity represented by the given credentials. |
public RealmAsyncTask | Credentials credentials, ) Links the current user with a new user identity represented by the given credentials. |
public void | logOut () Log the user out of the Realm App. |
public RealmAsyncTask | Cerrar la sesión del usuario de la Aplicación Realm de forma asíncrona. |
public RealmAsyncTask | Re-fetch custom user data from the Realm App asynchronously. |
public Document | Re-fetch custom user data from the Realm App. |
public User | remove () Calling this will remove the user and any Realms the user has from the device. |
public RealmAsyncTask | Calling this will asynchronously remove the user and any Realms the user has from the device. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass,hashCode,equals,clone,toString,notify,notifyAll,wait,wait,wait,finalize
Detalle del método
equals
getAccessToken
public String getAccessToken () |
|---|
Returns the current access token for the user. Devuelve the current access token. |
getApiKeys
public synchronized ApiKeyAuth getApiKeys () |
|---|
Devuelve un contenedor para gestionar claves API controladas por el usuario actual. Devuelve wrapper for managing API keys controlled by the current user. Throws
|
getApp
Devuelve la aplicación con la que está asociado este usuario. Devuelve the App this user is associated with. |
getCustomData
public Document getCustomData () |
|---|
Devuelve los datos de usuario personalizados asociados al usuario en la aplicación de Realm. Los datos solo se actualizan cuando el token de acceso del usuario se actualiza o cuando se llama explícitamente a refreshCustomData() . Devuelve The custom user data associated with the user. |
getDeviceId
public String getDeviceId () |
|---|
Returns a unique identifier for the device the user logged in to. Devuelve a unique device identifier for the user. |
getFunctions
Returns a functions manager for invoking Realm Functions with custom codec registry for encoding and decoding arguments and results. Parámetros
Tip |
public synchronized Functions getFunctions () |
|---|
Devuelve un administrador de funciones para invocar funciones de MongoDB Realm. Esto utilizará el registro de códec predeterminado de la aplicación asociada para codificar y decodificar argumentos y resultados. Tip |
getId
getIdentities
public List getIdentities () |
|---|
getMongoClient
Returns a MongoClient instance for accessing documents in the database. Parámetros
|
getProfile
public UserProfile getProfile () |
|---|
Returns the profile for this user. Devuelve the profile for this user |
getProviderType
public Credentials.Provider getProviderType () |
|---|
Returns the provider type used to log the user Devuelve the provider type of the user |
getPush
Devuelve la instancia Push para administrar los registros de notificaciones push. Parámetros
|
getRefreshToken
public String getRefreshToken () |
|---|
Devuelve el token de actualización actual para el usuario. Devuelve the current refresh token. |
getState
public User.State getState () |
|---|
hashCode
isLoggedIn
public boolean isLoggedIn () |
|---|
Returns true if the user is currently logged in. Returns whether or not this user is still logged into the MongoDB Realm App. Devuelve
|
linkCredentials
Links the current user with a new user identity represented by the given credentials.Linking a user with more credentials, mean the user can login either of these credentials. It also makes it possible to "upgrade" an anonymous user by linking it with e.g. Email/Password credentials. Note: It is not possible to link two existing users of MongoDB Realm. The provided credentials must not have been used by another user. Parámetros
Devuelve el Usuario al que estaban vinculadas las credenciales. Throws
|
linkCredentialsAsync
Links the current user with a new user identity represented by the given credentials.Linking a user with more credentials, mean the user can login either of these credentials. It also makes it possible to "upgrade" an anonymous user by linking it with e.g. Email/Password credentials. Note: It is not possible to link two existing users of MongoDB Realm. The provided credentials must not have been used by another user. Parámetros
Throws
|
logOut
public void logOut () |
|---|
Log the user out of the Realm App. This will unregister them on the device and stop any synchronization to and from the users' Realms. Any Realms owned by the user will not be deleted from the device before User.remove() is called. Una vez que la aplicación Realm ha confirmado el cierre de sesión, cualquier AuthenticationListener registrado será notificado y las credenciales del usuario se borrarán de este dispositivo. Logging out anonymous users will remove them immediately instead of marking them as User.State.LOGGED_OUT . All other users will be marked as User.State.LOGGED_OUT and will still be returned by App.allUsers() . They can be removed completely by calling User.remove() . Throws
|
logOutAsync
Log the user out of the Realm App asynchronously. This will unregister them on the device and stop any synchronization to and from the users' Realms. Any Realms owned by the user will not be deleted from the device before User.remove() is called. Una vez que la aplicación Realm ha confirmado el cierre de sesión, cualquier AuthenticationListener registrado será notificado y las credenciales del usuario se borrarán de este dispositivo. Logging out anonymous users will remove them immediately instead of marking them as User.State.LOGGED_OUT . All other users will be marked as User.State.LOGGED_OUT and will still be returned by App.allUsers() . They can be removed completely by calling User.remove() . Parámetros
Throws
|
refreshCustomData
Re-fetch custom user data from the Realm App asynchronously.This is the asynchronous variant of refreshCustomData() . Parámetros
Devuelve The task representing the ongoing operation. Throws
|
public Document refreshCustomData () |
|---|
Re-fetch custom user data from the Realm App. Devuelve The updated custom user data associated with the user. Throws
|
Remover
Calling this will remove the user and any Realms the user has from the device. No data is removed from the server. If the user is logged in when calling this method, the user is logged out before any data is deleted. Devuelve el usuario que fue eliminado. Throws
|
removeAsync
Calling this will asynchronously remove the user and any Realms the user has from the device. No data is removed from the server. If the user is logged in when calling this method, the user is logged out before any data is deleted. Parámetros
Throws
|