com.evernote.edam.notestore
Class SyncChunk

java.lang.Object
  extended by com.evernote.edam.notestore.SyncChunk
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<SyncChunk>, org.apache.thrift.TBase<SyncChunk._Fields>

public class SyncChunk
extends java.lang.Object
implements org.apache.thrift.TBase<SyncChunk._Fields>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<SyncChunk>

This structure is given out by the NoteStore when a client asks to receive the current state of an account. The client asks for the server's state one chunk at a time in order to allow clients to retrieve the state of a large account without needing to transfer the entire account in a single message. The server always gives SyncChunks using an ascending series of Update Sequence Numbers (USNs).

currentTime
The server's current date and time.
chunkHighUSN
The highest USN for any of the data objects represented in this sync chunk. If there are no objects in the chunk, this will not be set.
updateCount
The total number of updates that have been performed in the service for this account. This is equal to the highest USN within the account at the point that this SyncChunk was generated. If updateCount and chunkHighUSN are identical, that means that this is the last chunk in the account ... there is no more recent information.
notes
If present, this is a list of non-expunged notes that have a USN in this chunk. This will include notes that are "deleted" but not expunged (i.e. in the trash). The notes will include their list of tags and resources, but the resource content and recognition data will not be supplied.
notebooks
If present, this is a list of non-expunged notebooks that have a USN in this chunk. This will include notebooks that are "deleted" but not expunged (i.e. in the trash).
tags
If present, this is a list of the non-expunged tags that have a USN in this chunk.
searches
If present, this is a list of non-expunged searches that have a USN in this chunk.
resources
If present, this is a list of the non-expunged resources that have a USN in this chunk. This will include the metadata for each resource, but not its binary contents or recognition data, which must be retrieved separately.
expungedNotes
If present, the GUIDs of all of the notes that were permanently expunged in this chunk.
expungedNotebooks
If present, the GUIDs of all of the notebooks that were permanently expunged in this chunk. When a notebook is expunged, this implies that all of its child notes (and their resources) were also expunged.
expungedTags
If present, the GUIDs of all of the tags that were permanently expunged in this chunk.
expungedSearches
If present, the GUIDs of all of the saved searches that were permanently expunged in this chunk.

See Also:
Serialized Form

Nested Class Summary
static class SyncChunk._Fields
          The set of fields this struct contains, along with convenience methods for finding and manipulating them.
 
Field Summary
static java.util.Map<SyncChunk._Fields,org.apache.thrift.meta_data.FieldMetaData> metaDataMap
           
 
Constructor Summary
SyncChunk()
           
SyncChunk(long currentTime, int updateCount)
           
SyncChunk(SyncChunk other)
          Performs a deep copy on other.
 
Method Summary
 void addToExpungedNotebooks(java.lang.String elem)
           
 void addToExpungedNotes(java.lang.String elem)
           
 void addToExpungedSearches(java.lang.String elem)
           
 void addToExpungedTags(java.lang.String elem)
           
 void addToNotebooks(Notebook elem)
           
 void addToNotes(Note elem)
           
 void addToResources(Resource elem)
           
 void addToSearches(SavedSearch elem)
           
 void addToTags(Tag elem)
           
 SyncChunk clone()
          Deprecated. 
 int compareTo(SyncChunk other)
           
 SyncChunk deepCopy()
           
 boolean equals(java.lang.Object that)
           
 boolean equals(SyncChunk that)
           
 int getChunkHighUSN()
           
 long getCurrentTime()
           
 java.util.List<java.lang.String> getExpungedNotebooks()
           
 java.util.Iterator<java.lang.String> getExpungedNotebooksIterator()
           
 int getExpungedNotebooksSize()
           
 java.util.List<java.lang.String> getExpungedNotes()
           
 java.util.Iterator<java.lang.String> getExpungedNotesIterator()
           
 int getExpungedNotesSize()
           
 java.util.List<java.lang.String> getExpungedSearches()
           
 java.util.Iterator<java.lang.String> getExpungedSearchesIterator()
           
 int getExpungedSearchesSize()
           
 java.util.List<java.lang.String> getExpungedTags()
           
 java.util.Iterator<java.lang.String> getExpungedTagsIterator()
           
 int getExpungedTagsSize()
           
 java.lang.Object getFieldValue(int fieldId)
           
 java.lang.Object getFieldValue(SyncChunk._Fields field)
           
 java.util.List<Notebook> getNotebooks()
           
 java.util.Iterator<Notebook> getNotebooksIterator()
           
 int getNotebooksSize()
           
 java.util.List<Note> getNotes()
           
 java.util.Iterator<Note> getNotesIterator()
           
 int getNotesSize()
           
 java.util.List<Resource> getResources()
           
 java.util.Iterator<Resource> getResourcesIterator()
           
 int getResourcesSize()
           
 java.util.List<SavedSearch> getSearches()
           
 java.util.Iterator<SavedSearch> getSearchesIterator()
           
 int getSearchesSize()
           
 java.util.List<Tag> getTags()
           
 java.util.Iterator<Tag> getTagsIterator()
           
 int getTagsSize()
           
 int getUpdateCount()
           
 int hashCode()
           
 boolean isSet(int fieldID)
           
 boolean isSet(SyncChunk._Fields field)
          Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
 boolean isSetChunkHighUSN()
          Returns true if field chunkHighUSN is set (has been asigned a value) and false otherwise
 boolean isSetCurrentTime()
          Returns true if field currentTime is set (has been asigned a value) and false otherwise
 boolean isSetExpungedNotebooks()
          Returns true if field expungedNotebooks is set (has been asigned a value) and false otherwise
 boolean isSetExpungedNotes()
          Returns true if field expungedNotes is set (has been asigned a value) and false otherwise
 boolean isSetExpungedSearches()
          Returns true if field expungedSearches is set (has been asigned a value) and false otherwise
 boolean isSetExpungedTags()
          Returns true if field expungedTags is set (has been asigned a value) and false otherwise
 boolean isSetNotebooks()
          Returns true if field notebooks is set (has been asigned a value) and false otherwise
 boolean isSetNotes()
          Returns true if field notes is set (has been asigned a value) and false otherwise
 boolean isSetResources()
          Returns true if field resources is set (has been asigned a value) and false otherwise
 boolean isSetSearches()
          Returns true if field searches is set (has been asigned a value) and false otherwise
 boolean isSetTags()
          Returns true if field tags is set (has been asigned a value) and false otherwise
 boolean isSetUpdateCount()
          Returns true if field updateCount is set (has been asigned a value) and false otherwise
 void read(org.apache.thrift.protocol.TProtocol iprot)
           
 void setChunkHighUSN(int chunkHighUSN)
           
 void setChunkHighUSNIsSet(boolean value)
           
 void setCurrentTime(long currentTime)
           
 void setCurrentTimeIsSet(boolean value)
           
 void setExpungedNotebooks(java.util.List<java.lang.String> expungedNotebooks)
           
 void setExpungedNotebooksIsSet(boolean value)
           
 void setExpungedNotes(java.util.List<java.lang.String> expungedNotes)
           
 void setExpungedNotesIsSet(boolean value)
           
 void setExpungedSearches(java.util.List<java.lang.String> expungedSearches)
           
 void setExpungedSearchesIsSet(boolean value)
           
 void setExpungedTags(java.util.List<java.lang.String> expungedTags)
           
 void setExpungedTagsIsSet(boolean value)
           
 void setFieldValue(int fieldID, java.lang.Object value)
           
 void setFieldValue(SyncChunk._Fields field, java.lang.Object value)
           
 void setNotebooks(java.util.List<Notebook> notebooks)
           
 void setNotebooksIsSet(boolean value)
           
 void setNotes(java.util.List<Note> notes)
           
 void setNotesIsSet(boolean value)
           
 void setResources(java.util.List<Resource> resources)
           
 void setResourcesIsSet(boolean value)
           
 void setSearches(java.util.List<SavedSearch> searches)
           
 void setSearchesIsSet(boolean value)
           
 void setTags(java.util.List<Tag> tags)
           
 void setTagsIsSet(boolean value)
           
 void setUpdateCount(int updateCount)
           
 void setUpdateCountIsSet(boolean value)
           
 java.lang.String toString()
           
 void unsetChunkHighUSN()
           
 void unsetCurrentTime()
           
 void unsetExpungedNotebooks()
           
 void unsetExpungedNotes()
           
 void unsetExpungedSearches()
           
 void unsetExpungedTags()
           
 void unsetNotebooks()
           
 void unsetNotes()
           
 void unsetResources()
           
 void unsetSearches()
           
 void unsetTags()
           
 void unsetUpdateCount()
           
 void validate()
           
 void write(org.apache.thrift.protocol.TProtocol oprot)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

metaDataMap

public static final java.util.Map<SyncChunk._Fields,org.apache.thrift.meta_data.FieldMetaData> metaDataMap
Constructor Detail

SyncChunk

public SyncChunk()

SyncChunk

public SyncChunk(long currentTime,
                 int updateCount)

SyncChunk

public SyncChunk(SyncChunk other)
Performs a deep copy on other.

Method Detail

deepCopy

public SyncChunk deepCopy()
Specified by:
deepCopy in interface org.apache.thrift.TBase<SyncChunk._Fields>

clone

@Deprecated
public SyncChunk clone()
Deprecated. 

Overrides:
clone in class java.lang.Object

getCurrentTime

public long getCurrentTime()

setCurrentTime

public void setCurrentTime(long currentTime)

unsetCurrentTime

public void unsetCurrentTime()

isSetCurrentTime

public boolean isSetCurrentTime()
Returns true if field currentTime is set (has been asigned a value) and false otherwise


setCurrentTimeIsSet

public void setCurrentTimeIsSet(boolean value)

getChunkHighUSN

public int getChunkHighUSN()

setChunkHighUSN

public void setChunkHighUSN(int chunkHighUSN)

unsetChunkHighUSN

public void unsetChunkHighUSN()

isSetChunkHighUSN

public boolean isSetChunkHighUSN()
Returns true if field chunkHighUSN is set (has been asigned a value) and false otherwise


setChunkHighUSNIsSet

public void setChunkHighUSNIsSet(boolean value)

getUpdateCount

public int getUpdateCount()

setUpdateCount

public void setUpdateCount(int updateCount)

unsetUpdateCount

public void unsetUpdateCount()

isSetUpdateCount

public boolean isSetUpdateCount()
Returns true if field updateCount is set (has been asigned a value) and false otherwise


setUpdateCountIsSet

public void setUpdateCountIsSet(boolean value)

getNotesSize

public int getNotesSize()

getNotesIterator

public java.util.Iterator<Note> getNotesIterator()

addToNotes

public void addToNotes(Note elem)

getNotes

public java.util.List<Note> getNotes()

setNotes

public void setNotes(java.util.List<Note> notes)

unsetNotes

public void unsetNotes()

isSetNotes

public boolean isSetNotes()
Returns true if field notes is set (has been asigned a value) and false otherwise


setNotesIsSet

public void setNotesIsSet(boolean value)

getNotebooksSize

public int getNotebooksSize()

getNotebooksIterator

public java.util.Iterator<Notebook> getNotebooksIterator()

addToNotebooks

public void addToNotebooks(Notebook elem)

getNotebooks

public java.util.List<Notebook> getNotebooks()

setNotebooks

public void setNotebooks(java.util.List<Notebook> notebooks)

unsetNotebooks

public void unsetNotebooks()

isSetNotebooks

public boolean isSetNotebooks()
Returns true if field notebooks is set (has been asigned a value) and false otherwise


setNotebooksIsSet

public void setNotebooksIsSet(boolean value)

getTagsSize

public int getTagsSize()

getTagsIterator

public java.util.Iterator<Tag> getTagsIterator()

addToTags

public void addToTags(Tag elem)

getTags

public java.util.List<Tag> getTags()

setTags

public void setTags(java.util.List<Tag> tags)

unsetTags

public void unsetTags()

isSetTags

public boolean isSetTags()
Returns true if field tags is set (has been asigned a value) and false otherwise


setTagsIsSet

public void setTagsIsSet(boolean value)

getSearchesSize

public int getSearchesSize()

getSearchesIterator

public java.util.Iterator<SavedSearch> getSearchesIterator()

addToSearches

public void addToSearches(SavedSearch elem)

getSearches

public java.util.List<SavedSearch> getSearches()

setSearches

public void setSearches(java.util.List<SavedSearch> searches)

unsetSearches

public void unsetSearches()

isSetSearches

public boolean isSetSearches()
Returns true if field searches is set (has been asigned a value) and false otherwise


setSearchesIsSet

public void setSearchesIsSet(boolean value)

getResourcesSize

public int getResourcesSize()

getResourcesIterator

public java.util.Iterator<Resource> getResourcesIterator()

addToResources

public void addToResources(Resource elem)

getResources

public java.util.List<Resource> getResources()

setResources

public void setResources(java.util.List<Resource> resources)

unsetResources

public void unsetResources()

isSetResources

public boolean isSetResources()
Returns true if field resources is set (has been asigned a value) and false otherwise


setResourcesIsSet

public void setResourcesIsSet(boolean value)

getExpungedNotesSize

public int getExpungedNotesSize()

getExpungedNotesIterator

public java.util.Iterator<java.lang.String> getExpungedNotesIterator()

addToExpungedNotes

public void addToExpungedNotes(java.lang.String elem)

getExpungedNotes

public java.util.List<java.lang.String> getExpungedNotes()

setExpungedNotes

public void setExpungedNotes(java.util.List<java.lang.String> expungedNotes)

unsetExpungedNotes

public void unsetExpungedNotes()

isSetExpungedNotes

public boolean isSetExpungedNotes()
Returns true if field expungedNotes is set (has been asigned a value) and false otherwise


setExpungedNotesIsSet

public void setExpungedNotesIsSet(boolean value)

getExpungedNotebooksSize

public int getExpungedNotebooksSize()

getExpungedNotebooksIterator

public java.util.Iterator<java.lang.String> getExpungedNotebooksIterator()

addToExpungedNotebooks

public void addToExpungedNotebooks(java.lang.String elem)

getExpungedNotebooks

public java.util.List<java.lang.String> getExpungedNotebooks()

setExpungedNotebooks

public void setExpungedNotebooks(java.util.List<java.lang.String> expungedNotebooks)

unsetExpungedNotebooks

public void unsetExpungedNotebooks()

isSetExpungedNotebooks

public boolean isSetExpungedNotebooks()
Returns true if field expungedNotebooks is set (has been asigned a value) and false otherwise


setExpungedNotebooksIsSet

public void setExpungedNotebooksIsSet(boolean value)

getExpungedTagsSize

public int getExpungedTagsSize()

getExpungedTagsIterator

public java.util.Iterator<java.lang.String> getExpungedTagsIterator()

addToExpungedTags

public void addToExpungedTags(java.lang.String elem)

getExpungedTags

public java.util.List<java.lang.String> getExpungedTags()

setExpungedTags

public void setExpungedTags(java.util.List<java.lang.String> expungedTags)

unsetExpungedTags

public void unsetExpungedTags()

isSetExpungedTags

public boolean isSetExpungedTags()
Returns true if field expungedTags is set (has been asigned a value) and false otherwise


setExpungedTagsIsSet

public void setExpungedTagsIsSet(boolean value)

getExpungedSearchesSize

public int getExpungedSearchesSize()

getExpungedSearchesIterator

public java.util.Iterator<java.lang.String> getExpungedSearchesIterator()

addToExpungedSearches

public void addToExpungedSearches(java.lang.String elem)

getExpungedSearches

public java.util.List<java.lang.String> getExpungedSearches()

setExpungedSearches

public void setExpungedSearches(java.util.List<java.lang.String> expungedSearches)

unsetExpungedSearches

public void unsetExpungedSearches()

isSetExpungedSearches

public boolean isSetExpungedSearches()
Returns true if field expungedSearches is set (has been asigned a value) and false otherwise


setExpungedSearchesIsSet

public void setExpungedSearchesIsSet(boolean value)

setFieldValue

public void setFieldValue(SyncChunk._Fields field,
                          java.lang.Object value)
Specified by:
setFieldValue in interface org.apache.thrift.TBase<SyncChunk._Fields>

setFieldValue

public void setFieldValue(int fieldID,
                          java.lang.Object value)
Specified by:
setFieldValue in interface org.apache.thrift.TBase<SyncChunk._Fields>

getFieldValue

public java.lang.Object getFieldValue(SyncChunk._Fields field)
Specified by:
getFieldValue in interface org.apache.thrift.TBase<SyncChunk._Fields>

getFieldValue

public java.lang.Object getFieldValue(int fieldId)
Specified by:
getFieldValue in interface org.apache.thrift.TBase<SyncChunk._Fields>

isSet

public boolean isSet(SyncChunk._Fields field)
Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise

Specified by:
isSet in interface org.apache.thrift.TBase<SyncChunk._Fields>

isSet

public boolean isSet(int fieldID)
Specified by:
isSet in interface org.apache.thrift.TBase<SyncChunk._Fields>

equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(SyncChunk that)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(SyncChunk other)
Specified by:
compareTo in interface java.lang.Comparable<SyncChunk>

read

public void read(org.apache.thrift.protocol.TProtocol iprot)
          throws org.apache.thrift.TException
Specified by:
read in interface org.apache.thrift.TBase<SyncChunk._Fields>
Throws:
org.apache.thrift.TException

write

public void write(org.apache.thrift.protocol.TProtocol oprot)
           throws org.apache.thrift.TException
Specified by:
write in interface org.apache.thrift.TBase<SyncChunk._Fields>
Throws:
org.apache.thrift.TException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

validate

public void validate()
              throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException