public class

User

extends GenericJson
java.lang.Object
   ↳ java.util.AbstractMap<K, V>
     ↳ com.google.api.client.util.GenericData
       ↳ com.google.api.client.json.GenericJson
         ↳ com.kinvey.java.User

Class Overview

This class is not thread-safe.

Summary

Nested Classes
class User.Delete Delete Request Class, extends AbstractKinveyJsonClientRequest
class User.EmailVerification EmailVerification Request Class, extends AbstractKinveyJsonClientRequest
class User.LoginRequest Login Request Class. 
class User.LogoutRequest Logout Request Class. 
class User.ResetPassword ResetPassword Request Class, extends AbstractKinveyJsonClientRequest
class User.Retrieve<T> Retrieve Request Class, extends AbstractKinveyJsonClientRequest
class User.Update Update Request Class, extends AbstractKinveyJsonClientRequest
Constants
String USER_COLLECTION_NAME
Public Constructors
User()
Public Methods
User.LoginRequest createBlocking(String userid, String password)
Creates an explicit Kinvey User.
User.Delete deleteBlocking(boolean hardDelete)
Delete's the given user from the server.
String getAuthToken()
Get the Authtoken associated with this User for making requests with Kinvey
String getId()
String getUsername()
Get the username of this User
boolean isUserLoggedIn()
Method to determine if the current user instnace represents a logged-in user
User.LoginRequest login(Credential credential)
Log in with existing credential
User.LoginRequest loginAuthLinkBlocking(String accessToken, String refreshToken)
User.LoginRequest loginBlocking()
Login with the implicit user.
User.LoginRequest loginBlocking(String username, String password)
Login with Kinvey user and password.
User.LoginRequest loginFacebookBlocking(String accessToken)
Login to Kinvey services using Facebook access token obtained through OAuth2.
User.LoginRequest loginGoogleBlocking(String accessToken)
Login to Kinvey services using Google access token obtained through OAuth2.
User.LoginRequest loginKinveyAuthTokenBlocking(String userId, String authToken)
Login to Kinvey services using a Kinvey user's _id and their valid Kinvey Auth Token.
User.LoginRequest loginLinkedInBlocking(String accessToken, String accessSecret, String consumerKey, String consumerSecret)
Login to Kinvey services using LinkedIn-generated access token, access secret, consumer key, and consumer secret obtained through OAuth1a.
User.LoginRequest loginSalesForceBlocking(String accessToken, String Clientid, String refreshToken, String id)
Login to Kinvey services using SalesForce access token obtained through OAuth2.
User.LoginRequest loginTwitterBlocking(String accessToken, String accessSecret, String consumerKey, String consumerSecret)
Login to Kinvey services using Twitter-generated access token, access secret, consumer key, and consumer secret obtained through OAuth1a.
User.LogoutRequest logout()
Logs the user out of the current app
User.ResetPassword resetPasswordBlocking(String username)
Initiates a password reset request for a provided username
Retrieve<User> retrieveBlocking()
Retrieves current user's metadata.
Retrieve<User[]> retrieveBlocking(Query query)
Retrieves an array of User[] based on a Query.
Retrieve<User> retrieveBlocking(String[] resolves)
Retrieve current user's metadata with support for resolving KinveyReferences
Retrieve<User[]> retrieveBlocking(Query query, String[] resolves)
Retrieves an array of User[] based on a Query with support for resolving KinveyReferences
User retrieveMetadataBlocking()
Convenience Method to retrieve Metadata.
User.EmailVerification sendEmailVerificationBlocking()
Initiates an EmailVerification request for the current user
void setAuthToken(String authToken)
void setId(String id)
Set the unique id of this User
void setUsername(String username)
Set the username of this user
User.Update updateBlocking(User user)
Updates a provided user's profile
User.Update updateBlocking()
Updates the current user's profile
[Expand]
Inherited Methods
From class com.google.api.client.json.GenericJson
From class com.google.api.client.util.GenericData
From class java.util.AbstractMap
From class java.lang.Object
From interface java.util.Map

Constants

public static final String USER_COLLECTION_NAME

Constant Value: "user"

Public Constructors

public User ()

Public Methods

public User.LoginRequest createBlocking (String userid, String password)

Creates an explicit Kinvey User.

Parameters
userid userID of Kinvey user
password password of Kinvey user
Returns
  • LoginRequest Object
Throws
IOException

public User.Delete deleteBlocking (boolean hardDelete)

Delete's the given user from the server.

Parameters
hardDelete if true, physically deletes the user. If false, marks user as inactive.
Returns
  • Delete Request
Throws
IOException

public String getAuthToken ()

Get the Authtoken associated with this User for making requests with Kinvey

Returns
  • the authtoken for the current user's session

public String getId ()

public String getUsername ()

Get the username of this User

Returns
  • this User's username

public boolean isUserLoggedIn ()

Method to determine if the current user instnace represents a logged-in user

Returns
  • true if user is logged in, false if not

public User.LoginRequest login (Credential credential)

Log in with existing credential

Returns
  • LoginRequest object
Throws
IOException

public User.LoginRequest loginAuthLinkBlocking (String accessToken, String refreshToken)

Throws
IOException

public User.LoginRequest loginBlocking ()

Login with the implicit user. If implicit user does not exist, the user is created. After calling this method, the application should retrieve and store the userID using getId()

Returns
  • LoginRequest object
Throws
IOException

public User.LoginRequest loginBlocking (String username, String password)

Login with Kinvey user and password. If user does not exist, returns a error response.

Parameters
username userID of Kinvey User
password password of Kinvey user
Returns
  • LoginRequest object
Throws
IOException

public User.LoginRequest loginFacebookBlocking (String accessToken)

Login to Kinvey services using Facebook access token obtained through OAuth2. If the user does not exist in the Kinvey service, the user will be created.

Parameters
accessToken Facebook-generated access token.
Returns
  • LoginRequest Object
Throws
IOException

public User.LoginRequest loginGoogleBlocking (String accessToken)

Login to Kinvey services using Google access token obtained through OAuth2. If the user does not exist in the Kinvey service, the user will be created.

Parameters
accessToken Google-generated access token
Returns
  • LoginRequest Object
Throws
IOException

public User.LoginRequest loginKinveyAuthTokenBlocking (String userId, String authToken)

Login to Kinvey services using a Kinvey user's _id and their valid Kinvey Auth Token. This method is provided to allow for cross-platform login, by reusing a session provided with another client library (or the REST api).

Parameters
userId the _id field of the user to login
authToken a valid Kinvey Auth token
Returns
  • a LoginRequest ready to be executed
Throws
IOException

public User.LoginRequest loginLinkedInBlocking (String accessToken, String accessSecret, String consumerKey, String consumerSecret)

Login to Kinvey services using LinkedIn-generated access token, access secret, consumer key, and consumer secret obtained through OAuth1a. If the user does not exist in the Kinvey service, the user will be created.

Parameters
accessToken Linked In generated access token
accessSecret Linked In generated access secret
consumerKey Linked In generated consumer key
consumerSecret Linked In generated consumer secret
Returns
  • LoginRequest Object
Throws
IOException

public User.LoginRequest loginSalesForceBlocking (String accessToken, String Clientid, String refreshToken, String id)

Login to Kinvey services using SalesForce access token obtained through OAuth2. If the user does not exist in the Kinvey service, the user will be created.

Parameters
accessToken SalesForce-generated access token
Returns
  • LoginRequest Object
Throws
IOException

public User.LoginRequest loginTwitterBlocking (String accessToken, String accessSecret, String consumerKey, String consumerSecret)

Login to Kinvey services using Twitter-generated access token, access secret, consumer key, and consumer secret obtained through OAuth1a. If the user does not exist in the Kinvey service, the user will be created.

Parameters
accessToken Twitter-generated access token
accessSecret Twitter-generated access secret
consumerKey Twitter-generated consumer key
consumerSecret Twitter-generated consumer secret
Returns
  • LoginRequest Object
Throws
IOException

public User.LogoutRequest logout ()

Logs the user out of the current app

Returns
  • LogoutRequest object
Throws
IOException

public User.ResetPassword resetPasswordBlocking (String username)

Initiates a password reset request for a provided username

Parameters
username the username to request a password reset for
Returns
  • ResetPassword request
Throws
IOException

public Retrieve<User> retrieveBlocking ()

Retrieves current user's metadata.

Returns
  • Retrieve Request
Throws
IOException

public Retrieve<User[]> retrieveBlocking (Query query)

Retrieves an array of User[] based on a Query.

Returns
  • a Retrieve Request ready to be executed
Throws
IOException

public Retrieve<User> retrieveBlocking (String[] resolves)

Retrieve current user's metadata with support for resolving KinveyReferences

Parameters
resolves - List of KinveyReference fields to resolve
Returns
  • a Retrieve Request ready to be executed
Throws
IOException

public Retrieve<User[]> retrieveBlocking (Query query, String[] resolves)

Retrieves an array of User[] based on a Query with support for resolving KinveyReferences

Parameters
query the query to execute
resolves - List of KinveyReference fields to resolve
Returns
  • a Retrieve Request ready to be executed
Throws
IOException

public User retrieveMetadataBlocking ()

Convenience Method to retrieve Metadata.

Returns
  • Current user object with refreshed metadata
Throws
IOException

public User.EmailVerification sendEmailVerificationBlocking ()

Initiates an EmailVerification request for the current user

Returns
  • EMail Verification Request
Throws
IOException

public void setAuthToken (String authToken)

public void setId (String id)

Set the unique id of this User

Parameters
id a unique user id

public void setUsername (String username)

Set the username of this user

Parameters
username the new username to set

public User.Update updateBlocking (User user)

Updates a provided user's profile

Parameters
user the user to update
Returns
  • an Update request ready to be executed
Throws
IOException

public User.Update updateBlocking ()

Updates the current user's profile

Returns
  • Update request
Throws
IOException