/** * 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. * * @param url * to connect to * * @throws TTransportException * if an error occurs setting up the connection to the Evernote * service. * */ public UserStoreClient createUserStoreClient() throws TTransportException { String serviceUrl = this.evernoteAuth.getUserStoreUrl(); return createStoreClient(UserStoreClient.class, serviceUrl, this.evernoteAuth.getToken()); }
/** * 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. * * @param url * to connect to * * @throws TTransportException * if an error occurs setting up the connection to the Evernote * service. * */ public UserStoreClient createUserStoreClient() throws TTransportException { String serviceUrl = this.evernoteAuth.getUserStoreUrl(); return createStoreClient(UserStoreClient.class, serviceUrl, this.evernoteAuth.getToken()); }
/** * 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 * @throws EDAMSystemException * @throws EDAMUserException */ public NoteStoreClient createNoteStoreClient() throws EDAMUserException, EDAMSystemException, TException { String noteStoreUrl = this.evernoteAuth.getNoteStoreUrl(); if (noteStoreUrl == null) { noteStoreUrl = createUserStoreClient().getNoteStoreUrl(); this.evernoteAuth.setNoteStoreUrl(noteStoreUrl); } return createStoreClient(NoteStoreClient.class, noteStoreUrl, this.evernoteAuth.getToken()); }
/** * 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 * @throws EDAMSystemException * @throws EDAMUserException */ public NoteStoreClient createNoteStoreClient() throws EDAMUserException, EDAMSystemException, TException { String noteStoreUrl = this.evernoteAuth.getNoteStoreUrl(); if (noteStoreUrl == null) { noteStoreUrl = createUserStoreClient().getNoteStoreUrl(); this.evernoteAuth.setNoteStoreUrl(noteStoreUrl); } return createStoreClient(NoteStoreClient.class, noteStoreUrl, this.evernoteAuth.getToken()); }
/** * Creates a LinkedNoteStoreClient from a {@link LinkedNotebook} synchronously * * @param linkedNotebook */ public LinkedNoteStoreClient createLinkedNoteStoreClient( LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult sharedAuth = mainNoteStoreClient .authenticateToSharedNotebook(linkedNotebook.getShareKey()); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, linkedNotebook.getNoteStoreUrl(), sharedAuth.getAuthenticationToken()); return new LinkedNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, sharedAuth); }
/** * Creates a LinkedNoteStoreClient from a {@link LinkedNotebook} synchronously * * @param linkedNotebook */ public LinkedNoteStoreClient createLinkedNoteStoreClient( LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult sharedAuth = mainNoteStoreClient .authenticateToSharedNotebook(linkedNotebook.getShareKey()); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, linkedNotebook.getNoteStoreUrl(), sharedAuth.getAuthenticationToken()); return new LinkedNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, sharedAuth); }
/** * 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 * @throws EDAMUserException * @throws EDAMSystemException * User is not part of a business */ public BusinessNoteStoreClient createBusinessNoteStoreClient() throws TException, EDAMUserException, EDAMSystemException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult businessAuthResult = createUserStoreClient() .authenticateToBusiness(); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, businessAuthResult.getNoteStoreUrl(), businessAuthResult.getAuthenticationToken()); return new BusinessNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, businessAuthResult); }
/** * 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 * @throws EDAMUserException * @throws EDAMSystemException * User is not part of a business */ public BusinessNoteStoreClient createBusinessNoteStoreClient() throws TException, EDAMUserException, EDAMSystemException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult businessAuthResult = createUserStoreClient() .authenticateToBusiness(); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, businessAuthResult.getNoteStoreUrl(), businessAuthResult.getAuthenticationToken()); return new BusinessNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, businessAuthResult); }