IRISLIB database
TimeSync Class Reference

Subclass this class to implement a class that processes all objects of the specified class that have been modified since the last time the <method>Synchronize</method> or the <method>SynchronizeAll</method> was run. More...

Static Private Member Functions

_.Library.Status OnProcessEnd (_.Library.String pClassName, _.Library.Integer pAll)
 
_.Library.Status OnProcessObject (_.Library.String pClassName, _.Library.String pID, _.Library.Integer pFileAction, _.Library.Integer pTimeStamp)
 
_.Library.Status OnProcessStart (_.Library.String pClassName, _.Library.Integer pAll)
 
_.Library.Status ResetTime (_.Library.String pClassName)
 
_.Library.Status Synchronize (_.Library.String pClassName, _.Library.Boolean pVerbose, _.Library.Integer pObjectsUpdated)
 
_.Library.Status SynchronizeAll (_.Library.String pClassName, _.Library.Boolean pVerbose, _.Library.Integer pObjectsUpdated)
 

Detailed Description

Subclass this class to implement a class that processes all objects of the specified class that have been modified since the last time the <method>Synchronize</method> or the <method>SynchronizeAll</method> was run.


All objects in the extent of the specified class can be processed by invoking the <method>SynchronizeAll</method>.

The user implements <method>OnProcessObject</method>. This method is responsible for concurrency and for processing the object. For example, the class might be used to synchronize a objects extent with some external archive. The user can also implement <method>OnProcessStart</method> that will be called before processing any objects and <method>OnProcessEnd</method> method that will be called after processing the objects is finished.

Member Function Documentation

◆ OnProcessEnd()

_.Library.Status OnProcessEnd ( _.Library.String  pClassName,
_.Library.Integer  pAll 
)
staticprivate

This method is called by the <method>Synchronize</method> and <method>SynchronizeAll</method> methods after processing is completed.

Parameters
Name Direction Description
pClassName Input The name of the class that is being processed.
pAll Input True (1) if called by <method>SynchronizeAll</method>.
Return Status value indicating success or failure. If failure is reported then no further processing by the calling method will be performed.

◆ OnProcessObject()

_.Library.Status OnProcessObject ( _.Library.String  pClassName,
_.Library.String  pID,
_.Library.Integer  pFileAction,
_.Library.Integer  pTimeStamp 
)
staticprivate

This method is called by the <method>Synchronize</method> and <method>SynchronizeAll</method> methods for each object to be processed. The user is expected to define this method to implement the desired processing.

Parameters
Name Direction Description
pClassName Input The name of the class to synchronize. This class must be persistent and declare DSTIME as AUTO or MANUAL.
pID Input The ID of the object to process.
pFileAction Input The type of filing event. When synchronizing all objects from a class this value will be 1 (Insert).
The pFileAction values are:
CodeOperation
0Update
1Insert
2Delete

pTimeStamp Input The timestamp (segment ID) in which this object (identified by pID) was filed. When synchronizing all objects from a class this value will be 0.
Return Status value indicating success or failure.

◆ OnProcessStart()

_.Library.Status OnProcessStart ( _.Library.String  pClassName,
_.Library.Integer  pAll 
)
staticprivate

This method is called by the <method>Synchronize</method> and <method>SynchronizeAll</method> methods before processing any objects.

Parameters
Name Direction Description
pClassName Input The name of the class that is being processed.
pAll Input True (1) if called by <method>SynchronizeAll</method>.
Return Status value indicating success or failure. If failure is reported then no further processing by the calling method will be performed.

◆ ResetTime()

_.Library.Status ResetTime ( _.Library.String  pClassName)
staticprivate

This method can be called by the user at any time to reset the DSTIME stamp of the last synchronization for a given class.

Parameters
Name Direction Description
pClassName Input The name of the class whose timestamp data is to be reset.
Return Status value indicating success or failure.

◆ Synchronize()

_.Library.Status Synchronize ( _.Library.String  pClassName,
_.Library.Boolean  pVerbose,
_.Library.Integer  pObjectsUpdated 
)
staticprivate

For the specified class invoke OnProcessObject for all objects that have been updated since the last time this class was processed by either Synchronize or <method>SynchronizeAll</method>. <method>OnProcessStart</method> is called before processing any objects. <method>OnProcessEnd</method> is called after processing all objects is finished.

Parameters
Name Direction Description
pClassName Input The name of the class to synchronize. This class must be persistent and declare DSTIME as AUTO or MANUAL.
pVerbose Input If true (a non-zero integer) then status messages will be written to the current device.
pObjectsUpdated Output The number of objects processed by this operation.
Return Status value indicating success or failure.

◆ SynchronizeAll()

_.Library.Status SynchronizeAll ( _.Library.String  pClassName,
_.Library.Boolean  pVerbose,
_.Library.Integer  pObjectsUpdated 
)
staticprivate

For the specified class invoke OnProcessObject for all objects in the extent of the specified class. <method>OnProcessStart</method> is called before processing any objects. <method>OnProcessEnd</method> is called after processing all objects is finished.

Parameters
Name Direction Description
pClassName Input The name of the class to synchronize. This class must be persistent and declare DSTIME as AUTO or MANUAL.
pVerbose Input If true (a non-zero integer) then status messages will be written to the current device.
pObjectsUpdated Output The number of objects processed by this operation.
Return Status value indicating success or failure.