weizhouapache commented on code in PR #7915:
URL: https://github.com/apache/cloudstack/pull/7915#discussion_r1307318745


##########
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java:
##########
@@ -125,10 +134,28 @@ public void onPublishMessage(String senderAddress, String 
subject, Object args)
                 }
             }
         });
-
-        return true;
     }
 
+    private void addDomainRemovalListener() {
+        messageBus.subscribe(DomainManager.MESSAGE_REMOVE_DOMAIN_EVENT, new 
MessageSubscriber() {
+            @Override
+            public void onPublishMessage(String senderAddress, String subject, 
Object args) {
+                try {
+                    final Domain domain = 
domainDao.findByIdIncludingRemoved((Long) args);
+                    long domainId = domain.getId();
+                    LdapTrustMapVO ldapTrustMapVO = 
_ldapTrustMapDao.findByDomainId(domainId);

Review Comment:
   @DaanHoogland 
   do you mean the record is for a domain, not  accounts ? so for each domain, 
there is at most 1 record 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to