releases-comm-central/mailnews/addrbook/modules/LDAPReplicationService.sys.mjs

223 строки
6.0 KiB
JavaScript
Исходник Постоянная ссылка Обычный вид История

/* -*- Mode: JavaScript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Bug 1824260 - esmify mailnews/. r=freaktechnik Differential Revision: https://phabricator.services.mozilla.com/D204279 --HG-- rename : mailnews/addrbook/modules/AddrBookDirectory.jsm => mailnews/addrbook/modules/AddrBookDirectory.sys.mjs rename : mailnews/addrbook/modules/AddrBookMailingList.jsm => mailnews/addrbook/modules/AddrBookMailingList.sys.mjs rename : mailnews/addrbook/modules/AddrBookUtils.jsm => mailnews/addrbook/modules/AddrBookUtils.sys.mjs rename : mailnews/addrbook/modules/CardDAVUtils.jsm => mailnews/addrbook/modules/CardDAVUtils.sys.mjs rename : mailnews/addrbook/modules/LDAPClient.jsm => mailnews/addrbook/modules/LDAPClient.sys.mjs rename : mailnews/addrbook/modules/LDAPListenerBase.jsm => mailnews/addrbook/modules/LDAPListenerBase.sys.mjs rename : mailnews/addrbook/modules/LDAPMessage.jsm => mailnews/addrbook/modules/LDAPMessage.sys.mjs rename : mailnews/addrbook/modules/QueryStringToExpression.jsm => mailnews/addrbook/modules/QueryStringToExpression.sys.mjs rename : mailnews/addrbook/test/CardDAVServer.jsm => mailnews/addrbook/test/CardDAVServer.sys.mjs rename : mailnews/addrbook/test/LDAPServer.jsm => mailnews/addrbook/test/LDAPServer.sys.mjs rename : mailnews/base/src/ABQueryUtils.jsm => mailnews/base/src/ABQueryUtils.sys.mjs rename : mailnews/base/src/FolderUtils.jsm => mailnews/base/src/FolderUtils.sys.mjs rename : mailnews/base/src/JXON.jsm => mailnews/base/src/JXON.sys.mjs rename : mailnews/base/src/LineReader.jsm => mailnews/base/src/LineReader.sys.mjs rename : mailnews/base/src/MailAuthenticator.jsm => mailnews/base/src/MailAuthenticator.sys.mjs rename : mailnews/base/src/MailCryptoUtils.jsm => mailnews/base/src/MailCryptoUtils.sys.mjs rename : mailnews/base/src/MailServices.jsm => mailnews/base/src/MailServices.sys.mjs rename : mailnews/base/src/MailStringUtils.jsm => mailnews/base/src/MailStringUtils.sys.mjs rename : mailnews/base/src/MailnewsMigrator.jsm => mailnews/base/src/MailnewsMigrator.sys.mjs rename : mailnews/base/src/MsgDBCacheManager.jsm => mailnews/base/src/MsgDBCacheManager.sys.mjs rename : mailnews/base/src/MsgIncomingServer.jsm => mailnews/base/src/MsgIncomingServer.sys.mjs rename : mailnews/base/src/MsgKeySet.jsm => mailnews/base/src/MsgKeySet.sys.mjs rename : mailnews/base/src/OAuth2.jsm => mailnews/base/src/OAuth2.sys.mjs rename : mailnews/base/src/OAuth2Providers.jsm => mailnews/base/src/OAuth2Providers.sys.mjs rename : mailnews/base/src/TemplateUtils.jsm => mailnews/base/src/TemplateUtils.sys.mjs rename : mailnews/base/src/VirtualFolderWrapper.jsm => mailnews/base/src/VirtualFolderWrapper.sys.mjs rename : mailnews/base/src/WinUnreadBadge.jsm => mailnews/base/src/WinUnreadBadge.sys.mjs rename : mailnews/base/src/hostnameUtils.jsm => mailnews/base/src/hostnameUtils.sys.mjs rename : mailnews/base/src/mailstoreConverter.jsm => mailnews/base/src/mailstoreConverter.sys.mjs rename : mailnews/compose/src/MimeEncoder.jsm => mailnews/compose/src/MimeEncoder.sys.mjs rename : mailnews/compose/src/MimeMessage.jsm => mailnews/compose/src/MimeMessage.sys.mjs rename : mailnews/compose/src/MimeMessageUtils.jsm => mailnews/compose/src/MimeMessageUtils.sys.mjs rename : mailnews/compose/src/MimePart.jsm => mailnews/compose/src/MimePart.sys.mjs rename : mailnews/compose/src/SmtpClient.jsm => mailnews/compose/src/SmtpClient.sys.mjs rename : mailnews/db/gloda/modules/Collection.jsm => mailnews/db/gloda/modules/Collection.sys.mjs rename : mailnews/db/gloda/modules/Everybody.jsm => mailnews/db/gloda/modules/Everybody.sys.mjs rename : mailnews/db/gloda/modules/Facet.jsm => mailnews/db/gloda/modules/Facet.sys.mjs rename : mailnews/db/gloda/modules/Gloda.jsm => mailnews/db/gloda/modules/Gloda.sys.mjs rename : mailnews/db/gloda/modules/GlodaConstants.jsm => mailnews/db/gloda/modules/GlodaConstants.sys.mjs rename : mailnews/db/gloda/modules/GlodaContent.jsm => mailnews/db/gloda/modules/GlodaContent.sys.mjs rename : mailnews/db/gloda/modules/GlodaDataModel.jsm => mailnews/db/gloda/modules/GlodaDataModel.sys.mjs rename : mailnews/db/gloda/modules/GlodaDatabind.jsm => mailnews/db/gloda/modules/GlodaDatabind.sys.mjs rename : mailnews/db/gloda/modules/GlodaDatastore.jsm => mailnews/db/gloda/modules/GlodaDatastore.sys.mjs rename : mailnews/db/gloda/modules/GlodaExplicitAttr.jsm => mailnews/db/gloda/modules/GlodaExplicitAttr.sys.mjs rename : mailnews/db/gloda/modules/GlodaFundAttr.jsm => mailnews/db/gloda/modules/GlodaFundAttr.sys.mjs rename : mailnews/db/gloda/modules/GlodaIndexer.jsm => mailnews/db/gloda/modules/GlodaIndexer.sys.mjs rename : mailnews/db/gloda/modules/GlodaMsgIndexer.jsm => mailnews/db/gloda/modules/GlodaMsgIndexer.sys.mjs rename : mailnews/db/gloda/modules/GlodaMsgSearcher.jsm => mailnews/db/gloda/modules/GlodaMsgSearcher.sys.mjs rename : mailnews/db/gloda/modules/GlodaPublic.jsm => mailnews/db/gloda/modules/GlodaPublic.sys.mjs rename : mailnews/db/gloda/modules/GlodaQueryClassFactory.jsm => mailnews/db/gloda/modules/GlodaQueryClassFactory.sys.mjs rename : mailnews/db/gloda/modules/GlodaSyntheticView.jsm => mailnews/db/gloda/modules/GlodaSyntheticView.sys.mjs rename : mailnews/db/gloda/modules/GlodaUtils.jsm => mailnews/db/gloda/modules/GlodaUtils.sys.mjs rename : mailnews/db/gloda/modules/IndexMsg.jsm => mailnews/db/gloda/modules/IndexMsg.sys.mjs rename : mailnews/db/gloda/modules/MimeMessage.jsm => mailnews/db/gloda/modules/MimeMessage.sys.mjs rename : mailnews/db/gloda/modules/NounFreetag.jsm => mailnews/db/gloda/modules/NounFreetag.sys.mjs rename : mailnews/db/gloda/modules/NounMimetype.jsm => mailnews/db/gloda/modules/NounMimetype.sys.mjs rename : mailnews/db/gloda/modules/NounTag.jsm => mailnews/db/gloda/modules/NounTag.sys.mjs rename : mailnews/db/gloda/modules/SuffixTree.jsm => mailnews/db/gloda/modules/SuffixTree.sys.mjs rename : mailnews/db/gloda/test/unit/resources/GlodaQueryHelper.jsm => mailnews/db/gloda/test/unit/resources/GlodaQueryHelper.sys.mjs rename : mailnews/db/gloda/test/unit/resources/GlodaTestHelper.jsm => mailnews/db/gloda/test/unit/resources/GlodaTestHelper.sys.mjs rename : mailnews/db/gloda/test/unit/resources/GlodaTestHelperFunctions.jsm => mailnews/db/gloda/test/unit/resources/GlodaTestHelperFunctions.sys.mjs rename : mailnews/export/modules/ProfileExporter.jsm => mailnews/export/modules/ProfileExporter.sys.mjs rename : mailnews/extensions/newsblog/Feed.jsm => mailnews/extensions/newsblog/Feed.sys.mjs rename : mailnews/extensions/newsblog/FeedItem.jsm => mailnews/extensions/newsblog/FeedItem.sys.mjs rename : mailnews/extensions/newsblog/FeedParser.jsm => mailnews/extensions/newsblog/FeedParser.sys.mjs rename : mailnews/extensions/newsblog/FeedUtils.jsm => mailnews/extensions/newsblog/FeedUtils.sys.mjs rename : mailnews/imap/src/ImapChannel.jsm => mailnews/imap/src/ImapChannel.sys.mjs rename : mailnews/imap/src/ImapClient.jsm => mailnews/imap/src/ImapClient.sys.mjs rename : mailnews/imap/src/ImapIncomingServer.jsm => mailnews/imap/src/ImapIncomingServer.sys.mjs rename : mailnews/imap/src/ImapMessageService.jsm => mailnews/imap/src/ImapMessageService.sys.mjs rename : mailnews/imap/src/ImapProtocolHandler.jsm => mailnews/imap/src/ImapProtocolHandler.sys.mjs rename : mailnews/imap/src/ImapProtocolInfo.jsm => mailnews/imap/src/ImapProtocolInfo.sys.mjs rename : mailnews/imap/src/ImapResponse.jsm => mailnews/imap/src/ImapResponse.sys.mjs rename : mailnews/imap/src/ImapService.jsm => mailnews/imap/src/ImapService.sys.mjs rename : mailnews/imap/src/ImapUtils.jsm => mailnews/imap/src/ImapUtils.sys.mjs rename : mailnews/import/modules/AddrBookFileImporter.jsm => mailnews/import/modules/AddrBookFileImporter.sys.mjs rename : mailnews/import/modules/AppleMailProfileImporter.jsm => mailnews/import/modules/AppleMailProfileImporter.sys.mjs rename : mailnews/import/modules/BaseProfileImporter.jsm => mailnews/import/modules/BaseProfileImporter.sys.mjs rename : mailnews/import/modules/BeckyProfileImporter.jsm => mailnews/import/modules/BeckyProfileImporter.sys.mjs rename : mailnews/import/modules/CalendarFileImporter.jsm => mailnews/import/modules/CalendarFileImporter.sys.mjs rename : mailnews/import/modules/OutlookProfileImporter.jsm => mailnews/import/modules/OutlookProfileImporter.sys.mjs rename : mailnews/import/modules/SeamonkeyProfileImporter.jsm => mailnews/import/modules/SeamonkeyProfileImporter.sys.mjs rename : mailnews/import/modules/ThunderbirdProfileImporter.jsm => mailnews/import/modules/ThunderbirdProfileImporter.sys.mjs rename : mailnews/jsaccount/modules/JSAccountUtils.jsm => mailnews/jsaccount/modules/JSAccountUtils.sys.mjs rename : mailnews/jsaccount/modules/JaBaseUrl.jsm => mailnews/jsaccount/modules/JaBaseUrl.sys.mjs rename : mailnews/jsaccount/test/unit/resources/testJaBaseIncomingServer.jsm => mailnews/jsaccount/test/unit/resources/testJaBaseIncomingServer.sys.mjs rename : mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm => mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.sys.mjs rename : mailnews/local/src/Pop3Channel.jsm => mailnews/local/src/Pop3Channel.sys.mjs rename : mailnews/local/src/Pop3Client.jsm => mailnews/local/src/Pop3Client.sys.mjs rename : mailnews/mime/src/jsmime.jsm => mailnews/mime/src/jsmime.sys.mjs rename : mailnews/mime/src/mimeParser.jsm => mailnews/mime/src/mimeParser.sys.mjs rename : mailnews/news/src/NntpChannel.jsm => mailnews/news/src/NntpChannel.sys.mjs rename : mailnews/news/src/NntpClient.jsm => mailnews/news/src/NntpClient.sys.mjs rename : mailnews/news/src/NntpNewsGroup.jsm => mailnews/news/src/NntpNewsGroup.sys.mjs rename : mailnews/news/src/NntpUtils.jsm => mailnews/news/src/NntpUtils.sys.mjs rename : mailnews/search/src/PeriodicFilterManager.jsm => mailnews/search/src/PeriodicFilterManager.sys.mjs extra : rebase_source : 0d95b8d8e0eb6134fe513fab1793e34bab974206
2024-03-12 18:01:01 +03:00
import { LDAPListenerBase } from "resource:///modules/LDAPListenerBase.sys.mjs";
Bug 1881745 - Convert all registered components from JSM to ESM. r=thunderbird-reviewers,ikey Differential Revision: https://phabricator.services.mozilla.com/D202568 --HG-- rename : calendar/base/src/CalAlarm.jsm => calendar/base/src/CalAlarm.sys.mjs rename : calendar/base/src/CalAlarmMonitor.jsm => calendar/base/src/CalAlarmMonitor.sys.mjs rename : calendar/base/src/CalAlarmService.jsm => calendar/base/src/CalAlarmService.sys.mjs rename : calendar/base/src/CalAttachment.jsm => calendar/base/src/CalAttachment.sys.mjs rename : calendar/base/src/CalAttendee.jsm => calendar/base/src/CalAttendee.sys.mjs rename : calendar/base/src/CalCalendarManager.jsm => calendar/base/src/CalCalendarManager.sys.mjs rename : calendar/base/src/CalDateTime.jsm => calendar/base/src/CalDateTime.sys.mjs rename : calendar/base/src/CalDefaultACLManager.jsm => calendar/base/src/CalDefaultACLManager.sys.mjs rename : calendar/base/src/CalDeletedItems.jsm => calendar/base/src/CalDeletedItems.sys.mjs rename : calendar/base/src/CalDuration.jsm => calendar/base/src/CalDuration.sys.mjs rename : calendar/base/src/CalEvent.jsm => calendar/base/src/CalEvent.sys.mjs rename : calendar/base/src/CalFreeBusyService.jsm => calendar/base/src/CalFreeBusyService.sys.mjs rename : calendar/base/src/CalICSService.jsm => calendar/base/src/CalICSService.sys.mjs rename : calendar/base/src/CalIcsParser.jsm => calendar/base/src/CalIcsParser.sys.mjs rename : calendar/base/src/CalIcsSerializer.jsm => calendar/base/src/CalIcsSerializer.sys.mjs rename : calendar/base/src/CalItipItem.jsm => calendar/base/src/CalItipItem.sys.mjs rename : calendar/base/src/CalMimeConverter.jsm => calendar/base/src/CalMimeConverter.sys.mjs rename : calendar/base/src/CalPeriod.jsm => calendar/base/src/CalPeriod.sys.mjs rename : calendar/base/src/CalProtocolHandler.jsm => calendar/base/src/CalProtocolHandler.sys.mjs rename : calendar/base/src/CalRecurrenceDate.jsm => calendar/base/src/CalRecurrenceDate.sys.mjs rename : calendar/base/src/CalRecurrenceInfo.jsm => calendar/base/src/CalRecurrenceInfo.sys.mjs rename : calendar/base/src/CalRecurrenceRule.jsm => calendar/base/src/CalRecurrenceRule.sys.mjs rename : calendar/base/src/CalRelation.jsm => calendar/base/src/CalRelation.sys.mjs rename : calendar/base/src/CalStartupService.jsm => calendar/base/src/CalStartupService.sys.mjs rename : calendar/base/src/CalTimezoneService.jsm => calendar/base/src/CalTimezoneService.sys.mjs rename : calendar/base/src/CalTodo.jsm => calendar/base/src/CalTodo.sys.mjs rename : calendar/base/src/CalWeekInfoService.jsm => calendar/base/src/CalWeekInfoService.sys.mjs rename : calendar/import-export/CalHtmlExport.jsm => calendar/import-export/CalHtmlExport.sys.mjs rename : calendar/import-export/CalIcsImportExport.jsm => calendar/import-export/CalIcsImportExport.sys.mjs rename : calendar/itip/CalItipEmailTransport.jsm => calendar/itip/CalItipEmailTransport.sys.mjs rename : calendar/itip/CalItipProtocolHandler.jsm => calendar/itip/CalItipProtocolHandler.sys.mjs rename : calendar/providers/caldav/CalDavCalendar.jsm => calendar/providers/caldav/CalDavCalendar.sys.mjs rename : calendar/providers/composite/CalCompositeCalendar.jsm => calendar/providers/composite/CalCompositeCalendar.sys.mjs rename : calendar/providers/memory/CalMemoryCalendar.jsm => calendar/providers/memory/CalMemoryCalendar.sys.mjs rename : calendar/providers/storage/CalStorageCalendar.jsm => calendar/providers/storage/CalStorageCalendar.sys.mjs rename : mail/components/AboutRedirector.jsm => mail/components/AboutRedirector.sys.mjs rename : mail/components/MailGlue.jsm => mail/components/MailGlue.sys.mjs rename : mail/components/StartupRecorder.jsm => mail/components/StartupRecorder.sys.mjs rename : mail/components/activity/Activity.jsm => mail/components/activity/Activity.sys.mjs rename : mail/components/activity/ActivityManager.jsm => mail/components/activity/ActivityManager.sys.mjs rename : mail/components/activity/ActivityManagerUI.jsm => mail/components/activity/ActivityManagerUI.sys.mjs rename : mail/components/devtools/devtools-loader.jsm => mail/components/devtools/devtools-loader.sys.mjs rename : mail/components/migration/src/ThunderbirdProfileMigrator.jsm => mail/components/migration/src/ThunderbirdProfileMigrator.sys.mjs rename : mail/components/prompts/PromptCollection.jsm => mail/components/prompts/PromptCollection.sys.mjs rename : mail/extensions/am-e2e/AME2E.jsm => mail/extensions/am-e2e/AME2E.sys.mjs rename : mailnews/addrbook/modules/AddrBookCard.jsm => mailnews/addrbook/modules/AddrBookCard.sys.mjs rename : mailnews/addrbook/modules/AddrBookManager.jsm => mailnews/addrbook/modules/AddrBookManager.sys.mjs rename : mailnews/addrbook/modules/CardDAVDirectory.jsm => mailnews/addrbook/modules/CardDAVDirectory.sys.mjs rename : mailnews/addrbook/modules/LDAPConnection.jsm => mailnews/addrbook/modules/LDAPConnection.sys.mjs rename : mailnews/addrbook/modules/LDAPDirectory.jsm => mailnews/addrbook/modules/LDAPDirectory.sys.mjs rename : mailnews/addrbook/modules/LDAPDirectoryQuery.jsm => mailnews/addrbook/modules/LDAPDirectoryQuery.sys.mjs rename : mailnews/addrbook/modules/LDAPOperation.jsm => mailnews/addrbook/modules/LDAPOperation.sys.mjs rename : mailnews/addrbook/modules/LDAPProtocolHandler.jsm => mailnews/addrbook/modules/LDAPProtocolHandler.sys.mjs rename : mailnews/addrbook/modules/LDAPReplicationService.jsm => mailnews/addrbook/modules/LDAPReplicationService.sys.mjs rename : mailnews/addrbook/modules/LDAPService.jsm => mailnews/addrbook/modules/LDAPService.sys.mjs rename : mailnews/addrbook/modules/LDAPSyncQuery.jsm => mailnews/addrbook/modules/LDAPSyncQuery.sys.mjs rename : mailnews/addrbook/modules/LDAPURLParser.jsm => mailnews/addrbook/modules/LDAPURLParser.sys.mjs rename : mailnews/addrbook/modules/SQLiteDirectory.jsm => mailnews/addrbook/modules/SQLiteDirectory.sys.mjs rename : mailnews/addrbook/modules/VCardUtils.jsm => mailnews/addrbook/modules/VCardUtils.sys.mjs rename : mailnews/addrbook/src/AbAutoCompleteMyDomain.jsm => mailnews/addrbook/src/AbAutoCompleteMyDomain.sys.mjs rename : mailnews/addrbook/src/AbAutoCompleteSearch.jsm => mailnews/addrbook/src/AbAutoCompleteSearch.sys.mjs rename : mailnews/addrbook/src/AbLDAPAttributeMap.jsm => mailnews/addrbook/src/AbLDAPAttributeMap.sys.mjs rename : mailnews/addrbook/src/AbLDAPAutoCompleteSearch.jsm => mailnews/addrbook/src/AbLDAPAutoCompleteSearch.sys.mjs rename : mailnews/base/src/FolderLookupService.jsm => mailnews/base/src/FolderLookupService.sys.mjs rename : mailnews/base/src/MailNotificationManager.jsm => mailnews/base/src/MailNotificationManager.sys.mjs rename : mailnews/base/src/MailNotificationService.jsm => mailnews/base/src/MailNotificationService.sys.mjs rename : mailnews/base/src/MsgAsyncPrompter.jsm => mailnews/base/src/MsgAsyncPrompter.sys.mjs rename : mailnews/base/src/OAuth2Module.jsm => mailnews/base/src/OAuth2Module.sys.mjs rename : mailnews/compose/src/MailtoProtocolHandler.jsm => mailnews/compose/src/MailtoProtocolHandler.sys.mjs rename : mailnews/compose/src/MessageSend.jsm => mailnews/compose/src/MessageSend.sys.mjs rename : mailnews/compose/src/SMTPProtocolHandler.jsm => mailnews/compose/src/SMTPProtocolHandler.sys.mjs rename : mailnews/compose/src/SmtpServer.jsm => mailnews/compose/src/SmtpServer.sys.mjs rename : mailnews/compose/src/SmtpService.jsm => mailnews/compose/src/SmtpService.sys.mjs rename : mailnews/db/gloda/components/GlodaAutoComplete.jsm => mailnews/db/gloda/components/GlodaAutoComplete.sys.mjs rename : mailnews/db/gloda/components/MimeMessageEmitter.jsm => mailnews/db/gloda/components/MimeMessageEmitter.sys.mjs rename : mailnews/extensions/mdn/MDNService.jsm => mailnews/extensions/mdn/MDNService.sys.mjs rename : mailnews/extensions/newsblog/NewsBlog.jsm => mailnews/extensions/newsblog/NewsBlog.sys.mjs rename : mailnews/extensions/offline-startup/OfflineStartup.jsm => mailnews/extensions/offline-startup/OfflineStartup.sys.mjs rename : mailnews/imap/src/ImapModuleLoader.jsm => mailnews/imap/src/ImapModuleLoader.sys.mjs rename : mailnews/import/src/SeamonkeyImport.jsm => mailnews/import/src/SeamonkeyImport.sys.mjs rename : mailnews/import/src/ThunderbirdImport.jsm => mailnews/import/src/ThunderbirdImport.sys.mjs rename : mailnews/jsaccount/test/unit/resources/TestJaMsgProtocolInfoComponent.jsm => mailnews/jsaccount/test/unit/resources/TestJaMsgProtocolInfoComponent.sys.mjs rename : mailnews/local/src/Pop3IncomingServer.jsm => mailnews/local/src/Pop3IncomingServer.sys.mjs rename : mailnews/local/src/Pop3ProtocolHandler.jsm => mailnews/local/src/Pop3ProtocolHandler.sys.mjs rename : mailnews/local/src/Pop3ProtocolInfo.jsm => mailnews/local/src/Pop3ProtocolInfo.sys.mjs rename : mailnews/local/src/Pop3Service.jsm => mailnews/local/src/Pop3Service.sys.mjs rename : mailnews/mime/src/MimeJSComponents.jsm => mailnews/mime/src/MimeJSComponents.sys.mjs rename : mailnews/news/src/NewsAutoCompleteSearch.jsm => mailnews/news/src/NewsAutoCompleteSearch.sys.mjs rename : mailnews/news/src/NntpIncomingServer.jsm => mailnews/news/src/NntpIncomingServer.sys.mjs rename : mailnews/news/src/NntpMessageService.jsm => mailnews/news/src/NntpMessageService.sys.mjs rename : mailnews/news/src/NntpProtocolHandler.jsm => mailnews/news/src/NntpProtocolHandler.sys.mjs rename : mailnews/news/src/NntpProtocolInfo.jsm => mailnews/news/src/NntpProtocolInfo.sys.mjs rename : mailnews/news/src/NntpService.jsm => mailnews/news/src/NntpService.sys.mjs rename : mailnews/search/src/MsgTraitService.jsm => mailnews/search/src/MsgTraitService.sys.mjs extra : moz-landing-system : lando
2024-02-23 15:50:48 +03:00
import { SQLiteDirectory } from "resource:///modules/SQLiteDirectory.sys.mjs";
/**
* A service to replicate a LDAP directory to a local SQLite db.
*
* @implements {nsIAbLDAPReplicationService}
* @implements {nsILDAPMessageListener}
*/
Bug 1881745 - Convert all registered components from JSM to ESM. r=thunderbird-reviewers,ikey Differential Revision: https://phabricator.services.mozilla.com/D202568 --HG-- rename : calendar/base/src/CalAlarm.jsm => calendar/base/src/CalAlarm.sys.mjs rename : calendar/base/src/CalAlarmMonitor.jsm => calendar/base/src/CalAlarmMonitor.sys.mjs rename : calendar/base/src/CalAlarmService.jsm => calendar/base/src/CalAlarmService.sys.mjs rename : calendar/base/src/CalAttachment.jsm => calendar/base/src/CalAttachment.sys.mjs rename : calendar/base/src/CalAttendee.jsm => calendar/base/src/CalAttendee.sys.mjs rename : calendar/base/src/CalCalendarManager.jsm => calendar/base/src/CalCalendarManager.sys.mjs rename : calendar/base/src/CalDateTime.jsm => calendar/base/src/CalDateTime.sys.mjs rename : calendar/base/src/CalDefaultACLManager.jsm => calendar/base/src/CalDefaultACLManager.sys.mjs rename : calendar/base/src/CalDeletedItems.jsm => calendar/base/src/CalDeletedItems.sys.mjs rename : calendar/base/src/CalDuration.jsm => calendar/base/src/CalDuration.sys.mjs rename : calendar/base/src/CalEvent.jsm => calendar/base/src/CalEvent.sys.mjs rename : calendar/base/src/CalFreeBusyService.jsm => calendar/base/src/CalFreeBusyService.sys.mjs rename : calendar/base/src/CalICSService.jsm => calendar/base/src/CalICSService.sys.mjs rename : calendar/base/src/CalIcsParser.jsm => calendar/base/src/CalIcsParser.sys.mjs rename : calendar/base/src/CalIcsSerializer.jsm => calendar/base/src/CalIcsSerializer.sys.mjs rename : calendar/base/src/CalItipItem.jsm => calendar/base/src/CalItipItem.sys.mjs rename : calendar/base/src/CalMimeConverter.jsm => calendar/base/src/CalMimeConverter.sys.mjs rename : calendar/base/src/CalPeriod.jsm => calendar/base/src/CalPeriod.sys.mjs rename : calendar/base/src/CalProtocolHandler.jsm => calendar/base/src/CalProtocolHandler.sys.mjs rename : calendar/base/src/CalRecurrenceDate.jsm => calendar/base/src/CalRecurrenceDate.sys.mjs rename : calendar/base/src/CalRecurrenceInfo.jsm => calendar/base/src/CalRecurrenceInfo.sys.mjs rename : calendar/base/src/CalRecurrenceRule.jsm => calendar/base/src/CalRecurrenceRule.sys.mjs rename : calendar/base/src/CalRelation.jsm => calendar/base/src/CalRelation.sys.mjs rename : calendar/base/src/CalStartupService.jsm => calendar/base/src/CalStartupService.sys.mjs rename : calendar/base/src/CalTimezoneService.jsm => calendar/base/src/CalTimezoneService.sys.mjs rename : calendar/base/src/CalTodo.jsm => calendar/base/src/CalTodo.sys.mjs rename : calendar/base/src/CalWeekInfoService.jsm => calendar/base/src/CalWeekInfoService.sys.mjs rename : calendar/import-export/CalHtmlExport.jsm => calendar/import-export/CalHtmlExport.sys.mjs rename : calendar/import-export/CalIcsImportExport.jsm => calendar/import-export/CalIcsImportExport.sys.mjs rename : calendar/itip/CalItipEmailTransport.jsm => calendar/itip/CalItipEmailTransport.sys.mjs rename : calendar/itip/CalItipProtocolHandler.jsm => calendar/itip/CalItipProtocolHandler.sys.mjs rename : calendar/providers/caldav/CalDavCalendar.jsm => calendar/providers/caldav/CalDavCalendar.sys.mjs rename : calendar/providers/composite/CalCompositeCalendar.jsm => calendar/providers/composite/CalCompositeCalendar.sys.mjs rename : calendar/providers/memory/CalMemoryCalendar.jsm => calendar/providers/memory/CalMemoryCalendar.sys.mjs rename : calendar/providers/storage/CalStorageCalendar.jsm => calendar/providers/storage/CalStorageCalendar.sys.mjs rename : mail/components/AboutRedirector.jsm => mail/components/AboutRedirector.sys.mjs rename : mail/components/MailGlue.jsm => mail/components/MailGlue.sys.mjs rename : mail/components/StartupRecorder.jsm => mail/components/StartupRecorder.sys.mjs rename : mail/components/activity/Activity.jsm => mail/components/activity/Activity.sys.mjs rename : mail/components/activity/ActivityManager.jsm => mail/components/activity/ActivityManager.sys.mjs rename : mail/components/activity/ActivityManagerUI.jsm => mail/components/activity/ActivityManagerUI.sys.mjs rename : mail/components/devtools/devtools-loader.jsm => mail/components/devtools/devtools-loader.sys.mjs rename : mail/components/migration/src/ThunderbirdProfileMigrator.jsm => mail/components/migration/src/ThunderbirdProfileMigrator.sys.mjs rename : mail/components/prompts/PromptCollection.jsm => mail/components/prompts/PromptCollection.sys.mjs rename : mail/extensions/am-e2e/AME2E.jsm => mail/extensions/am-e2e/AME2E.sys.mjs rename : mailnews/addrbook/modules/AddrBookCard.jsm => mailnews/addrbook/modules/AddrBookCard.sys.mjs rename : mailnews/addrbook/modules/AddrBookManager.jsm => mailnews/addrbook/modules/AddrBookManager.sys.mjs rename : mailnews/addrbook/modules/CardDAVDirectory.jsm => mailnews/addrbook/modules/CardDAVDirectory.sys.mjs rename : mailnews/addrbook/modules/LDAPConnection.jsm => mailnews/addrbook/modules/LDAPConnection.sys.mjs rename : mailnews/addrbook/modules/LDAPDirectory.jsm => mailnews/addrbook/modules/LDAPDirectory.sys.mjs rename : mailnews/addrbook/modules/LDAPDirectoryQuery.jsm => mailnews/addrbook/modules/LDAPDirectoryQuery.sys.mjs rename : mailnews/addrbook/modules/LDAPOperation.jsm => mailnews/addrbook/modules/LDAPOperation.sys.mjs rename : mailnews/addrbook/modules/LDAPProtocolHandler.jsm => mailnews/addrbook/modules/LDAPProtocolHandler.sys.mjs rename : mailnews/addrbook/modules/LDAPReplicationService.jsm => mailnews/addrbook/modules/LDAPReplicationService.sys.mjs rename : mailnews/addrbook/modules/LDAPService.jsm => mailnews/addrbook/modules/LDAPService.sys.mjs rename : mailnews/addrbook/modules/LDAPSyncQuery.jsm => mailnews/addrbook/modules/LDAPSyncQuery.sys.mjs rename : mailnews/addrbook/modules/LDAPURLParser.jsm => mailnews/addrbook/modules/LDAPURLParser.sys.mjs rename : mailnews/addrbook/modules/SQLiteDirectory.jsm => mailnews/addrbook/modules/SQLiteDirectory.sys.mjs rename : mailnews/addrbook/modules/VCardUtils.jsm => mailnews/addrbook/modules/VCardUtils.sys.mjs rename : mailnews/addrbook/src/AbAutoCompleteMyDomain.jsm => mailnews/addrbook/src/AbAutoCompleteMyDomain.sys.mjs rename : mailnews/addrbook/src/AbAutoCompleteSearch.jsm => mailnews/addrbook/src/AbAutoCompleteSearch.sys.mjs rename : mailnews/addrbook/src/AbLDAPAttributeMap.jsm => mailnews/addrbook/src/AbLDAPAttributeMap.sys.mjs rename : mailnews/addrbook/src/AbLDAPAutoCompleteSearch.jsm => mailnews/addrbook/src/AbLDAPAutoCompleteSearch.sys.mjs rename : mailnews/base/src/FolderLookupService.jsm => mailnews/base/src/FolderLookupService.sys.mjs rename : mailnews/base/src/MailNotificationManager.jsm => mailnews/base/src/MailNotificationManager.sys.mjs rename : mailnews/base/src/MailNotificationService.jsm => mailnews/base/src/MailNotificationService.sys.mjs rename : mailnews/base/src/MsgAsyncPrompter.jsm => mailnews/base/src/MsgAsyncPrompter.sys.mjs rename : mailnews/base/src/OAuth2Module.jsm => mailnews/base/src/OAuth2Module.sys.mjs rename : mailnews/compose/src/MailtoProtocolHandler.jsm => mailnews/compose/src/MailtoProtocolHandler.sys.mjs rename : mailnews/compose/src/MessageSend.jsm => mailnews/compose/src/MessageSend.sys.mjs rename : mailnews/compose/src/SMTPProtocolHandler.jsm => mailnews/compose/src/SMTPProtocolHandler.sys.mjs rename : mailnews/compose/src/SmtpServer.jsm => mailnews/compose/src/SmtpServer.sys.mjs rename : mailnews/compose/src/SmtpService.jsm => mailnews/compose/src/SmtpService.sys.mjs rename : mailnews/db/gloda/components/GlodaAutoComplete.jsm => mailnews/db/gloda/components/GlodaAutoComplete.sys.mjs rename : mailnews/db/gloda/components/MimeMessageEmitter.jsm => mailnews/db/gloda/components/MimeMessageEmitter.sys.mjs rename : mailnews/extensions/mdn/MDNService.jsm => mailnews/extensions/mdn/MDNService.sys.mjs rename : mailnews/extensions/newsblog/NewsBlog.jsm => mailnews/extensions/newsblog/NewsBlog.sys.mjs rename : mailnews/extensions/offline-startup/OfflineStartup.jsm => mailnews/extensions/offline-startup/OfflineStartup.sys.mjs rename : mailnews/imap/src/ImapModuleLoader.jsm => mailnews/imap/src/ImapModuleLoader.sys.mjs rename : mailnews/import/src/SeamonkeyImport.jsm => mailnews/import/src/SeamonkeyImport.sys.mjs rename : mailnews/import/src/ThunderbirdImport.jsm => mailnews/import/src/ThunderbirdImport.sys.mjs rename : mailnews/jsaccount/test/unit/resources/TestJaMsgProtocolInfoComponent.jsm => mailnews/jsaccount/test/unit/resources/TestJaMsgProtocolInfoComponent.sys.mjs rename : mailnews/local/src/Pop3IncomingServer.jsm => mailnews/local/src/Pop3IncomingServer.sys.mjs rename : mailnews/local/src/Pop3ProtocolHandler.jsm => mailnews/local/src/Pop3ProtocolHandler.sys.mjs rename : mailnews/local/src/Pop3ProtocolInfo.jsm => mailnews/local/src/Pop3ProtocolInfo.sys.mjs rename : mailnews/local/src/Pop3Service.jsm => mailnews/local/src/Pop3Service.sys.mjs rename : mailnews/mime/src/MimeJSComponents.jsm => mailnews/mime/src/MimeJSComponents.sys.mjs rename : mailnews/news/src/NewsAutoCompleteSearch.jsm => mailnews/news/src/NewsAutoCompleteSearch.sys.mjs rename : mailnews/news/src/NntpIncomingServer.jsm => mailnews/news/src/NntpIncomingServer.sys.mjs rename : mailnews/news/src/NntpMessageService.jsm => mailnews/news/src/NntpMessageService.sys.mjs rename : mailnews/news/src/NntpProtocolHandler.jsm => mailnews/news/src/NntpProtocolHandler.sys.mjs rename : mailnews/news/src/NntpProtocolInfo.jsm => mailnews/news/src/NntpProtocolInfo.sys.mjs rename : mailnews/news/src/NntpService.jsm => mailnews/news/src/NntpService.sys.mjs rename : mailnews/search/src/MsgTraitService.jsm => mailnews/search/src/MsgTraitService.sys.mjs extra : moz-landing-system : lando
2024-02-23 15:50:48 +03:00
export class LDAPReplicationService extends LDAPListenerBase {
QueryInterface = ChromeUtils.generateQI([
"nsIAbLDAPReplicationService",
"nsILDAPMessageListener",
]);
/**
* @see nsIAbLDAPReplicationService
*/
startReplication(directory, progressListener) {
this._directory = directory;
this._listener = progressListener;
this._attrMap = directory.attributeMap;
this._count = 0;
this._cards = [];
this._connection = Cc[
"@mozilla.org/network/ldap-connection;1"
].createInstance(Ci.nsILDAPConnection);
this._operation = Cc[
"@mozilla.org/network/ldap-operation;1"
].createInstance(Ci.nsILDAPOperation);
this._connection.init(directory.lDAPURL, directory.authDn, this);
}
/**
* @see nsIAbLDAPReplicationService
*/
cancelReplication() {
this._operation.abandonExt();
this.done(false);
}
/**
* @see nsIAbLDAPReplicationService
*/
done(success) {
this._done(success);
}
/**
* @see nsILDAPMessageListener
*/
onLDAPMessage(msg) {
switch (msg.type) {
case Ci.nsILDAPMessage.RES_BIND:
this._onLDAPBind(msg);
break;
case Ci.nsILDAPMessage.RES_SEARCH_ENTRY:
this._onLDAPSearchEntry(msg);
break;
case Ci.nsILDAPMessage.RES_SEARCH_RESULT:
this._onLDAPSearchResult(msg);
break;
default:
break;
}
}
/**
* @see nsILDAPMessageListener
*/
onLDAPError() {
this.done(false);
}
/**
* @see LDAPListenerBase
*/
_actionOnBindSuccess() {
this._openABForReplicationDir();
const ldapUrl = this._directory.lDAPURL;
this._operation.init(this._connection, this, null);
this._listener.onStateChange(
null,
null,
Ci.nsIWebProgressListener.STATE_START,
Cr.NS_OK
);
this._operation.searchExt(
ldapUrl.dn,
ldapUrl.scope,
ldapUrl.filter,
ldapUrl.attributes,
0,
0
);
}
/**
* @see LDAPListenerBase
*/
_actionOnBindFailure() {
this._done(false);
}
/**
* Handler of nsILDAPMessage.RES_SEARCH_ENTRY message.
*
* @param {nsILDAPMessage} msg - The received LDAP message.
*/
async _onLDAPSearchEntry(msg) {
const newCard = Cc[
"@mozilla.org/addressbook/cardproperty;1"
].createInstance(Ci.nsIAbCard);
this._attrMap.setCardPropertiesFromLDAPMessage(msg, newCard);
this._cards.push(newCard);
this._count++;
if (this._count % 10 == 0) {
// inform the listener every 10 entries
this._listener.onProgressChange(
null,
null,
this._count,
-1,
this._count,
-1
);
}
if (this._count % 100 == 0 && !this._writePromise) {
// Write to the db to release some memory.
this._writePromise = this._replicationDB.bulkAddCards(this._cards);
this._cards = [];
await this._writePromise;
this._writePromise = null;
}
}
/**
* Handler of nsILDAPMessage.RES_SEARCH_RESULT message.
*
* @param {nsILDAPMessage} msg - The received LDAP message.
*/
async _onLDAPSearchResult(msg) {
if (
msg.errorCode == Ci.nsILDAPErrors.SUCCESS ||
msg.errorCode == Ci.nsILDAPErrors.SIZELIMIT_EXCEEDED
) {
if (this._writePromise) {
await this._writePromise;
}
await this._replicationDB.bulkAddCards(this._cards);
this.done(true);
return;
}
this.done(false);
}
/**
* Init a jsaddrbook from the replicationFileName of the current LDAP directory.
*/
_openABForReplicationDir() {
this._oldReplicationFileName = this._directory.replicationFileName;
this._replicationFile = this._directory.replicationFile;
if (this._replicationFile.exists()) {
// If the database file already exists, create a new one here, and replace
// the old file in _done when success.
this._replicationFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
// What we need is the unique file name, _replicationDB will create an
// empty database file.
this._replicationFile.remove(false);
// Set replicationFileName to the new db file name, so that _replicationDB
// works correctly.
this._directory.replicationFileName = this._replicationFile.leafName;
}
this._replicationDB = new SQLiteDirectory();
this._replicationDB.init(`jsaddrbook://${this._replicationFile.leafName}`);
}
/**
* Clean up depending on whether replication succeeded or failed, emit
* STATE_STOP event.
*
* @param {bool} success - Replication succeeded or failed.
*/
async _done(success) {
this._cards = [];
if (this._replicationDB) {
// Close the db.
await this._replicationDB.cleanUp();
}
if (success) {
// Replace the old db file with new db file.
this._replicationFile.moveTo(null, this._oldReplicationFileName);
} else if (
this._replicationFile &&
this._replicationFile.path != this._oldReplicationFileName
) {
this._replicationFile.remove(false);
}
if (this._oldReplicationFileName) {
// Reset replicationFileName to the old db file name.
this._directory.replicationFileName = this._oldReplicationFileName;
}
this._listener.onStateChange(
null,
null,
Ci.nsIWebProgressListener.STATE_STOP,
success ? Cr.NS_OK : Cr.NS_ERROR_FAILURE
);
}
}
LDAPReplicationService.prototype.classID = Components.ID(
"{dbe204e8-ae09-11eb-b4c8-a7e4b3e6e82e}"
);