CmisSync.Lib.Producer.ContentChange.ContentChanges.StartSync C# (CSharp) Method

StartSync() private method

Tries to start sync algorithm, if connection was successful, this routine returns with true and starts syncing in background, otherwise a fallback mechanism is used
private StartSync ( ) : bool
return bool
        private bool StartSync() {
            try {
                string lastTokenOnClient = this.storage.ChangeLogToken;

                // Get last change log token on server side.
                this.session.Binding.GetRepositoryService().GetRepositoryInfos(null);    // refresh
                string lastTokenOnServer = this.session.Binding.GetRepositoryService().GetRepositoryInfo(this.session.RepositoryInfo.Id, null).LatestChangeLogToken;

                if (lastTokenOnClient != lastTokenOnServer) {
                    this.Sync();
                }

                return true;
            } catch (CmisRuntimeException e) {
                Logger.Warn("ContentChangeSync not successfull, fallback to CrawlSync");
                Logger.Debug(e.Message);
                Logger.Debug(e.StackTrace);

                // Use fallback sync algorithm
                return false;
            }
        }