public final class BackendUser extends Credentials
TransientObject.MetaKey
AUTH_TOKEN_KEY, EMAIL_KEY, PUSH_MESSAGING_KEY, RECOVERY_TOKEN_KEY, USER_GROUP_KEY, USERNAME_KEY, VALIDATION_KEY
CREATE_DATE_KEY, meta_data, META_DATA, MODIFIED_DATE_KEY, OBJECT_KEY, OBJECT_TYPE_KEY, OWNER_ID_KEY, user_data, USER_DATA
Constructor and Description |
---|
BackendUser() |
BackendUser(java.lang.String username,
java.lang.String email,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
static BackendUser |
from(ValidCredentials credentials)
Convience method to initialize BackendUser from ValidCredentials
|
static BackendUser |
fromToken(java.lang.String token)
Login using an authtoken
|
static LocalCredentials |
getStoredAccount()
Used to access the stored credentials.
|
static BackendUser |
getUser() |
protected boolean |
isSystemUser() |
static rx.Observable<BackendUser> |
logInInBackground(java.lang.String email,
java.lang.String password)
Perform asyncronously login attempt.
|
static void |
logout() |
void |
requestPasswordReset(java.lang.String email) |
rx.Observable<java.lang.Boolean> |
requestPasswordResetInBackground(java.lang.String email) |
void |
save()
Asynchronously saves this user object.
|
rx.Observable<java.lang.Void> |
saveASync()
Asynchronously saves this user object return an Observable to monitor.
|
static SignInResponse |
signIn(LoginCredentials loginCredentials)
Perform syncronously login attempt.
|
static SignInResponse |
signIn(java.lang.String email,
java.lang.String password)
Perform syncronously login attempt.
|
boolean |
signUp()
Synchronously sign up using credentials provided via constructor or setters.
|
static SignUpResponse |
signUp(SignUpCredentials signUpCredentials)
Perform syncronously sign up attempt.
|
static SignUpResponse |
signUp(java.lang.String username,
java.lang.String email,
java.lang.String password)
Perform syncronously sign up attempt.
|
static rx.Observable<BackendUser> |
signUpInBackground(java.lang.String username,
java.lang.String email,
java.lang.String password)
Perform asyncronously sign up attempt.
|
java.lang.String |
toString() |
decryptPassword, encryptPassword, getAuthToken, getEmailAddress, getPassword, getPushMessagingKey, getRecoveryToken, getSafe, getUserGroup, getUsername, getValidation, setAuthToken, setEmailAddress, setPassword, setPushMessagingKey, setRecoveryToken, setUserGroup, setUsername, setValidation
equals, get, get, getCreateDate, getFilePermissions, getLoggedInUser, getMetaData, getModifiedDate, getObjectKey, getObjectType, getOwnerId, getUserData, hashCode, isReadable, isWritable, meta_get, meta_put, meta_remove, put, put, putAll, remove, removeAll, setFilePermissions, setOwnerId
public BackendUser()
public BackendUser(java.lang.String username, java.lang.String email, java.lang.String password)
public static BackendUser from(ValidCredentials credentials)
credentials
- public static BackendUser getUser()
public static LocalCredentials getStoredAccount()
protected final boolean isSystemUser()
isSystemUser
in class Credentials
public static BackendUser fromToken(java.lang.String token)
token
- public static SignInResponse signIn(LoginCredentials loginCredentials)
loginCredentials
- credentials used for login attempt.public static SignInResponse signIn(java.lang.String email, java.lang.String password)
email
- user email addresspassword
- user passwordpublic static SignUpResponse signUp(SignUpCredentials signUpCredentials)
signUpCredentials
- credentials used for sign up attempt.public static SignUpResponse signUp(java.lang.String username, java.lang.String email, java.lang.String password)
username
- user name user will be identified by.email
- user email addresspassword
- user passwordpublic static rx.Observable<BackendUser> logInInBackground(java.lang.String email, java.lang.String password)
email
- user email addresspassword
- user passwordpublic static rx.Observable<BackendUser> signUpInBackground(java.lang.String username, java.lang.String email, java.lang.String password)
username
- user name user will be identified by.email
- user email addresspassword
- user passwordpublic static void logout()
public void requestPasswordReset(java.lang.String email)
public rx.Observable<java.lang.Boolean> requestPasswordResetInBackground(java.lang.String email)
public boolean signUp()
public void save()
public rx.Observable<java.lang.Void> saveASync()
public java.lang.String toString()
toString
in class TransientObject