int tsmUpdateDatabaseFromServerCB ( TsmDatabase *database, TsmServer *server, TsmConnectionParams param, TsmUpdateProc callback, void *closure ) Updates a database with datasets from a server
Updates a database with datasets from a server.This function will take an allocated database structure and a server structure describing a TSM server. The function will then attempt to contact that server, query it for all of the datasets that it has available, and add instances for these to the database.
If the server is contactable, then the function will first delete all instances already in the database that describe datasets on that server. The new list is then built from scratch. This ensures, that any dataset removals will propagate from the server to the database.
Similarly, at the end we rebuild the list of GeoSets for the database based upon the new set of datasets, maps, and models. An OI and DEM are associated together based upon their root filename (i.e. without any extensions). If a DEM cannot be found for an OI based on this system, then we try to find the best enclosing DEM for the OI.
If a server cannot be contacted, then the function will return and the database will not be changed. This ensures that we don't delete information from the database just because a server is temporarily down.
If a dataset is named foo.jpg.oi, then this is taken as a jpeg instance of the dataset named foo.oi.
The callback parameter is a function that is called whenever this routine checks a new dataset. The callback function will be invoked with a string parameter that gives the name of the current set being analysed. This allows the calling application to provide som feedback on the progress of this process.
You can specify a TsmConnectionParams structure if you wish. This structure will get passed to all tsmConnect calls that are made. Additionaly, the TSM_PARAM_FULL_DPSS_READ parameter is supported. If this is set to TRUE, then we perform a full read of all sets on a DPSS server, otherwise we only read the information for a dataset if it'd load date > last contact date for server.