Skip to main content

%DeepSee.TimeSync

Class %DeepSee.TimeSync [ Abstract, System = 3 ]

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.

Methods

%Synchronize

ClassMethod %Synchronize(pClassName As %String(MAXLEN=250) = "", pVerbose As %Boolean = 1, Output pObjectsUpdated As %Integer) As %Status

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
NameDirectionDescription
pClassNameInputThe name of the class to synchronize. This class must be persistent and declare DSTIME as AUTO or MANUAL.
pVerboseInputIf true (a non-zero integer) then status messages will be written to the current device.
pObjectsUpdatedOutputThe number of objects processed by this operation.
Return%Status value indicating success or failure.

%SynchronizeAll

ClassMethod %SynchronizeAll(pClassName As %String(MAXLEN=250) = "", pVerbose As %Boolean = 1, Output pObjectsUpdated As %Integer) As %Status

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
NameDirectionDescription
pClassNameInputThe name of the class to synchronize. This class must be persistent and declare DSTIME as AUTO or MANUAL.
pVerboseInputIf true (a non-zero integer) then status messages will be written to the current device.
pObjectsUpdatedOutputThe number of objects processed by this operation.
Return%Status value indicating success or failure.

%OnProcessStart

ClassMethod %OnProcessStart(pClassName As %String(MAXLEN=""), pAll As %Integer = 0) As %Status

This method is called by the %Synchronize and %SynchronizeAll methods before processing any objects.

Parameters
NameDirectionDescription
pClassNameInputThe name of the class that is being processed.
pAllInputTrue (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.

%OnProcessEnd

ClassMethod %OnProcessEnd(pClassName As %String(MAXLEN=""), pAll As %Integer = 0) As %Status

This method is called by the %Synchronize and %SynchronizeAll methods after processing is completed.

Parameters
NameDirectionDescription
pClassNameInputThe name of the class that is being processed.
pAllInputTrue (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.

%OnProcessObject

ClassMethod %OnProcessObject(pClassName As %String(MAXLEN=""), pID As %String(MAXLEN="") = "", pFileAction As %Integer = 0, pTimeStamp As %Integer) As %Status

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:

CodeOperation0Update1Insert2Delete
pTimeStampInputThe 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.

%ResetTime

ClassMethod %ResetTime(pClassName As %String(MAXLEN="")) As %Status

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
NameDirectionDescription
pClassNameInputThe name of the class whose timestamp data is to be reset.
Return%Status value indicating success or failure.