本文整理汇总了Java中com.evernote.edam.error.EDAMSystemException类的典型用法代码示例。如果您正苦于以下问题:Java EDAMSystemException类的具体用法?Java EDAMSystemException怎么用?Java EDAMSystemException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EDAMSystemException类属于com.evernote.edam.error包,在下文中一共展示了EDAMSystemException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBusinessNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @param notebook The new business notebook.
* @param defaultClient The note store client, which references the user's note store.
* @return The new created {@link LinkedNotebook}, which has an business ID.
*/
public LinkedNotebook createBusinessNotebook(@NonNull Notebook notebook, @NonNull EvernoteNoteStoreClient defaultClient)
throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
Notebook originalNotebook = mClient.createNotebook(notebook);
List<SharedNotebook> sharedNotebooks = originalNotebook.getSharedNotebooks();
SharedNotebook sharedNotebook = sharedNotebooks.get(0);
LinkedNotebook linkedNotebook = new LinkedNotebook();
linkedNotebook.setShareKey(sharedNotebook.getShareKey());
linkedNotebook.setShareName(originalNotebook.getName());
linkedNotebook.setUsername(mBusinessUserName);
linkedNotebook.setShardId(mBusinessUserShardId);
return defaultClient.createLinkedNotebook(linkedNotebook);
}
示例2: loadLinkedNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @return The linked notebook if this is a linked note.
* @see #isLinked()
*/
public LinkedNotebook loadLinkedNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (!mLinked) {
return null;
}
EvernoteNoteStoreClient noteStore = NoteRefHelper.getSession().getEvernoteClientFactory().getNoteStoreClient();
if (noteStore == null) {
return null;
}
List<LinkedNotebook> linkedNotebooks = noteStore.listLinkedNotebooks();
for (LinkedNotebook linkedNotebook : linkedNotebooks) {
if (linkedNotebook.getGuid().equals(mNotebookGuid)) {
return linkedNotebook;
}
}
return null;
}
示例3: loadNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* If this note is linked, then it loads the corresponding notebook for the linked notebook. Use
* {@link #loadLinkedNotebook()} to get the linked notebook.
*
* @return The note's notebook from server.
* @see #isLinked()
* @see EvernoteLinkedNotebookHelper#getCorrespondingNotebook()
*/
public Notebook loadNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (mNotebookGuid == null) {
return null;
}
if (mLinked) {
LinkedNotebook linkedNotebook = NoteRefHelper.getLinkedNotebook(mNotebookGuid);
return NoteRefHelper.getSession().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getCorrespondingNotebook();
}
EvernoteNoteStoreClient noteStore = NoteRefHelper.getNoteStore(this);
if (noteStore == null) {
return null;
}
return noteStore.getNotebook(mNotebookGuid);
}
示例4: findAllNotes
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
protected List<NotesMetadataList> findAllNotes(Search search, EvernoteNoteStoreClient client, NoteFilter filter) throws Exception {
List<NotesMetadataList> result = new ArrayList<>();
final int maxNotes = search.getMaxNotes();
int offset = search.getOffset();
int remaining = maxNotes - offset;
while (remaining > 0) {
try {
NotesMetadataList notesMetadata = client.findNotesMetadata(filter, offset, maxNotes, search.getResultSpec());
remaining = notesMetadata.getTotalNotes() - (notesMetadata.getStartIndex() + notesMetadata.getNotesSize());
result.add(notesMetadata);
} catch (EDAMUserException | EDAMSystemException | TException | EDAMNotFoundException e) {
maybeRethrow(search, e);
remaining -= search.getPageSize();
}
offset += search.getPageSize();
}
return result;
}
示例5: getEvernoteHtmlHelper
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
protected EvernoteHtmlHelper getEvernoteHtmlHelper() throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
if (mEvernoteHtmlHelper == null) {
EvernoteClientFactory clientFactory = EvernoteSession.getInstance().getEvernoteClientFactory();
if (mNoteRef.isLinked()) {
mEvernoteHtmlHelper = clientFactory.getLinkedHtmlHelper(mNoteRef.loadLinkedNotebook());
} else {
mEvernoteHtmlHelper = clientFactory.getHtmlHelperDefault();
}
}
return mEvernoteHtmlHelper;
}
示例6: createNote
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
protected Note createNote(Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (mNotebook == null && mLinkedNotebook != null) {
EvernoteLinkedNotebookHelper linkedNotebookHelper = EvernoteSession.getInstance().getEvernoteClientFactory().getLinkedNotebookHelper(mLinkedNotebook);
return linkedNotebookHelper.createNoteInLinkedNotebook(note);
} else {
EvernoteNoteStoreClient noteStoreClient = EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();
return noteStoreClient.createNote(note);
}
}
示例7: deleteLinkedNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @param defaultClient The note store client, which references the user's note store.
* @return A flag indicating if the action was successful.
* @see EvernoteNoteStoreClient#expungeLinkedNotebook(String)
*/
public int deleteLinkedNotebook(@NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
List<Long> sharedNotebookIds = new ArrayList<>();
sharedNotebookIds.add(sharedNotebook.getId());
mClient.expungeSharedNotebooks(sharedNotebookIds);
return defaultClient.expungeLinkedNotebook(mLinkedNotebook.getGuid());
}
示例8: getLinkedNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
public static LinkedNotebook getLinkedNotebook(String notebookGuid) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (LINKED_NOTEBOOK_CACHE.containsKey(notebookGuid)) {
return LINKED_NOTEBOOK_CACHE.get(notebookGuid);
}
List<LinkedNotebook> linkedNotebooks = getSession().getEvernoteClientFactory().getNoteStoreClient().listLinkedNotebooks();
for (LinkedNotebook linkedNotebook : linkedNotebooks) {
LINKED_NOTEBOOK_CACHE.put(linkedNotebook.getGuid(), linkedNotebook);
}
return LINKED_NOTEBOOK_CACHE.get(notebookGuid);
}
示例9: createBusinessNotebookHelper
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
protected EvernoteBusinessNotebookHelper createBusinessNotebookHelper() throws TException, EDAMUserException, EDAMSystemException {
authenticateToBusiness();
EvernoteNoteStoreClient client = getNoteStoreClient(mBusinessAuthenticationResult.getNoteStoreUrl(), mBusinessAuthenticationResult.getAuthenticationToken());
User businessUser = mBusinessAuthenticationResult.getUser();
return new EvernoteBusinessNotebookHelper(client, mExecutorService, businessUser.getUsername(), businessUser.getShardId());
}
示例10: getHtmlHelperBusiness
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* Use this method, if you want to download a business note as HTML.
*
* @return An async wrapper to load a business note as HTML from the Evernote service.
*/
public synchronized EvernoteHtmlHelper getHtmlHelperBusiness() throws TException, EDAMUserException, EDAMSystemException {
if (mHtmlHelperBusiness == null) {
authenticateToBusiness();
mHtmlHelperBusiness = createHtmlHelper(mBusinessAuthenticationResult.getAuthenticationToken());
}
return mHtmlHelperBusiness;
}
示例11: listBusinessNotebooks
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @param defaultClient The note store client, which references the user's note store.
* @return A list of {@link LinkedNotebook}s, which all have a business ID.
*/
public List<LinkedNotebook> listBusinessNotebooks(@NonNull EvernoteNoteStoreClient defaultClient) throws EDAMUserException,
EDAMSystemException, TException, EDAMNotFoundException {
List<LinkedNotebook> businessNotebooks = new ArrayList<>(defaultClient.listLinkedNotebooks());
Iterator<LinkedNotebook> iterator = businessNotebooks.iterator();
while (iterator.hasNext()) {
if (!isBusinessNotebook(iterator.next())) {
iterator.remove();
}
}
return businessNotebooks;
}
示例12: getNoteStore
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
public static EvernoteNoteStoreClient getNoteStore(NoteRef noteRef) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
EvernoteSession session = getSession();
if (!noteRef.isLinked()) {
return getSession().getEvernoteClientFactory().getNoteStoreClient();
}
LinkedNotebook linkedNotebook = getLinkedNotebook(noteRef.getNotebookGuid());
if (linkedNotebook == null) {
return null;
}
return session.getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getClient();
}
示例13: createNoteInLinkedNotebook
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @param note The new note.
* @return The new created note from the server.
*/
public Note createNoteInLinkedNotebook(@NonNull Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
note.setNotebookGuid(sharedNotebook.getNotebookGuid());
return mClient.createNote(note);
}
示例14: isBusinessUser
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
public boolean isBusinessUser() throws TException, EDAMUserException, EDAMSystemException {
return getUser().getAccounting().isSetBusinessId();
}
示例15: isNotebookWritable
import com.evernote.edam.error.EDAMSystemException; //导入依赖的package包/类
/**
* @return {@code true} if this linked notebook is writable.
*/
public boolean isNotebookWritable() throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException {
Notebook notebook = getCorrespondingNotebook();
return !notebook.getRestrictions().isNoCreateNotes();
}