private bool TryGetCompanyState(string ouDN, EhfTargetConnection targetConnection, EhfADAdapter configADAdapter, out EhfAdminSyncState adminSyncState) { EhfADAdapter adadapter = this.ehfTargetConnection.ADAdapter; adminSyncState = null; ExSearchResultEntry exSearchResultEntry = adadapter.ReadObjectEntry(ouDN, false, EhfCompanyAdmins.ConfigUnitAttribute); if (exSearchResultEntry == null) { targetConnection.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Could not load object with DN <{0}>; Cannot determine the CompanyId", new object[] { ouDN }); return(false); } DirectoryAttribute attribute = exSearchResultEntry.GetAttribute("msExchCU"); if (attribute == null) { targetConnection.DiagSession.LogAndTraceError("Could not load the Configuration Containter for {0}", new object[] { ouDN }); return(false); } string configUnitDN = (string)attribute[0]; return(EhfCompanySynchronizer.TryGetEhfAdminSyncState(configUnitDN, configADAdapter, targetConnection, "Ignoring admin account changes, will retry in next sync cycle", out adminSyncState)); }
private static bool TryGetEhfCompanyIdentity(string configUnitDN, EhfADAdapter adAdapter, EhfTargetConnection targetConnection, string missingIdAction, out EhfCompanyIdentity ehfCompanyIdentity) { ehfCompanyIdentity = null; string[] perimeterSettingsCompanyIdentityAttributes = EhfCompanySynchronizer.PerimeterSettingsCompanyIdentityAttributes; ExSearchResultEntry perimeterSettingsEntry; if (!EhfCompanySynchronizer.TryGetPerimeterConfigEntry(configUnitDN, adAdapter, targetConnection.DiagSession, missingIdAction, perimeterSettingsCompanyIdentityAttributes, out perimeterSettingsEntry)) { return(false); } ehfCompanyIdentity = EhfCompanySynchronizer.GetEhfCompanyIdentity(configUnitDN, targetConnection.DiagSession, missingIdAction, perimeterSettingsEntry); return(true); }
public static bool TryGetEhfAdminSyncState(string configUnitDN, EhfADAdapter adAdapter, EhfTargetConnection targetConnection, string missingIdAction, out EhfAdminSyncState ehfAdminSyncState) { ehfAdminSyncState = null; string[] adminSyncPerimeterSettingsAttributes = EhfCompanySynchronizer.AdminSyncPerimeterSettingsAttributes; ExSearchResultEntry exSearchResultEntry; if (!EhfCompanySynchronizer.TryGetPerimeterConfigEntry(configUnitDN, adAdapter, targetConnection.DiagSession, missingIdAction, adminSyncPerimeterSettingsAttributes, out exSearchResultEntry)) { return(false); } EhfCompanyIdentity ehfCompanyIdentity = EhfCompanySynchronizer.GetEhfCompanyIdentity(configUnitDN, targetConnection.DiagSession, missingIdAction, exSearchResultEntry); ehfAdminSyncState = EhfAdminSyncState.Create(ehfCompanyIdentity, exSearchResultEntry, targetConnection); return(true); }
public bool TryGetEhfCompanyIdentity(string configUnitDN, string missingIdAction, out EhfCompanyIdentity companyIdentity) { companyIdentity = null; if (this.configUnitsToCompanyIdentities != null && this.configUnitsToCompanyIdentities.TryGetValue(configUnitDN, out companyIdentity)) { base.DiagSession.Tracer.TraceDebug <int, Guid, string>((long)base.DiagSession.GetHashCode(), "Successully retrieved cached EHF company ID {0} and company Guid {1} for ConfigUnit root DN <{2}>", companyIdentity.EhfCompanyId, companyIdentity.EhfCompanyGuid, configUnitDN); return(true); } if (EhfCompanySynchronizer.TryGetEhfCompanyIdentity(configUnitDN, base.ADAdapter, base.EhfConnection, missingIdAction, out companyIdentity) && companyIdentity.EhfCompanyId != 0) { this.CacheEhfCompanyIdentity(configUnitDN, companyIdentity); base.DiagSession.Tracer.TraceDebug <int, Guid, string>((long)base.DiagSession.GetHashCode(), "Successully retrieved EHF company ID {0} and companyGuid {1} for ConfigUnit root DN <{2}>", companyIdentity.EhfCompanyId, companyIdentity.EhfCompanyGuid, configUnitDN); return(true); } return(false); }
public override List <TypeSynchronizer> CreateTypeSynchronizer(SyncTreeType type) { List <TypeSynchronizer> list = new List <TypeSynchronizer>(); if (this.ehfWebServiceVersion != EhfWebServiceVersion.Version1 && this.ehfWebServiceVersion != EhfWebServiceVersion.Version2) { EdgeSyncEvents.Log.LogEvent(EdgeSyncEventLogConstants.Tuple_EhfWebServiceVersionIsNotSupported, null, new object[] { this.ehfWebServiceVersion, this.identity }); return(list); } if (type == SyncTreeType.Configuration) { list.Add(EhfCompanySynchronizer.CreateTypeSynchronizer()); list.Add(EhfDomainSynchronizer.CreateTypeSynchronizer()); } else if (type == SyncTreeType.Recipients) { list.Add(EhfAdminAccountSynchronizer.CreateTypeSynchronizer()); } return(list); }