@Override public UserStoreClient execute() throws Exception { return clientFactory.createUserStoreClient(); } });
/** * 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()); }
/** * 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); }