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()); }
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]); }
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); }
public ForwardSyncDataAccessHelper(string serviceInstanceName) { this.InitializeSession(); this.serviceInstanceObjectId = SyncServiceInstance.GetServiceInstanceObjectId(serviceInstanceName); this.divergenceContainerObjectId = SyncServiceInstance.GetDivergenceContainerId(this.serviceInstanceObjectId); }