From b2d344bad736a1b226c080dfa4d4d172dcf4a6bc Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 30 Nov 2015 16:55:45 +0530 Subject: [PATCH] Added a method to reset the tenant config cache. --- .../carbon/device/mgt/mobile/impl/android/gcm/GCMService.java | 4 ++++ .../carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMService.java index 2113dd062f..f3ed7b8b3d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMService.java @@ -57,4 +57,8 @@ public class GCMService { log.error("Exception occurred while sending the GCM notification : " + result.getErrorMsg()); } } + + public void resetTenantConfigCache() { + GCMUtil.resetTenantConfigCache(); + } } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java index ce08d896d5..12db04ec50 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java @@ -177,6 +177,10 @@ public class GCMUtil { return null; } + public static void resetTenantConfigCache() { + tenantConfigurationCache.remove(getTenantId()); + } + private static void addTenantConfigurationToCache(TenantConfiguration tenantConfiguration) { tenantConfigurationCache.put(getTenantId(), tenantConfiguration); }