org.eclipse.ecf.provider.rss.channel
Class SseSync

java.lang.Object
  extended by org.eclipse.ecf.provider.rss.channel.SseSync
All Implemented Interfaces:
java.io.Serializable

public class SseSync
extends java.lang.Object
implements java.io.Serializable

In-Memory implementation of the sync element.

Author:
Sergey Yakovlev
See Also:
Serialized Form

Constructor Summary
SseSync()
          Constructs a SseSync with the generated ID.
SseSync(java.lang.String id)
          Constructs a SseSync with the specified ID.
 
Method Summary
 int compareTo(SseSync anotherSync)
          Compares two sync elements.
 boolean equals(java.lang.Object obj)
           
 java.util.List getConflicts()
          Returns the conflict list within this sync element.
 SseHistory getHistory()
          Returns the value of the history field.
 java.lang.String getId()
          Returns the value of the id field.
 int getVersion()
          Returns the value of the version field.
 boolean isConflict()
          Returns the value of the conflict field.
 boolean isDeleted()
          Returns the value of the deleted field.
 SseSync processConflict(SseSync loserSync)
          Performs any necessary conflict processing.
 void setConflict(boolean conflict)
          Sets the conflict field to the given value.
 void setConflict(java.lang.String conflict)
          Sets the conflict field to the given value.
 void setDeleted(boolean deleted)
          Sets the deleted field to the given value.
 void setDeleted(java.lang.String deleted)
          Sets the deleted field to the given value.
 void setHistory(SseHistory history)
          Sets the history field to the given value.
 void setId(java.lang.String id)
          Sets the id field to the given value.
 void setVersion(int version)
          Sets the version field to the given value.
 void setVersion(java.lang.String version)
          Sets the version field to the given value.
 SseSync update(SseSync newSync, boolean deleted)
          Updates this sync element with the specified one.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SseSync

public SseSync()
Constructs a SseSync with the generated ID.


SseSync

public SseSync(java.lang.String id)
Constructs a SseSync with the specified ID.

Parameters:
id - - the id to use
Method Detail

getId

public java.lang.String getId()
Returns the value of the id field.

Returns:
the value for the id field.

getVersion

public int getVersion()
Returns the value of the version field.

Returns:
the value for the version field.

isConflict

public boolean isConflict()
Returns the value of the conflict field.

Returns:
the value for the conflict field.

isDeleted

public boolean isDeleted()
Returns the value of the deleted field.

Returns:
the value for the deleted field.

getHistory

public SseHistory getHistory()
Returns the value of the history field.

Returns:
the value for the history field.

getConflicts

public java.util.List getConflicts()
Returns the conflict list within this sync element.

Returns:
a conflict list.

setId

public void setId(java.lang.String id)
Sets the id field to the given value.

Parameters:
id - - the value to be set for the id field.

setVersion

public void setVersion(int version)
Sets the version field to the given value.

Parameters:
version - - the value to be set for the version field.

setVersion

public void setVersion(java.lang.String version)
Sets the version field to the given value.

Parameters:
version - - the value to be set for the version field.

setConflict

public void setConflict(boolean conflict)
Sets the conflict field to the given value.

Parameters:
conflict - - the value to be set for the conflict field.

setConflict

public void setConflict(java.lang.String conflict)
Sets the conflict field to the given value.

Parameters:
conflict - - the value to be set for the conflict field.

setDeleted

public void setDeleted(boolean deleted)
Sets the deleted field to the given value.

Parameters:
deleted - - the value to be set for the deleted field.

setDeleted

public void setDeleted(java.lang.String deleted)
Sets the deleted field to the given value.

Parameters:
deleted - - the value to be set for the deleted field.

setHistory

public void setHistory(SseHistory history)
Sets the history field to the given value.

Parameters:
history - - the value to be set for the history field.

compareTo

public int compareTo(SseSync anotherSync)
Compares two sync elements.

Parameters:
anotherSync - - the SseSync to be compared.
Returns:
the value 0 if the argument sync is equal to this sync; a value less than 0 if this sync is later than the sync argument; and a value greater than 0 if this sync is newer than the sync argument.

processConflict

public SseSync processConflict(SseSync loserSync)
                        throws ParseException
Performs any necessary conflict processing.

Parameters:
loserSync - - the SseSync to be compared.
Returns:
a reference to this object.
Throws:
ParseException - - If any parse errors occur during processing.

equals

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

update

public SseSync update(SseSync newSync,
                      boolean deleted)
Updates this sync element with the specified one.

Parameters:
newSync - - the SseSync for update.
deleted - - flag indicating whether to mark this sync as 'deleted'.
Returns:
a reference to this object.