示例#1
0
 internal static ObjectId GetRootId(FailedMSOSyncObjectIdParameter identityParameter)
 {
     if (identityParameter != null && identityParameter.IsServiceInstanceDefinied)
     {
         ADObjectId adobjectId = SyncServiceInstance.GetServiceInstanceObjectId(identityParameter.ServiceInstance.InstanceId);
         return(SyncServiceInstance.GetDivergenceContainerId(adobjectId));
     }
     return(SyncServiceInstance.GetMsoSyncRootContainer());
 }
示例#2
0
        public static ForwardSyncCookieHeader[] LoadCookieHeaders(ITopologyConfigurationSession cookieSession, string serviceInstanceName, ForwardSyncCookieType cookieType)
        {
            ADObjectId serviceInstanceObjectId = SyncServiceInstance.GetServiceInstanceObjectId(serviceInstanceName);
            Container  container = cookieSession.Read <Container>(serviceInstanceObjectId.GetChildId("Cookies"));

            if (container != null)
            {
                ComparisonFilter          filter = new ComparisonFilter(ComparisonOperator.Equal, ForwardSyncCookieHeaderSchema.Type, cookieType);
                ForwardSyncCookieHeader[] array  = cookieSession.Find <ForwardSyncCookieHeader>(container.Id, QueryScope.OneLevel, filter, null, 0);
                Array.Sort <ForwardSyncCookieHeader>(array, (ForwardSyncCookieHeader x, ForwardSyncCookieHeader y) => DateTime.Compare(x.Timestamp, y.Timestamp));
                return(array);
            }
            return(new ForwardSyncCookieHeader[0]);
        }
示例#3
0
        private static ADObjectId CreateOrGetRootContainer(string serviceInstanceName, ITopologyConfigurationSession cookieSession)
        {
            ADObjectId serviceInstanceObjectId = SyncServiceInstance.GetServiceInstanceObjectId(serviceInstanceName);
            Container  container = cookieSession.Read <Container>(serviceInstanceObjectId.GetChildId("Cookies"));

            if (container == null)
            {
                container = new Container();
                container.SetId(serviceInstanceObjectId.GetChildId("Cookies"));
                try
                {
                    cookieSession.Save(container);
                }
                catch (ADObjectAlreadyExistsException)
                {
                }
            }
            return(container.Id);
        }
示例#4
0
 public ForwardSyncDataAccessHelper(string serviceInstanceName)
 {
     this.InitializeSession();
     this.serviceInstanceObjectId     = SyncServiceInstance.GetServiceInstanceObjectId(serviceInstanceName);
     this.divergenceContainerObjectId = SyncServiceInstance.GetDivergenceContainerId(this.serviceInstanceObjectId);
 }