com.evernote.edam.userstore
Class UserStore.Client
java.lang.Object
com.evernote.edam.userstore.UserStore.Client
- All Implemented Interfaces:
- UserStore.Iface, UserStoreIface
- Enclosing class:
- UserStore
public static class UserStore.Client
- extends java.lang.Object
- implements UserStore.Iface
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. |
TProtocol |
getInputProtocol()
|
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 |
iprot_
protected TProtocol iprot_
oprot_
protected TProtocol oprot_
seqid_
protected int seqid_
UserStore.Client
public UserStore.Client(TProtocol prot)
UserStore.Client
public UserStore.Client(TProtocol iprot,
TProtocol oprot)
getInputProtocol
public TProtocol getInputProtocol()
getOutputProtocol
public TProtocol getOutputProtocol()
checkVersion
public boolean checkVersion(java.lang.String clientName,
short edamVersionMajor,
short edamVersionMinor)
throws TException
- Description copied from interface:
UserStoreIface
- 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 UserStoreIface
- 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:
TException
send_checkVersion
public void send_checkVersion(java.lang.String clientName,
short edamVersionMajor,
short edamVersionMinor)
throws TException
- Throws:
TException
recv_checkVersion
public boolean recv_checkVersion()
throws TException
- Throws:
TException
authenticate
public AuthenticationResult authenticate(java.lang.String username,
java.lang.String password,
java.lang.String consumerKey,
java.lang.String consumerSecret)
throws EDAMUserException,
EDAMSystemException,
TException
- Description copied from interface:
UserStoreIface
- 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 UserStoreIface
- 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 with the full information
about the User.
- 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
- PERMISSION_DENIED "User.tooManyFailuresTryAgainLater" - user has failed authentication too often
EDAMSystemException
TException
send_authenticate
public void send_authenticate(java.lang.String username,
java.lang.String password,
java.lang.String consumerKey,
java.lang.String consumerSecret)
throws TException
- Throws:
TException
recv_authenticate
public AuthenticationResult recv_authenticate()
throws EDAMUserException,
EDAMSystemException,
TException
- Throws:
EDAMUserException
EDAMSystemException
TException
refreshAuthentication
public AuthenticationResult refreshAuthentication(java.lang.String authenticationToken)
throws EDAMUserException,
EDAMSystemException,
TException
- Description copied from interface:
UserStoreIface
- 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 UserStoreIface
- 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
TException
send_refreshAuthentication
public void send_refreshAuthentication(java.lang.String authenticationToken)
throws TException
- Throws:
TException
recv_refreshAuthentication
public AuthenticationResult recv_refreshAuthentication()
throws EDAMUserException,
EDAMSystemException,
TException
- Throws:
EDAMUserException
EDAMSystemException
TException
getUser
public User getUser(java.lang.String authenticationToken)
throws EDAMUserException,
EDAMSystemException,
TException
- Description copied from interface:
UserStoreIface
- 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 UserStoreIface
- Throws:
EDAMUserException
EDAMSystemException
TException
send_getUser
public void send_getUser(java.lang.String authenticationToken)
throws TException
- Throws:
TException
recv_getUser
public User recv_getUser()
throws EDAMUserException,
EDAMSystemException,
TException
- Throws:
EDAMUserException
EDAMSystemException
TException
getPublicUserInfo
public PublicUserInfo getPublicUserInfo(java.lang.String username)
throws EDAMNotFoundException,
EDAMSystemException,
EDAMUserException,
TException
- Description copied from interface:
UserStoreIface
- Asks the UserStore about the publicly available location information for
a particular username.
- Specified by:
getPublicUserInfo
in interface UserStoreIface
- Throws:
EDAMUserException
-
- DATA_REQUIRED "username" - username is empty
EDAMNotFoundException
EDAMSystemException
TException
send_getPublicUserInfo
public void send_getPublicUserInfo(java.lang.String username)
throws TException
- Throws:
TException
recv_getPublicUserInfo
public PublicUserInfo recv_getPublicUserInfo()
throws EDAMNotFoundException,
EDAMSystemException,
EDAMUserException,
TException
- Throws:
EDAMNotFoundException
EDAMSystemException
EDAMUserException
TException