本文整理汇总了Java中com.evernote.edam.type.SharedNotebook类的典型用法代码示例。如果您正苦于以下问题:Java SharedNotebook类的具体用法?Java SharedNotebook怎么用?Java SharedNotebook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SharedNotebook类属于com.evernote.edam.type包,在下文中一共展示了SharedNotebook类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBusinessNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的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: listNotebooks
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* return a user's all notebooks(including linked notebooks).
*
* @return The user's notebooks.
*/
@Override
public Map<String, ENObject> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
List<Notebook> notebooks = factory.getNoteStoreClient().listNotebooks();
List<LinkedNotebook> linkedNotebooks = factory.getNoteStoreClient().listLinkedNotebooks();
Map<String, ENObject> map = MapUtil.map();
for (Notebook n : notebooks) {
map.put(n.getName(), ENObjectImpl.forNameAndGuid(n.getName(), n.getGuid()));
}
for (LinkedNotebook linkedNotebook : linkedNotebooks) { // LinkedNotebook must be serializable
NoteStoreClient linkedNoteStore = factory.getLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = linkedNoteStore.getSharedNotebookByAuth();
if (map.containsKey(linkedNotebook.getShareName())) {
map.put(linkedNotebook.getShareName() + ConstantsUtil.LEFT_PARENTHESIS + linkedNotebook.getUsername() + ConstantsUtil.COLON + sharedNotebook.getNotebookGuid() + ConstantsUtil.RIGHT_PARENTHESIS, ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
} else {
map.put(linkedNotebook.getShareName(), ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
}
}
return map;
}
示例3: deleteLinkedNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的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());
}
示例4: createSharedNotebookAsync
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<SharedNotebook> createSharedNotebookAsync(final SharedNotebook sharedNotebook, EvernoteCallback<SharedNotebook> callback) {
return submitTask(new Callable<SharedNotebook>() {
@Override
public SharedNotebook call() throws Exception {
return createSharedNotebook(sharedNotebook);
}
}, callback);
}
示例5: updateSharedNotebookAsync
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<Integer> updateSharedNotebookAsync(final SharedNotebook sharedNotebook, EvernoteCallback<Integer> callback) {
return submitTask(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return updateSharedNotebook(sharedNotebook);
}
}, callback);
}
示例6: listSharedNotebooksAsync
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<List<SharedNotebook>> listSharedNotebooksAsync(EvernoteCallback<List<SharedNotebook>> callback) {
return submitTask(new Callable<List<SharedNotebook>>() {
@Override
public List<SharedNotebook> call() throws Exception {
return listSharedNotebooks();
}
}, callback);
}
示例7: getSharedNotebookByAuthAsync
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<SharedNotebook> getSharedNotebookByAuthAsync(EvernoteCallback<SharedNotebook> callback) {
return submitTask(new Callable<SharedNotebook>() {
@Override
public SharedNotebook call() throws Exception {
return getSharedNotebookByAuth();
}
}, callback);
}
示例8: deleteNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* Providing a LinkedNotebook referencing a Business notebook, perform a delete
*
* Synchronous call
*
* @return guid of notebook deleted
*/
@Override
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
Long[] ids = {sharedNotebook.getId()};
getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
示例9: getCorrespondingNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* Will return the {@link Notebook} associated with the {@link LinkedNotebook} from the business account
*
* Synchronous call
*
* @param linkedNotebook
*/
@Override
public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
//Get LinkedStore for auth information
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
return getAsyncClient().getClient().getNotebook(getAuthenticationToken(), sharedNotebook.getNotebookGuid());
}
示例10: createNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* Create Linked Notebook from a Notebook
*
* Synchronous call
*
* @return {@link LinkedNotebook} with guid from server
*/
public LinkedNotebook createNotebook(Notebook notebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
Notebook originalNotebook = getAsyncClient().getClient().createNotebook(getAuthenticationToken(), notebook);
SharedNotebook sharedNotebook = originalNotebook.getSharedNotebooks().get(0);
LinkedNotebook linkedNotebook = new LinkedNotebook();
linkedNotebook.setShareKey(sharedNotebook.getShareKey());
linkedNotebook.setShareName(originalNotebook.getName());
linkedNotebook.setUsername(EvernoteSession.getOpenSession().getAuthenticationResult().getBusinessUser().getUsername());
linkedNotebook.setShardId(EvernoteSession.getOpenSession().getAuthenticationResult().getBusinessUser().getShardId());
return getAsyncPersonalClient().getClient().createLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook);
}
示例11: deleteNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* Providing a LinkedNotebook referencing a linked account, perform a delete
*
* Synchronous call
*
* @return guid of notebook deleted
*/
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = getAsyncClient().getClient().getSharedNotebookByAuth(getAuthenticationToken());
Long[] ids = {sharedNotebook.getId()};
getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
示例12: createNoteInLinkedNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的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);
}
示例13: getCorrespondingNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
* @return The notebook for this linked notebook.
*/
public Notebook getCorrespondingNotebook() throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
return mClient.getNotebook(sharedNotebook.getNotebookGuid());
}
示例14: createSharedNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public SharedNotebook createSharedNotebook(SharedNotebook sharedNotebook) throws EDAMUserException, EDAMNotFoundException, EDAMSystemException, TException {
return mClient.createSharedNotebook(mAuthenticationToken, sharedNotebook);
}
示例15: updateSharedNotebook
import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public int updateSharedNotebook(SharedNotebook sharedNotebook) throws EDAMUserException, EDAMNotFoundException, EDAMSystemException, TException {
return mClient.updateSharedNotebook(mAuthenticationToken, sharedNotebook);
}