usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [38/52] [abbrv] usergrid git commit: Clear an app's push manager queue cache when notifiers are added ( current notifiers are stored as a hash map within the class instance).
Date Mon, 23 May 2016 14:17:21 GMT
Clear an app's push manager queue cache when notifiers are added ( current notifiers are stored
as a hash map within the class instance).


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1284db76
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1284db76
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1284db76

Branch: refs/heads/asf-site
Commit: 1284db7670c42bcc20ac397e3b24d8ddd17c1e92
Parents: d16f4c1
Author: Michael Russo <mrusso@apigee.com>
Authored: Sat Apr 30 20:38:35 2016 +0800
Committer: Michael Russo <mrusso@apigee.com>
Committed: Sat Apr 30 20:38:35 2016 +0800

----------------------------------------------------------------------
 .../apache/usergrid/services/notifiers/NotifiersService.java   | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/1284db76/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
index 54a9dc4..cd5ca20 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
@@ -16,7 +16,9 @@
  */
 package org.apache.usergrid.services.notifiers;
 
+import com.google.inject.Injector;
 import org.apache.usergrid.persistence.entities.Notifier;
+import org.apache.usergrid.services.notifications.ApplicationQueueManagerCache;
 import org.apache.usergrid.services.notifications.ProviderAdapterFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -54,6 +56,10 @@ public class NotifiersService extends AbstractCollectionService {
                 providerAdapter.validateCreateNotifier(payload);
                 NotificationsService ns = (NotificationsService) sm.getService("notifications");
                 ns.testConnection(notifier);
+
+                // clear the app's push manager cache when notifiers are added
+                ns.getApplicationContext().getBean(Injector.class)
+                    .getInstance(ApplicationQueueManagerCache.class).invalidate(em.getApplicationId());
             } catch (Exception e) {
                 logger.info("notifier testConnection() failed", e);
                 em.delete(notifier);


Mime
View raw message