You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/06/02 17:07:58 UTC
[40/54] [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).
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/apm
Commit: 1284db7670c42bcc20ac397e3b24d8ddd17c1e92
Parents: d16f4c1
Author: Michael Russo <mr...@apigee.com>
Authored: Sat Apr 30 20:38:35 2016 +0800
Committer: Michael Russo <mr...@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);