com.evernote.edam.userstore
Class UserStore.Client

java.lang.Object
  extended by com.evernote.edam.userstore.UserStore.Client
All Implemented Interfaces:
UserStore.Iface
Enclosing class:
UserStore

public static class UserStore.Client
extends java.lang.Object
implements UserStore.Iface


Field Summary
protected  org.apache.thrift.protocol.TProtocol iprot_
           
protected  org.apache.thrift.protocol.TProtocol oprot_
           
protected  int seqid_
           
 
Constructor Summary
UserStore.Client(org.apache.thrift.protocol.TProtocol prot)
           
UserStore.Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot)
           
 
Method Summary
 AuthenticationResult authenticate(java.lang.String username, java.lang.String password, java.lang.String consumerKey, java.lang.String consumerSecret)
          This is used to check a username and password in order to create an authentication session that could be used for further actions.
 boolean checkVersion(java.lang.String clientName, short edamVersionMajor, short edamVersionMinor)
          This should be the first call made by a client to the EDAM service.
 org.apache.thrift.protocol.TProtocol getInputProtocol()
           
 org.apache.thrift.protocol.TProtocol getOutputProtocol()
           
 PublicUserInfo getPublicUserInfo(java.lang.String username)
          Asks the UserStore about the publicly available location information for a particular username.
 User getUser(java.lang.String authenticationToken)
          Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid.
 AuthenticationResult recv_authenticate()
           
 boolean recv_checkVersion()
           
 PublicUserInfo recv_getPublicUserInfo()
           
 User recv_getUser()
           
 AuthenticationResult recv_refreshAuthentication()
           
 AuthenticationResult refreshAuthentication(java.lang.String authenticationToken)
          This is used to take an existing authentication token (returned from 'authenticate') and exchange it for a newer token which will not expire as soon.
 void send_authenticate(java.lang.String username, java.lang.String password, java.lang.String consumerKey, java.lang.String consumerSecret)
           
 void send_checkVersion(java.lang.String clientName, short edamVersionMajor, short edamVersionMinor)
           
 void send_getPublicUserInfo(java.lang.String username)
           
 void send_getUser(java.lang.String authenticationToken)
           
 void send_refreshAuthentication(java.lang.String authenticationToken)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iprot_

protected org.apache.thrift.protocol.TProtocol iprot_

oprot_

protected org.apache.thrift.protocol.TProtocol oprot_

seqid_

protected int seqid_
Constructor Detail

UserStore.Client

public UserStore.Client(org.apache.thrift.protocol.TProtocol prot)

UserStore.Client

public UserStore.Client(org.apache.thrift.protocol.TProtocol iprot,
                        org.apache.thrift.protocol.TProtocol oprot)
Method Detail

getInputProtocol

public org.apache.thrift.protocol.TProtocol getInputProtocol()

getOutputProtocol

public org.apache.thrift.protocol.TProtocol getOutputProtocol()

checkVersion

public boolean checkVersion(java.lang.String clientName,
                            short edamVersionMajor,
                            short edamVersionMinor)
                     throws org.apache.thrift.TException
Description copied from interface: UserStore.Iface
This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client. The service will then return true if the client is capable of talking to the service, and false if the client's protocol version is incompatible with the service, so the client must upgrade. If a client receives a false value, it should report the incompatibility to the user and not continue with any more EDAM requests (UserStore or NoteStore).

Specified by:
checkVersion in interface UserStore.Iface
Parameters:
clientName - This string provides some information about the client for tracking/logging on the service. It should provide information about the client's software and platform. The structure should be: application/version; platform/version; [ device/version ] E.g. "Evernote Windows/3.0.1; Windows/XP SP3" or "Evernote Clipper/1.0.1; JME/2.0; Motorola RAZR/2.0;
edamVersionMajor - This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MAJOR constant for the client.
edamVersionMinor - This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MINOR constant for the client.
Throws:
org.apache.thrift.TException

send_checkVersion

public void send_checkVersion(java.lang.String clientName,
                              short edamVersionMajor,
                              short edamVersionMinor)
                       throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

recv_checkVersion

public boolean recv_checkVersion()
                          throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

authenticate

public AuthenticationResult authenticate(java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String consumerKey,
                                         java.lang.String consumerSecret)
                                  throws EDAMUserException,
                                         EDAMSystemException,
                                         org.apache.thrift.TException
Description copied from interface: UserStore.Iface
This is used to check a username and password in order to create an authentication session that could be used for further actions.

Specified by:
authenticate in interface UserStore.Iface
Parameters:
username - The username (not numeric user ID) for the account to authenticate against. This function will also accept the user's registered email address in this parameter.
password - The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (e.g. SSL).
consumerKey - A unique identifier for this client application, provided by Evernote to developers who request an API key. This must be provided to identify the client.
consumerSecret - If the client was given a "consumer secret" when the API key was issued, it must be provided here to authenticate the application itself.
Returns:
The result of the authentication. If the authentication was successful, the AuthenticationResult.user field will be set, but that User's 'attributes' will not be set. To retrieve the full information about the User, including its UserAttributes, make a separate call to UserStore.getUser() with the authentication from this call.
Throws:
EDAMUserException -
  • DATA_REQUIRED "username" - username is empty
  • DATA_REQUIRED "password" - password is empty
  • DATA_REQUIRED "consumerKey" - consumerKey is empty
  • INVALID_AUTH "username" - username not found
  • INVALID_AUTH "password" - password did not match
  • INVALID_AUTH "consumerKey" - consumerKey is not authorized
  • INVALID_AUTH "consumerSecret" - consumerSecret is incorrect
  • PERMISSION_DENIED "User.active" - user account is closed
EDAMSystemException
org.apache.thrift.TException

send_authenticate

public void send_authenticate(java.lang.String username,
                              java.lang.String password,
                              java.lang.String consumerKey,
                              java.lang.String consumerSecret)
                       throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

recv_authenticate

public AuthenticationResult recv_authenticate()
                                       throws EDAMUserException,
                                              EDAMSystemException,
                                              org.apache.thrift.TException
Throws:
EDAMUserException
EDAMSystemException
org.apache.thrift.TException

refreshAuthentication

public AuthenticationResult refreshAuthentication(java.lang.String authenticationToken)
                                           throws EDAMUserException,
                                                  EDAMSystemException,
                                                  org.apache.thrift.TException
Description copied from interface: UserStore.Iface
This is used to take an existing authentication token (returned from 'authenticate') and exchange it for a newer token which will not expire as soon. This must be invoked before the previous token expires.

Specified by:
refreshAuthentication in interface UserStore.Iface
Parameters:
authenticationToken - The previous authentication token from the authenticate() result.
Returns:
The result of the authentication, with the new token in the result's "authentication" field. The User field will not be set in the reply.
Throws:
EDAMUserException
EDAMSystemException
org.apache.thrift.TException

send_refreshAuthentication

public void send_refreshAuthentication(java.lang.String authenticationToken)
                                throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

recv_refreshAuthentication

public AuthenticationResult recv_refreshAuthentication()
                                                throws EDAMUserException,
                                                       EDAMSystemException,
                                                       org.apache.thrift.TException
Throws:
EDAMUserException
EDAMSystemException
org.apache.thrift.TException

getUser

public User getUser(java.lang.String authenticationToken)
             throws EDAMUserException,
                    EDAMSystemException,
                    org.apache.thrift.TException
Description copied from interface: UserStore.Iface
Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid. The level of detail provided in the returned User structure depends on the access level granted by the token, so a web service client may receive fewer fields than an integrated desktop client.

Specified by:
getUser in interface UserStore.Iface
Throws:
EDAMUserException
EDAMSystemException
org.apache.thrift.TException

send_getUser

public void send_getUser(java.lang.String authenticationToken)
                  throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

recv_getUser

public User recv_getUser()
                  throws EDAMUserException,
                         EDAMSystemException,
                         org.apache.thrift.TException
Throws:
EDAMUserException
EDAMSystemException
org.apache.thrift.TException

getPublicUserInfo

public PublicUserInfo getPublicUserInfo(java.lang.String username)
                                 throws EDAMNotFoundException,
                                        EDAMSystemException,
                                        EDAMUserException,
                                        org.apache.thrift.TException
Description copied from interface: UserStore.Iface
Asks the UserStore about the publicly available location information for a particular username.

Specified by:
getPublicUserInfo in interface UserStore.Iface
Throws:
EDAMUserException -
  • DATA_REQUIRED "username" - username is empty
EDAMNotFoundException
EDAMSystemException
org.apache.thrift.TException

send_getPublicUserInfo

public void send_getPublicUserInfo(java.lang.String username)
                            throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

recv_getPublicUserInfo

public PublicUserInfo recv_getPublicUserInfo()
                                      throws EDAMNotFoundException,
                                             EDAMSystemException,
                                             EDAMUserException,
                                             org.apache.thrift.TException
Throws:
EDAMNotFoundException
EDAMSystemException
EDAMUserException
org.apache.thrift.TException