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<T extends 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.LockDownUser  
class User.LoginRequest Login Request Class. 
class User.LogoutRequest Logout Request Class. 
class User.ResetPassword ResetPassword Request Class, extends AbstractKinveyJsonClientRequest
class User.Retrieve Retrieve Request Class, extends AbstractKinveyJsonClientRequest
class User.RetrieveUsers Retrieve Request Class, extends AbstractKinveyJsonClientRequest
class User.Update Update Request Class, extends AbstractKinveyJsonClientRequest
Constants
String USER_COLLECTION_NAME
Public Constructors
User(AbstractClient client, Class<T> userClass, KinveyAuthRequest.Builder builder)
Constructor to access Kinvey's UserGroup management.
User()
Public Methods
LoginRequest createBlocking(String userid, String password)
Creates an explicit Kinvey 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
Set<String> keySet()
Enforce the Generic Json typing to be
LockDownUser lockDownUserBlocking(String userid, boolean setLockdownStateTo)
modify the locked down state of the provided user id.
LoginRequest login(Credential credential)
Log in with existing credential
LoginRequest loginAuthLinkBlocking(String accessToken, String refreshToken)
LoginRequest loginBlocking()
Login with the implicit user.
LoginRequest loginBlocking(String username, String password)
Login with Kinvey user and password.
LoginRequest loginFacebookBlocking(String accessToken)
Login to Kinvey services using Facebook access token obtained through OAuth2.
LoginRequest loginGoogleBlocking(String accessToken)
Login to Kinvey services using Google access token obtained through OAuth2.
LoginRequest loginKinveyAuthTokenBlocking(String userId, String authToken)
Login to Kinvey services using a Kinvey user's _id and their valid Kinvey Auth Token.
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.
LoginRequest loginSalesForceBlocking(String accessToken, String Clientid, String refreshToken, String id)
Login to Kinvey services using SalesForce access token obtained through OAuth2.
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.
LogoutRequest logout()
Logs the user out of the current app
ResetPassword resetPasswordBlocking(String username)
Initiates a password reset request for a provided username
Retrieve retrieveBlocking()
Retrieves current user's metadata.
RetrieveUsers retrieveBlocking(Query query)
Retrieves an array of User[] based on a Query.
Retrieve retrieveBlocking(String[] resolves)
Retrieve current user's metadata with support for resolving KinveyReferences
RetrieveUsers 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.
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
Update updateBlocking(User user)
Updates a provided user's profile
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 (AbstractClient client, Class<T> userClass, KinveyAuthRequest.Builder builder)

Constructor to access Kinvey's UserGroup management.

Parameters
client - an instance of Kinvey AbstractClient, configured for the application

public User ()

Public Methods

public 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 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 Set<String> keySet ()

Enforce the Generic Json typing to be

Returns
  • the keyset of objects in this GenericJson

public LockDownUser lockDownUserBlocking (String userid, boolean setLockdownStateTo)

modify the locked down state of the provided user id.

This operation must be performed with the master secret

Locking down a user will prevent them from logging in and remove all locally stored content on their device

Parameters
userid the id to lockdown
setLockdownStateTo true to lockdown, false to remove lockdown state
Returns
  • a LockDownUser request ready to execute
Throws
IOException

public LoginRequest login (Credential credential)

Log in with existing credential

Returns
  • LoginRequest object
Throws
IOException

public LoginRequest loginAuthLinkBlocking (String accessToken, String refreshToken)

Throws
IOException

public 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 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 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 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 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 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 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 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 LogoutRequest logout ()

Logs the user out of the current app

Returns
  • LogoutRequest object
Throws
IOException

public 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 retrieveBlocking ()

Retrieves current user's metadata.

Returns
  • Retrieve Request
Throws
IOException

public RetrieveUsers retrieveBlocking (Query query)

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

Returns
  • a Retrieve Request ready to be executed
Throws
IOException

public Retrieve 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 RetrieveUsers 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 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 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 Update updateBlocking ()

Updates the current user's profile

Returns
  • Update request
Throws
IOException