String getToken() { return getAuthenticationResult().getAuthenticationToken(); }
/** * Will return the {@link com.evernote.edam.type.Notebook} associated with the * {@link com.evernote.edam.type.LinkedNotebook} from the linked account * * @param linkedNotebook */ public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); return getClient().getNotebook(sharedNotebook.getNotebookGuid()); }
/** * Helper method to list linked notebooks * * @see {@link com.evernote.edam.notestore.NoteStore.Client#listLinkedNotebooks(String)} * */ public List<LinkedNotebook> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { return getPersonalClient().listLinkedNotebooks(); }
/** * Checks writable permissions of {@link LinkedNotebook} on Linked account * * @param linkedNotebook */ public boolean isNotebookWritable(LinkedNotebook linkedNotebook) throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException { Notebook notebook = getCorrespondingNotebook(linkedNotebook); return !notebook.getRestrictions().isNoCreateNotes(); }
/** * 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); }
/** * Helper method to list business notebooks synchronously * * @return * @throws EDAMUserException * @throws EDAMSystemException * @throws TException * @throws EDAMNotFoundException */ @Override public List<LinkedNotebook> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { List<LinkedNotebook> linkedNotebooks = new ArrayList<LinkedNotebook>(); for (LinkedNotebook notebook : super.listNotebooks()) { if (notebook.isSetBusinessId()) { linkedNotebooks.add(notebook); } } return linkedNotebooks; }
/** * Checks writable permissions of {@link LinkedNotebook} on Linked account * * @param linkedNotebook */ public boolean isNotebookWritable(LinkedNotebook linkedNotebook) throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException { Notebook notebook = getCorrespondingNotebook(linkedNotebook); return !notebook.getRestrictions().isNoCreateNotes(); }
/** * 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); }
/** * Helper method to list business notebooks synchronously * * @return * @throws EDAMUserException * @throws EDAMSystemException * @throws TException * @throws EDAMNotFoundException */ @Override public List<LinkedNotebook> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { List<LinkedNotebook> linkedNotebooks = new ArrayList<LinkedNotebook>(); for (LinkedNotebook notebook : super.listNotebooks()) { if (notebook.isSetBusinessId()) { linkedNotebooks.add(notebook); } } return linkedNotebooks; }
/** * Will return the {@link com.evernote.edam.type.Notebook} associated with the * {@link com.evernote.edam.type.LinkedNotebook} from the linked account * * @param linkedNotebook */ public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); return getClient().getNotebook(sharedNotebook.getNotebookGuid()); }
/** * Helper method to list linked notebooks * * @see {@link com.evernote.edam.notestore.NoteStore.Client#listLinkedNotebooks(String)} * */ public List<LinkedNotebook> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { return getPersonalClient().listLinkedNotebooks(); }
String getToken() { return getAuthenticationResult().getAuthenticationToken(); }
/** * Helper method to create a note in a linked notebook * * @param note * @param linkedNotebook * @return * @throws com.evernote.edam.error.EDAMUserException * * @throws com.evernote.edam.error.EDAMSystemException * * @throws com.evernote.thrift.TException * @throws com.evernote.edam.error.EDAMNotFoundException * */ public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); note.setNotebookGuid(sharedNotebook.getNotebookGuid()); return getClient().createNote(note); }
/** * Helper method to create a note in a linked notebook * * @param note * @param linkedNotebook * @return * @throws com.evernote.edam.error.EDAMUserException * * @throws com.evernote.edam.error.EDAMSystemException * * @throws com.evernote.thrift.TException * @throws com.evernote.edam.error.EDAMNotFoundException * */ public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); note.setNotebookGuid(sharedNotebook.getNotebookGuid()); return getClient().createNote(note); }