com.evernote.clients
Class ClientFactory

java.lang.Object
  extended by com.evernote.clients.ClientFactory

public class ClientFactory
extends Object

A class to produce User and Note store clients.

Author:
kentaro suzuki

Constructor Summary
ClientFactory(EvernoteAuth auth)
           
 
Method Summary
 BusinessNoteStoreClient createBusinessNoteStoreClient()
          Create a new Business NoteStore client.
 LinkedNoteStoreClient createLinkedNoteStoreClient(LinkedNotebook linkedNotebook)
          Creates a LinkedNoteStoreClient from a LinkedNotebook synchronously
 NoteStoreClient createNoteStoreClient()
          Create a new NoteStore client.
 UserStoreClient createUserStoreClient()
          Create a new UserStore client.
 void setCustomHeaders(Map<String,String> customHeaders)
          Allows custom headers to be defined for the Client connection
 void setUserAgent(String userAgent)
          Set a custom UserAgent String for the client connection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientFactory

public ClientFactory(EvernoteAuth auth)
Parameters:
auth -
Method Detail

createUserStoreClient

public UserStoreClient createUserStoreClient()
                                      throws TTransportException
Create a new UserStore client. Each call to this method will return a new UserStore.Client instance. The returned client can be used for any number of API calls, but is NOT thread safe.

Parameters:
url - to connect to
Throws:
TTransportException - if an error occurs setting up the connection to the Evernote service.

createNoteStoreClient

public NoteStoreClient createNoteStoreClient()
                                      throws EDAMUserException,
                                             EDAMSystemException,
                                             TException
Create a new NoteStore client. Each call to this method will return a new NoteStore.Client instance. The returned client can be used for any number of API calls, but is NOT thread safe.

Throws:
TException
EDAMSystemException
EDAMUserException

createLinkedNoteStoreClient

public LinkedNoteStoreClient createLinkedNoteStoreClient(LinkedNotebook linkedNotebook)
                                                  throws EDAMUserException,
                                                         EDAMSystemException,
                                                         TException,
                                                         EDAMNotFoundException
Creates a LinkedNoteStoreClient from a LinkedNotebook synchronously

Parameters:
linkedNotebook -
Throws:
EDAMUserException
EDAMSystemException
TException
EDAMNotFoundException

createBusinessNoteStoreClient

public BusinessNoteStoreClient createBusinessNoteStoreClient()
                                                      throws TException,
                                                             EDAMUserException,
                                                             EDAMSystemException
Create a new Business NoteStore client. Each call to this method will return a new NoteStore.Client instance. The returned client can be used for any number of API calls, but is NOT thread safe. This method will check expiration time for the business authorization token, this is a network request This method is synchronous

Throws:
TException
EDAMUserException
EDAMSystemException - User is not part of a business

setUserAgent

public void setUserAgent(String userAgent)
Set a custom UserAgent String for the client connection

Parameters:
userAgent -

setCustomHeaders

public void setCustomHeaders(Map<String,String> customHeaders)
Allows custom headers to be defined for the Client connection

Parameters:
customHeaders -


Copyright © 2013. All Rights Reserved.