Ejemplo n.º 1
0
        private void StartChangeTracker()
        {
            Log.D(TAG, "starting ChangeTracker with since = " + LastSequence);

            var mode = Continuous
                ? ChangeTrackerMode.LongPoll
                : ChangeTrackerMode.OneShot;

            _changeTracker = new ChangeTracker(RemoteUrl, mode, LastSequence, true, this, WorkExecutor);
            _changeTracker.Authenticator = Authenticator;
            if (DocIds != null)
            {
                if (ServerType != null && ServerType.StartsWith("CouchDB"))
                {
                    _changeTracker.SetDocIDs(DocIds.ToList());
                }
                else
                {
                    Log.W(TAG, "DocIds parameter only supported on CouchDB");
                }
            }

            if (Filter != null)
            {
                _changeTracker.SetFilterName(Filter);
                if (FilterParams != null)
                {
                    _changeTracker.SetFilterParams(FilterParams.ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
                }
            }

            _changeTracker.UsePost = CheckServerCompatVersion("0.93");
            _changeTracker.Start();
        }