InterSystems IRIS Data Platform 2020.4 > Class Reference > ENSLIB namespace > %DeepSee.TimeSync

%DeepSee.TimeSync

abstract class %DeepSee.TimeSync

Subclass this class to implement a class that processes all objects of the specified class that have been modified since the last time the %Synchronize() or the %SynchronizeAll() was run.
All objects in the extent of the specified class can be processed by invoking the %SynchronizeAll().

The user implements %OnProcessObject(). 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 %OnProcessStart() that will be called before processing any objects and %OnProcessEnd() method that will be called after processing the objects is finished.

Method Inventory (Including Private)

Methods (Including Private)

classmethod %OnProcessEnd(pClassName As %String(MAXLEN=""), pAll As %Integer = 0) as %Status [ Language = objectscript ]

This method is called by the %Synchronize() and %SynchronizeAll() 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 %SynchronizeAll().
Return %Status value indicating success or failure. If failure is reported then no further processing by the calling method will be performed.

classmethod %OnProcessObject(pClassName As %String(MAXLEN=""), pID As %String(MAXLEN="")="", pFileAction As %Integer = 0, pTimeStamp As %Integer) as %Status [ Language = objectscript ]

This method is called by the %Synchronize() and %SynchronizeAll() 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.

classmethod %OnProcessStart(pClassName As %String(MAXLEN=""), pAll As %Integer = 0) as %Status [ Language = objectscript ]

This method is called by the %Synchronize() and %SynchronizeAll() 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 %SynchronizeAll().
Return %Status value indicating success or failure. If failure is reported then no further processing by the calling method will be performed.

classmethod %ResetTime(pClassName As %String(MAXLEN="")) as %Status [ Language = objectscript ]

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.

classmethod %Synchronize(pClassName As %String(MAXLEN=250)="", pVerbose As %Boolean = 1, Output pObjectsUpdated As %Integer) as %Status [ Language = objectscript ]

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 %SynchronizeAll(). %OnProcessStart() is called before processing any objects. %OnProcessEnd() 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.

classmethod %SynchronizeAll(pClassName As %String(MAXLEN=250)="", pVerbose As %Boolean = 1, Output pObjectsUpdated As %Integer) as %Status [ Language = objectscript ]

For the specified class invoke %OnProcessObject for all objects in the extent of the specified class. %OnProcessStart() is called before processing any objects. %OnProcessEnd() 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.

Feedback