You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/10/29 17:44:58 UTC

git commit: adding docs

Repository: incubator-usergrid
Updated Branches:
  refs/heads/pushy_4-0 78e34b2bf -> 955a92bc4


adding docs


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

Branch: refs/heads/pushy_4-0
Commit: 955a92bc4d29a652f5398e980ac2322095f44577
Parents: 78e34b2
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Oct 29 10:44:39 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Oct 29 10:44:39 2014 -0600

----------------------------------------------------------------------
 .../services/notifications/ProviderAdapter.java | 30 ++++++++++++++++++++
 .../notifications/apns/APNsAdapter.java         | 25 ++++++++--------
 2 files changed, 43 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/955a92bc/stack/services/src/main/java/org/apache/usergrid/services/notifications/ProviderAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ProviderAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ProviderAdapter.java
index 8acd006..1783882 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ProviderAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ProviderAdapter.java
@@ -34,8 +34,20 @@ import org.apache.usergrid.services.ServicePayload;
  */
 public interface ProviderAdapter {
 
+    /**
+     * test the connection
+     * @throws ConnectionException
+     */
     public void testConnection() throws ConnectionException;
 
+    /**
+     * send a notification
+     * @param providerId
+     * @param payload
+     * @param notification
+     * @param tracker
+     * @throws Exception
+     */
     public void sendNotification(String providerId,  Object payload, Notification notification, TaskTracker tracker)
             throws Exception;
 
@@ -45,12 +57,30 @@ public interface ProviderAdapter {
      */
     public void doneSendingNotifications() throws Exception;
 
+    /**
+     * remove inactive devices
+     * @throws Exception
+     */
     public void removeInactiveDevices() throws Exception;
 
+    /**
+     * translate payload for each notifier
+     * @param payload
+     * @return
+     * @throws Exception
+     */
     public Object translatePayload(Object payload) throws Exception;
 
+    /**
+     * Validate payload from services
+     * @param payload
+     * @throws Exception
+     */
     public void validateCreateNotifier(ServicePayload payload) throws Exception;
 
+    /**
+     * stop the adapter when you are done, so it can quit processing notifications
+     */
     public void stop();
 
     public Notifier getNotifier();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/955a92bc/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
index da5d3e5..79a3b9e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
@@ -187,22 +187,23 @@ public class APNsAdapter implements ProviderAdapter {
     }
 
     @Override
-    public void stop(){
-            try {
-                if (!pushManager.isShutDown()) {
-                    List<SimpleApnsPushNotification> notifications = pushManager.shutdown(3000);
-                    for (SimpleApnsPushNotification notification1 : notifications) {
-                        try {
-                            ((APNsNotification) notification1).messageSendFailed(new Exception("Cache Expired: Shutting down sender"));
-                        }catch (Exception e){
-                            logger.error("Failed to mark notification",e);
-                        }
+    public void stop() {
+        try {
+            if (!pushManager.isShutDown()) {
+                List<SimpleApnsPushNotification> notifications = pushManager.shutdown(3000);
+                for (SimpleApnsPushNotification notification1 : notifications) {
+                    try {
+                        ((APNsNotification) notification1).messageSendFailed(new Exception("Cache Expired: Shutting down sender"));
+                    } catch (Exception e) {
+                        logger.error("Failed to mark notification", e);
                     }
                 }
-            } catch (Exception ie) {
-                logger.error("Failed to shutdown from cache", ie);
             }
+        } catch (Exception ie) {
+            logger.error("Failed to shutdown from cache", ie);
+        }
     }
+
     @Override
     public Notifier getNotifier(){return notifier;}