public void SetDomainFlag(string domainFqdn, GlsDomainFlags flag, bool value)
        {
            string address = MServDirectorySession.EntryIdForGlsDomainFlag(domainFqdn, flag);

            MServDirectorySession.RemoveMserveEntry(address, value ? 0 : 1);
            MServDirectorySession.AddMserveEntry(address, value ? 1 : 0);
        }
        private int UpdateMservEntry(Guid externalDirectoryOrganizationId, bool allowOverwrite, string mservEntryKey)
        {
            int partnerId = this.GetLocalSite().PartnerId;
            int num       = MServDirectorySession.ReadMservEntry(mservEntryKey);

            if (num == -1)
            {
                MServDirectorySession.AddMserveEntry(mservEntryKey, partnerId);
            }
            else if (num != partnerId)
            {
                if (!allowOverwrite)
                {
                    throw new MServPermanentException(DirectoryStrings.TenantAlreadyExistsInMserv(externalDirectoryOrganizationId, num, partnerId));
                }
                MServDirectorySession.RemoveMserveEntry(mservEntryKey, num);
                MServDirectorySession.AddMserveEntry(mservEntryKey, partnerId);
            }
            return(num);
        }