The following APIs support push notification in the generated database class.
The RegisterServerSyncConfiguration() method registers a synchronization configuration from a connection profile and generates a configuration file for the SybaseServerSync application, which is required for SIS push notification.
//Register server sync configuration based on the connection profile properties. //This generates a configuration file for SybaseServerSync application under \Application Data\ MyDatabase.RegisterServerSyncConfiguration();
The LaunchServerSyncHelper() method starts the SybaseServerSync application that provides the lightweight polling used for SIS push notification.
// Starts LWP used for SIS push notification MyDatabase.LaunchServerSyncHelper()
The client sets the SIS push configuration parameters using SynchronizationGroup.
Sybase.Persistence.ISynchronizationGroup GetSynchronizationGroup(string syncGroup) ISynchronizationGroup sg = MyDatabase.GetSynchronizationGroup("ofs"); sg.EnableSIS = true; // sg.EnableSIS = false sg.Interval = 0; sg.Save();
The following method registers a callback handler to configure push notifications through lightweight polling.
// Install a user-defined callback handler MyDatabase.RegisterCallbackHandler(new MyCallbackHandler());
The following method starts a background thread to do synchronization of push notifications.
MyDatabase.StartBackgroundSynchronization();
The following method stops the background thread performing synchronization on push notifications.
MyDatabase.StopBackgroundSynchronization();
The ShutdownServerSyncHelper() method stops the SybaseServerSync application.
// Stops LWP used for SIS push notification MyDatabase.ShutdownServerSyncHelper()