From c4c059446b37aa910df53bbaa77f47f26bbb02b7 Mon Sep 17 00:00:00 2001 From: hiranyakavishani Date: Wed, 13 Mar 2024 09:34:48 +0530 Subject: [PATCH] Fixing applicationMap is not updating when application owner change --- .../org/wso2/carbon/apimgt/impl/APIConsumerImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java index 43a06d16ea42..a02cea4a885a 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java @@ -2977,6 +2977,16 @@ public boolean updateApplicationOwner(String userId, String organization, Applic } isAppUpdated = apiMgtDAO.updateApplicationOwner(userId, application); + + if (isAppUpdated) { + String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId); + ApplicationEvent applicationEvent = new ApplicationEvent(UUID.randomUUID().toString(), + System.currentTimeMillis(), APIConstants.EventType.APPLICATION_UPDATE.name(), tenantId, + tenantDomain, application.getId(), application.getUUID(), application.getName(), + application.getTokenType(), application.getTier(), application.getGroupId(), + application.getApplicationAttributes(), userId); + APIUtil.sendNotification(applicationEvent, APIConstants.NotifierType.APPLICATION.name()); + } return isAppUpdated; }