Example #1
0
        private static WatermarkMap ParseWatermarks(string rawstring)
        {
            WatermarkMap empty = WatermarkMap.Empty;

            string[] array = rawstring.Split(new string[]
            {
                ";"
            }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string text in array)
            {
                string[] array3 = text.Split(new string[]
                {
                    ":"
                }, StringSplitOptions.None);
                if (array3.Length != 2)
                {
                    throw new FormatException();
                }
                Guid key   = new Guid(array3[0]);
                long value = long.Parse(array3[1]);
                if (!empty.ContainsKey(key))
                {
                    empty.Add(key, value);
                }
            }
            return(empty);
        }
        private bool HandleRelocationState(bool isRelocationCompleted, bool isSourceOfRelocation, PropertyBag propertyBag, ADRawEntry org)
        {
            if (!isRelocationCompleted)
            {
                if (!isSourceOfRelocation)
                {
                    this.reporter.ReportExcludedObject(propertyBag, DirectoryObjectErrorCode.ObjectOutOfScope, ProcessingStage.RelocationStageFilter);
                }
                return(isSourceOfRelocation);
            }
            if (!isSourceOfRelocation)
            {
                if (this.isIncrementalSync)
                {
                    WatermarkMap vectorToFilterRelocationData = TenantRelocationProcessor.GetVectorToFilterRelocationData(org);
                    if (vectorToFilterRelocationData.ContainsKey(this.invocationId))
                    {
                        long num = vectorToFilterRelocationData[this.invocationId];
                        if ((long)(propertyBag[ADRecipientSchema.UsnChanged] ?? 9223372036854775807L) < num)
                        {
                            this.reporter.ReportExcludedObject(propertyBag, DirectoryObjectErrorCode.ObjectOutOfScope, ProcessingStage.RelocationPartOfRelocationSyncFilter);
                            return(false);
                        }
                    }
                }
                return(true);
            }
            if (ProcessorHelper.IsObjectOrganizationUnit(propertyBag))
            {
                this.reporter.ReportExcludedObject(propertyBag, DirectoryObjectErrorCode.ObjectOutOfScope, ProcessingStage.RelocationStageFilter);
                return(false);
            }
            ServiceInstanceId value = new ServiceInstanceId(string.Format("exchange/{0}", org[ExchangeConfigurationUnitSchema.TargetForest]));

            propertyBag.SetField(SyncObjectSchema.FaultInServiceInstance, value);
            return(true);
        }