org.openmobileis.synchro.algo.replication.utils
Class DefaultSynchroAtomicObject

java.lang.Object
  extended byorg.openmobileis.synchro.algo.replication.utils.DefaultSynchroAtomicObject
All Implemented Interfaces:
OpenMISSerializable, java.io.Serializable, SynchroAtomicObject
Direct Known Subclasses:
SyncDBSynchroAtomicObject

public class DefaultSynchroAtomicObject
extends java.lang.Object
implements SynchroAtomicObject

Title: OpenMobileIS project source
Description: Implements default Atomic Object behaviours..

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.openmobileis.synchro.algo.replication.SynchroAtomicObject
ADD, DELETE, REPLACE
 
Constructor Summary
DefaultSynchroAtomicObject(java.lang.String id, java.lang.String sum)
           
DefaultSynchroAtomicObject(java.lang.String id, java.lang.String sum, long syncnumber, short type, long creationdate)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCheckSum()
          return the checksum of the atomic Object.
 long getCreationDate()
          return the atomic Object creation date.
 short getModificationType()
          return the last modification type (ADD, REPLACE, DELETE).
 long getModifSyncNumber()
          return the sync number of the last modification.
 java.lang.String getUID()
          return the Atomic Object UID.
 int hashCode()
           
 void setCheckSum(java.lang.String sum)
          set the checksum of the atomic Object.
 void setModificationType(short type)
          Update the sync number with last synchro number.
 void setModifSyncNumber(long ts)
          set the synchro number of the last modification.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSynchroAtomicObject

public DefaultSynchroAtomicObject(java.lang.String id,
                                  java.lang.String sum,
                                  long syncnumber,
                                  short type,
                                  long creationdate)

DefaultSynchroAtomicObject

public DefaultSynchroAtomicObject(java.lang.String id,
                                  java.lang.String sum)
Method Detail

getCreationDate

public long getCreationDate()
Description copied from interface: SynchroAtomicObject
return the atomic Object creation date.

Specified by:
getCreationDate in interface SynchroAtomicObject

getUID

public java.lang.String getUID()
Description copied from interface: SynchroAtomicObject
return the Atomic Object UID. All synchronizeb object must have an unique UID.

Specified by:
getUID in interface SynchroAtomicObject

getCheckSum

public java.lang.String getCheckSum()
Description copied from interface: SynchroAtomicObject
return the checksum of the atomic Object. If checksum has changed, the object is synchronized.

Specified by:
getCheckSum in interface SynchroAtomicObject

setCheckSum

public void setCheckSum(java.lang.String sum)
Description copied from interface: SynchroAtomicObject
set the checksum of the atomic Object. If checksum has changed, the object is synchronized.

Specified by:
setCheckSum in interface SynchroAtomicObject

getModifSyncNumber

public long getModifSyncNumber()
Description copied from interface: SynchroAtomicObject
return the sync number of the last modification. sync number can be anything that identifie the modification to manage synchronization. It can be a timestamp or any incremental number.

Specified by:
getModifSyncNumber in interface SynchroAtomicObject

setModifSyncNumber

public void setModifSyncNumber(long ts)
Description copied from interface: SynchroAtomicObject
set the synchro number of the last modification. sync number can be anything that identifie the modification to manage synchronization. It can be a timestamp or any incremental number.

Specified by:
setModifSyncNumber in interface SynchroAtomicObject

getModificationType

public short getModificationType()
Description copied from interface: SynchroAtomicObject
return the last modification type (ADD, REPLACE, DELETE).

Specified by:
getModificationType in interface SynchroAtomicObject

setModificationType

public void setModificationType(short type)
                         throws DatabaseException
Description copied from interface: SynchroAtomicObject
Update the sync number with last synchro number. Update modification type. set the modification type (ADD, REPLACE, DELETE).

Specified by:
setModificationType in interface SynchroAtomicObject
Throws:
DatabaseException

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface SynchroAtomicObject

hashCode

public int hashCode()
Specified by:
hashCode in interface SynchroAtomicObject


Copyright 2006 OpenMobileIS. All Rights Reserved.