Evernote同步机制分析
杭州英语培训
SyncService
SyncNotification
SyncProgressFragment
1、EDAM(Evernote Data Access and Management) 协议
数据模型(data model)由 rvice 管理the esntial 55
远程处理(remote procedures)从 rvice 返回和提交修改数据
通过 定义语⾔来描述数据模型和远程处理,⽀持所有流⾏语⾔
2、远程处理(remote procedures)
UrStore rvice ⽤户认证
NoteStore rvice ⽤于数据变更
英语四级考试作文万能句及万能模板3、数据模型
每个核⼼的 NoteStore 数据元都有⼀个GUID(Globally unique identifier),在创建时⽣成,不能修改,被API参考调⽤。
每个数据对象都有⼀个 USN(updateSequenceNumber),⽤于发⽣修改服务的时候。每次发⽣变更提交时会创建⼀个USN。USN 是⽤户名下唯⼀且单调递增变量,⽅便客户端判断同步。
Ur - ⽤户账户,⽤户名密码邮箱、个⼈属性、偏好
Accounting - 账务,服务级别:如上传次数/空间限制(uploadLimit)。
Notebook - 笔记本,每个⽤户账户可以有多个 notebook,note 需要存放在 notebook 中。有默认的 notebook - 不能删除最后⼀个 notebook。
Note - 超⽂本⽂档,ENML(Evernote Markup Language)格式,内嵌资源(images, ink, audio, PDF, etc.),图⽚以内嵌⼆进制⽂件NoteAttributes - 系统定义的属性,如creation time, size, origin,⽤于搜索和过滤;
Resource - 资源⽂件,⼆进制数据块。类似于电⼦邮件的附件,每个资源可能有⼀组描述其定义的属性 ResourceAttributes.
SavedSearch - 保存搜索条件
资源内部使⽤MD5关联资源,如
<en-media type=”image/jpeg” hash=”9e107d9d372bb6826bd81d3542a419d6”/>
4、UrStore Service
UrStore Service API
远程⽅法简介
checkVersion发送客户端版本号给服务,并获取兼容响应。
authenticate发送⽤户名和密码给服务,并获取成功的令牌信息。
refreshAuthentication发送⼀个将要到期的令牌给服务,并获取⼀个新的令牌。
getUr根据令牌返回⼀个⽤户。
getPublicUrInfo返回⼀个⽤户的公开信息。
getPreminmInfo返回⼀个⽤户免费/⾼级账号状态。
5、OAuth 认证小清新翻译
iig6、NoteStore Service
远程⽅法简介
listNotebooks Returns a list of all of the Notebooks in the account. getNotebook Retrieves the state of a single Notebook.
getDefaultNotebook Retrieves the Notebook that should receive new Notes which do not specify a destination.
createNotebook Makes a new Notebook in the account. updateNotebook Changes an existing Notebook.
expungeNotebook Permanently removes an existing Notebook. Notes within the notebook are moved to the current default Notebook and moved into the trash.
listTags Returns a list of all of the Tags in the account.
listTagsByNotebook Returns a list of all of the Tags that are applied to at least one note within a specified notebook.
getTag Retrieves the state of a single Tag.
createTag Makes a new Tag in the account.
updateTag Changes an existing Tag.
untagAll Removes a Tag from any Notes.
expungeTag Permanently removes an existing Tag.
listSearches Returns a list of all of the SavedSearches in the account. getSearch Retrieves the state of a single SavedSearch. createSearch Makes a new SavedSearch in the account. updateSearch Changes an existing SavedSearch. expungeSearch Permanently removes an existing SavedSearch.
findNotes Performs a arch of the Notes in the Ur’s account bad on a configurable filter, returning a paginated subt.
findNotesMetadata Performs a arch of the Notes in the Ur’s account bad on a configurable filter, returning a paginated, configurable subt of metadata for matching notes.
findNoteCounts Performs a arch bad on a configurable filter, returning the number of Notes that would match this filter for each Notebook and Tag.
getNote Retrieves the state of a single Note.
getNoteContent Retrieves just the ENML hypertext content of a Note. getNoteSearchText Returns the plain text contents of a single note. getNoteTagNames Retrieves the names of the Tags for a single Note. createNote Makes a new Note in an existing Notebook. updateNote Changes the conte
nt or metadata of a single existing Note. deleteNote Moves a single existing Note to the trash.
怎样挽回丈夫expungeNote Permanently removes an existing Note. In most cas, third party applications that wish to remove a Note should u deleteNote instead of expungeNote.
expungeNotes Permanently removes a t of existing Notes.
expungeInactiveNotes Permanently removes all of the notes that are currently not active (i.e. notes in the “Trash”)
copyNote
listNoteVersions Retrieves a list of the prior versions of a particular note that are saved within the rvice.
getNoteVersion Retrieves a previous version of a Note after it has been updated within the rvice (for premium Urs only).
getNoteApplicationData Retrieves the full applicationData map for a given note. getNoteApplicationDataEntry Retrieves a single entry in the applicationData map for a given note.
ultrasonic
tNoteApplicationDataEntry Create or update a single entry in the applicationData map for a given note.
untNoteApplicationDataEntry Remove a single entry from the applicationData map for a given note.
getResource Retrieves the state of a single Note attachment, optionally with its binary contents.
updateResource Updates the metadata for a single Resource. (Not its binary contents.)
getResourceData Retrieves the binary contents of a single Resource.
getResourceByHash Retrieves one of the resources from a Note, via the MD5 checksum of its contents, not its GUID.
getResourceRecognition Returns the XML recognition index file for a single Resource, which can be ud to find words in the image.
团支书英文
getResourceAlternateData Retrieves the binary contents of the Resource’s alternate data file. getResourceAttributes Returns the t of attributes for the Resource. getResourceSearchText Returns the plain text contents of a single Resource.country music
generated
getResourceApplicationData Retrieves the full applicationData map for a given resource.
getResourceApplicationDataEntry Retrieves a single entry in the applicationData map for a given resource.
tResourceApplicationDataEntry Create or update a single entry in the applicationData map for a given resource.
untResourceApplicationDataEntry Remove a single entry from the applicationData map for a given resource.
getPublicNotebook Gets the information for one published Notebook from a ur’s account, via its public URI.
createSharedNotebook Make a new SharedNotebook object.
listSharedNotebooks Returns a list of all of the SharedNotebooks in an account. expungeSharedNotebooks Permanently removes a t of existing SharedNotebooks. createLinkedNotebook Makes a new LinkedNotebook object. updateLinkedNotebook Changes an existing LinkedNotebook. listLinkedNotebooks Returns a list of all LinkedNotebooks in an account. e
xpungeLinkedNotebook Permanently removes an existing LinkedNotebook.
authenticateToSharedNotebook Returns an authentication token that can be ud to access the contents of a notebook shared from someone el’s account.
getSharedNotebookByAuth Get extended information about a notebook shared from someone el’s account.
ndMessageToSharedNotebookMembers Send an email to some or all of the address that a notebook has already been shared with. The message will include a link to the shared notebook.
getSyncState Light-weight call for caching clients to “ping” the rvice to e whether the account has changed.
getSyncChunk Core routine for full, synchronizing clients to retrieve the t of changes in an account since the last checkpoint. If you are developing a new application consider
using getFilteredSyncChunkinstead of getSyncChunk.
getFilteredSyncChunk Similar to getSyncChunk, but allows clients to specify the t of data elements that they would like returned to reduce network traffic and sync time.
getLinkedNotebookSyncState Light-weight call for caching clients to “ping” the rvice to e whether shared notebooks linked from other accounts have changed.
getLinkedNotebookSyncChunk Core routine for full, synchronizing clients to retrieve the t of changes in shared notebooks linked from other accounts since the last checkpoint.