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:19 UTC

[01/54] [abbrv] usergrid git commit: Initial commit for new JavaSDK.

Repository: usergrid
Updated Branches:
  refs/heads/apm 1684a64e4 -> 28cad0117


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestUtils.java b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestUtils.java
new file mode 100644
index 0000000..fc5a039
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestUtils.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class SDKTestUtils {
+
+
+    public static Map<String, UsergridEntity> createColorShapes(String collection) {
+
+        Map<String, Map<String, String>> entityMap = new HashMap<>(7);
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+        fields.put("shape", "square");
+
+        entityMap.put("redsquare", fields);
+
+        fields = new HashMap<>(3);
+        fields.put("color", "blue");
+        fields.put("shape", "circle");
+
+        entityMap.put("bluecircle", fields);
+
+        fields = new HashMap<>(3);
+        fields.put("color", "yellow");
+        fields.put("shape", "triangle");
+
+        entityMap.put("yellowtriangle", fields);
+
+        return createEntities(collection, entityMap);
+    }
+
+    public static Map<String, UsergridEntity> createEntities(final String collection,
+                                                             final Map<String, Map<String, String>> entities) {
+
+        Map<String, UsergridEntity> entityMap = new HashMap<>();
+
+        for (Map.Entry<String, Map<String, String>> entity : entities.entrySet()) {
+
+            UsergridEntity e = createEntity(collection, entity.getKey(), entity.getValue());
+            entityMap.put(e.getUuid(), e);
+        }
+
+        return entityMap;
+    }
+
+    public static UsergridEntity createEntity(final String collection,
+                                              final String name,
+                                              final Map<String, String> fields) {
+
+        UsergridEntity e = new UsergridEntity(collection, name);
+
+        if( fields != null ) {
+            for (Map.Entry<String, String> field : fields.entrySet()) {
+                e.putProperty(field.getKey(), field.getValue());
+            }
+        }
+
+        UsergridResponse r = Usergrid.getInstance().POST(e);
+
+        if (r.getResponseError() != null) {
+            assertTrue("UUID should not be null", e.getUuid() != null);
+            if( fields != null ) {
+                for (Map.Entry<String, String> field : fields.entrySet()) {
+                    assertEquals("attempted to set a property which did not persist on the entity", e.getStringProperty(field.getKey()),field.getValue());
+                }
+            }
+        }
+
+        return r.first();
+    }
+
+    public static void sleep(long millis) {
+        try {
+            Thread.sleep(millis);
+        } catch (InterruptedException ignore) {
+            ignore.printStackTrace();
+        }
+    }
+
+    public static void indexSleep() {
+        sleep(1000);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/UsergridClientAuthTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridClientAuthTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridClientAuthTestCase.java
new file mode 100644
index 0000000..82ca3c9
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridClientAuthTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridClient;
+import org.apache.usergrid.java.client.UsergridEnums;
+import org.apache.usergrid.java.client.UsergridRequest;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.model.UsergridUser;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Test;
+
+import java.util.List;
+
+public class UsergridClientAuthTestCase {
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void clientAppInit() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        Usergrid.authenticateApp(new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET));
+
+        //should fall back to using no authentication when currentUser is not authenticated and authFallback is set to NONE
+        UsergridClient client = Usergrid.getInstance();
+//        client.config.authMode = UsergridEnums.UsergridAuthMode.NONE;
+
+        String[] segments = {client.getOrgId(), client.getAppId(), "users"};
+        UsergridRequest request = new UsergridRequest(UsergridEnums.UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE,
+                client.getBaseUrl(), null, null, null, null, client.authForRequests(), segments);
+        client.sendRequest(request);
+    }
+
+    @Test
+    public void clientUserInit() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL);
+        Usergrid.authenticateUser(new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password));
+        UsergridResponse getResponse = Usergrid.GET("user","eb8145ea-e171-11e5-a5e5-2bc0953f9fe6");
+        if( getResponse.getEntities() != null ) {
+            UsergridEntity entity = getResponse.first();
+            if( entity instanceof UsergridUser) {
+                UsergridUser user = (UsergridUser) entity;
+                System.out.print(user.toString());
+            }
+            List<UsergridUser> users = getResponse.users();
+            if( users != null ) {
+                System.out.print(users.get(0).toString());
+            }
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/UsergridInitTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridInitTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridInitTestCase.java
new file mode 100644
index 0000000..980a3e7
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridInitTestCase.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridClient;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.junit.After;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
+public class UsergridInitTestCase {
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void testInitAppUsergrid() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL);
+        Usergrid.authenticateApp(new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET));
+        assertTrue("usergrid should be an instance of usergrid client", Usergrid.getInstance().getClass() == UsergridClient.class);
+    }
+
+    @Test
+    public void testInitUserUsergrid() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL);
+        Usergrid.authenticateUser(new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password));
+        assertTrue("usergrid should be an instance of usergrid client", Usergrid.getInstance().getClass() == UsergridClient.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java
new file mode 100644
index 0000000..3533805
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+public class UsergridResponseErrorTestCase {
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        UsergridAppAuth appAuth = new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET);
+        Usergrid.authenticateApp(appAuth);
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void testEntityCreationSuccess() {
+        String collectionName = "ect" + System.currentTimeMillis();
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+        fields.put("shape", "square");
+
+        SDKTestUtils.createEntity(collectionName, "testEntity1", fields);
+        UsergridResponse eLookUp = Usergrid.GET(collectionName, "testEntity1");
+        assertNull("The returned entity is null!", eLookUp.getResponseError());
+
+        UsergridResponse response = Usergrid.GET(collectionName, "testEntityThatShouldNotExist");
+        assertFalse("Response returned should not be ok.",response.ok());
+        assertTrue("StatusCode equals than 404", response.getStatusCode() == 404);
+        assertNotNull("The returned entity is null!", response.getResponseError());
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java
new file mode 100644
index 0000000..e158d85
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridEnums;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+public class UsergridResponseTestCase {
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, UsergridEnums.UsergridAuthMode.USER);
+        Usergrid.authenticateUser(new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password));
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void testLogoutUser() {
+        String collectionName = "ect" + System.currentTimeMillis();
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+        fields.put("shape", "square");
+
+        SDKTestUtils.createEntity(collectionName, "testEntity1", fields);
+        UsergridResponse response = Usergrid.GET(collectionName, "testEntity1");
+        Object instanceObj = response.getStatusCode();
+        assertTrue("The returned statusCode is and object of integer", instanceObj instanceof Integer);
+        instanceObj = response.ok();
+        assertTrue("The returned statusCode is and object of boolean", instanceObj instanceof Boolean);
+
+        UsergridResponse resp = Usergrid.logoutUser(SDKTestConfiguration.APP_UserName,null);
+
+        response = Usergrid.GET(collectionName, "testEntity1");
+        assertNotNull("The response should throw an error",response.getResponseError());
+    }
+
+    @Test
+    public void testLogoutCurrentUser() {
+        String collectionName = "ect" + System.currentTimeMillis();
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+        fields.put("shape", "square");
+
+        SDKTestUtils.createEntity(collectionName, "testEntity12", fields);
+        UsergridResponse response = Usergrid.GET(collectionName, "testEntity12");
+        assertNull("The response should not throw an error",response.getResponseError());
+
+        Usergrid.logoutCurrentUser();
+        response = Usergrid.GET(collectionName, "testEntity1");
+        assertNotNull("The response should throw an error",response.getResponseError());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java
new file mode 100644
index 0000000..5e1ab3a
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UsergridTestCase {
+
+    @Test
+    public void initialize() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL);
+    }
+}


[42/54] [abbrv] usergrid git commit: Add more info to the log statement when we can't load an application.

Posted by mr...@apache.org.
Add more info to the log statement when we can't load an application.


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

Branch: refs/heads/apm
Commit: f4c8a01cd6854be70f4561926bc73d2d107bd88a
Parents: 46cd401
Author: Michael Russo <mr...@apigee.com>
Authored: Sat Apr 30 21:50:05 2016 +0800
Committer: Michael Russo <mr...@apigee.com>
Committed: Sat Apr 30 21:50:05 2016 +0800

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/ApplicationIdCacheImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f4c8a01c/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
index 7403c81..d327607 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
@@ -81,7 +81,7 @@ public class ApplicationIdCacheImpl implements ApplicationIdCache {
             return appCache.get( applicationName.toLowerCase() );
         } catch (Exception e) {
             if (logger.isDebugEnabled()) {
-                logger.debug("Returning for key {} value null", applicationName);
+                logger.debug("Returning for key {} value null due to exception: {}", applicationName, e);
             }
             return null;
         }


[18/54] [abbrv] usergrid git commit: Invalidate ShiroCache when admin user added to org.

Posted by mr...@apache.org.
Invalidate ShiroCache when admin user added to org.


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

Branch: refs/heads/apm
Commit: 4aa73aa49f72ee578d4ec5a9a8f98bdc6be0b739
Parents: 6488b05
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Apr 20 14:43:06 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Apr 20 14:43:06 2016 -0400

----------------------------------------------------------------------
 .../cassandra/ManagementServiceImpl.java        | 93 ++++++++++----------
 1 file changed, 48 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/4aa73aa4/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index a586c26..73a56c8 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -17,7 +17,6 @@
 package org.apache.usergrid.management.cassandra;
 
 
-import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
@@ -88,6 +87,8 @@ import static org.apache.commons.codec.digest.DigestUtils.sha;
 import static org.apache.commons.lang.StringUtils.isBlank;
 import static org.apache.usergrid.locking.LockHelper.getUniqueUpdateLock;
 import static org.apache.usergrid.management.AccountCreationProps.*;
+import static org.apache.usergrid.management.OrganizationConfigProps.ORGPROPERTIES_ADMIN_SYSADMIN_EMAIL;
+import static org.apache.usergrid.management.OrganizationConfigProps.WorkflowUrl;
 import static org.apache.usergrid.persistence.CredentialsInfo.getCredentialsSecret;
 import static org.apache.usergrid.persistence.Schema.*;
 import static org.apache.usergrid.persistence.Schema.PROPERTY_UUID;
@@ -107,7 +108,6 @@ import static org.apache.usergrid.utils.ConversionUtils.uuid;
 import static org.apache.usergrid.utils.ListUtils.anyNull;
 import static org.apache.usergrid.utils.MapUtils.hashMap;
 import static org.apache.usergrid.utils.PasswordUtils.mongoPassword;
-import static org.apache.usergrid.management.OrganizationConfigProps.*;
 
 
 public class ManagementServiceImpl implements ManagementService {
@@ -173,6 +173,37 @@ public class ManagementServiceImpl implements ManagementService {
     protected LocalShiroCache localShiroCache;
 
 
+    private LoadingCache<UUID, OrganizationConfig> orgConfigByAppCache = CacheBuilder.newBuilder().maximumSize( 1000 )
+        .expireAfterWrite( Long.valueOf( System.getProperty(ORG_CONFIG_CACHE_PROP, "30000") ) , TimeUnit.MILLISECONDS)
+        .build( new CacheLoader<UUID, OrganizationConfig>() {
+            public OrganizationConfig load( UUID applicationInfoId ) {
+
+                try {
+
+                    if (applicationInfoId != null && applicationInfoId != CpNamingUtils.MANAGEMENT_APPLICATION_ID) {
+
+                        final EntityManager em = emf.getEntityManager(smf.getManagementAppId());
+
+                        Results r = em.getSourceEntities(
+                            new SimpleEntityRef(CpNamingUtils.APPLICATION_INFO, applicationInfoId),
+                            ORG_APP_RELATIONSHIP, Group.ENTITY_TYPE, Level.ALL_PROPERTIES);
+
+                        Group org = (Group) r.getEntity();
+                        if (org != null) {
+                            Map<Object, Object> entityProperties = em.getDictionaryAsMap(org, ORGANIZATION_CONFIG_DICTIONARY);
+                            return new OrganizationConfig(orgConfigProperties, org.getUuid(), org.getPath(), entityProperties, false);
+                        }
+                    }
+
+                    return new OrganizationConfig(orgConfigProperties);
+
+                } catch (Exception e) {
+                    return new OrganizationConfig(orgConfigProperties);
+                }
+            }}
+        );
+
+
 
     /** Must be constructed with a CassandraClientPool. */
     public ManagementServiceImpl(Injector injector) {
@@ -1678,6 +1709,8 @@ public class ManagementServiceImpl implements ManagementService {
         em.addToCollection(new SimpleEntityRef(Group.ENTITY_TYPE, organization.getUuid()), "users",
             new SimpleEntityRef(User.ENTITY_TYPE, user.getUuid()));
 
+        invalidateManagementAppAuthCache();
+
         if ( email ) {
             sendAdminUserInvitedEmail( user, organization );
         }
@@ -1713,6 +1746,8 @@ public class ManagementServiceImpl implements ManagementService {
 
         em.removeFromCollection(new SimpleEntityRef(Group.ENTITY_TYPE, organizationId), "users",
             new SimpleEntityRef(User.ENTITY_TYPE, userId));
+
+        invalidateManagementAppAuthCache();
     }
 
 
@@ -1773,15 +1808,13 @@ public class ManagementServiceImpl implements ManagementService {
                     + ")</a> created a new application named " + applicationName, null );
         }
 
-        ScopedCache scopedCache = cacheFactory.getScopedCache(
-            new CacheScope( new SimpleId( CpNamingUtils.MANAGEMENT_APPLICATION_ID, "application" )));
-        scopedCache.invalidate();
-        localShiroCache.invalidateAll();
+        invalidateManagementAppAuthCache();
 
         return new ApplicationInfo( applicationId, appInfo.getName() );
     }
 
 
+
     @Override
     public void deleteApplication(UUID applicationId) throws Exception {
         emf.deleteApplication( applicationId );
@@ -1835,10 +1868,7 @@ public class ManagementServiceImpl implements ManagementService {
                     + ")</a> restored an application named " + appInfo.getName(), null );
         }
 
-        ScopedCache scopedCache = cacheFactory.getScopedCache(
-            new CacheScope( new SimpleId( CpNamingUtils.MANAGEMENT_APPLICATION_ID, "application" )));
-        scopedCache.invalidate();
-        localShiroCache.invalidateAll();
+        invalidateManagementAppAuthCache();
 
         return new ApplicationInfo( applicationId, appInfo.getName() );
     }
@@ -2274,6 +2304,8 @@ public class ManagementServiceImpl implements ManagementService {
     public void activateAdminUser( UUID userId ) throws Exception {
         EntityManager em = emf.getEntityManager( smf.getManagementAppId() );
         em.setProperty( new SimpleEntityRef( User.ENTITY_TYPE, userId ), "activated", true );
+
+        invalidateManagementAppAuthCache();
     }
 
 
@@ -3424,39 +3456,10 @@ public class ManagementServiceImpl implements ManagementService {
     }
 
 
-    private LoadingCache<UUID, OrganizationConfig> orgConfigByAppCache =
-        CacheBuilder.newBuilder().maximumSize( 1000 )
-            .expireAfterWrite( Long.valueOf( System.getProperty(ORG_CONFIG_CACHE_PROP, "30000") ) , TimeUnit.MILLISECONDS)
-            .build( new CacheLoader<UUID, OrganizationConfig>() {
-                public OrganizationConfig load( UUID applicationInfoId ) {
-
-                    try {
-
-                        if (applicationInfoId != null && applicationInfoId != CpNamingUtils.MANAGEMENT_APPLICATION_ID) {
-
-                            final EntityManager em = emf.getEntityManager(smf.getManagementAppId());
-
-                            Results r = em.getSourceEntities(
-                                new SimpleEntityRef(CpNamingUtils.APPLICATION_INFO, applicationInfoId),
-                                ORG_APP_RELATIONSHIP, Group.ENTITY_TYPE, Level.ALL_PROPERTIES);
-
-                            Group org = (Group) r.getEntity();
-
-                            if (org != null) {
-                                Map<Object, Object> entityProperties = em.getDictionaryAsMap(org, ORGANIZATION_CONFIG_DICTIONARY);
-                                return new OrganizationConfig(orgConfigProperties, org.getUuid(), org.getPath(), entityProperties, false);
-                            }
-
-                        }
-
-                        return new OrganizationConfig(orgConfigProperties);
-
-                    }catch (Exception e){
-
-                        return new OrganizationConfig(orgConfigProperties);
-
-                    }
-                }}
-            );
-
+    private void invalidateManagementAppAuthCache() {
+        ScopedCache scopedCache = cacheFactory.getScopedCache(
+            new CacheScope( new SimpleId( CpNamingUtils.MANAGEMENT_APPLICATION_ID, "application" )));
+        scopedCache.invalidate();
+        localShiroCache.invalidateAll();
+    }
 }


[44/54] [abbrv] usergrid git commit: Fixed name of UsergridUser.getPicture() and fixed a constructor of UsergridRequest.

Posted by mr...@apache.org.
Fixed name of UsergridUser.getPicture() and fixed a constructor of UsergridRequest.


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

Branch: refs/heads/apm
Commit: f0829ac76b254a9d6ae79128dddf42233e0b57e5
Parents: 5871497
Author: Robert Walsh <rj...@gmail.com>
Authored: Tue May 10 17:26:36 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Tue May 10 17:26:36 2016 -0500

----------------------------------------------------------------------
 .../java/org/apache/usergrid/java/client/UsergridRequest.java | 7 ++++---
 .../org/apache/usergrid/java/client/model/UsergridUser.java   | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f0829ac7/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
index 77ee148..6939eb2 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
@@ -140,6 +140,7 @@ public class UsergridRequest {
         this.data = data;
         this.headers = headers;
         this.query = query;
+        this.auth = auth;
         this.pathSegments = pathSegments;
     }
 
@@ -153,7 +154,7 @@ public class UsergridRequest {
     }
 
     @NotNull
-    private HttpUrl constructUrl() {
+    protected HttpUrl constructUrl() {
         String url = this.baseUrl;
         if( this.query != null ) {
             url += this.query.build();
@@ -172,7 +173,7 @@ public class UsergridRequest {
         return urlBuilder.build();
     }
 
-    private void addHeaders(@NotNull final Request.Builder requestBuilder) {
+    protected void addHeaders(@NotNull final Request.Builder requestBuilder) {
         requestBuilder.addHeader("User-Agent", UsergridRequestManager.USERGRID_USER_AGENT);
         if (this.auth != null ) {
             String accessToken = this.auth.getAccessToken();
@@ -188,7 +189,7 @@ public class UsergridRequest {
     }
 
     @Nullable
-    private RequestBody constructRequestBody() {
+    protected RequestBody constructRequestBody() {
         RequestBody requestBody = null;
         if (method == UsergridHttpMethod.POST || method == UsergridHttpMethod.PUT) {
             String jsonString = "";

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f0829ac7/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
index 4092a21..9a5bd86 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
@@ -76,7 +76,7 @@ public class UsergridUser extends UsergridEntity {
     @Nullable public String getPassword() { return this.password; }
     public void setPassword(@Nullable final String password) { this.password = password; }
 
-    @Nullable public String setPicture() { return this.picture; }
+    @Nullable public String getPicture() { return this.picture; }
     public void setPicture(@Nullable final String picture) { this.picture = picture; }
 
     public boolean isActivated() { return this.activated; }


[20/54] [abbrv] usergrid git commit: Merge remote-tracking branch 'snoopdave/release-2.1.1' into release-2.1.1

Posted by mr...@apache.org.
Merge remote-tracking branch 'snoopdave/release-2.1.1' into release-2.1.1


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

Branch: refs/heads/apm
Commit: 9553d4479987f2a62bb1612507418125c1b7f862
Parents: f272af2 4aa73aa
Author: George Reyes <gr...@apache.org>
Authored: Wed Apr 20 13:17:21 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Wed Apr 20 13:17:21 2016 -0700

----------------------------------------------------------------------
 .../cassandra/ManagementServiceImpl.java        | 93 ++++++++++----------
 1 file changed, 48 insertions(+), 45 deletions(-)
----------------------------------------------------------------------



[26/54] [abbrv] usergrid git commit: Fix scheduler.

Posted by mr...@apache.org.
Fix scheduler.


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

Branch: refs/heads/apm
Commit: 938bef0d02c6f029319e4ea1632c13c7bf74a447
Parents: df9abc4
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 18:24:59 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 18:24:59 2016 -0700

----------------------------------------------------------------------
 .../impl/ApplicationQueueManagerImpl.java          | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/938bef0d/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 778307c..4b2612f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -29,6 +29,7 @@ import org.apache.usergrid.services.notifications.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import rx.Observable;
+import rx.Scheduler;
 import rx.Subscriber;
 import rx.functions.Func1;
 import rx.schedulers.Schedulers;
@@ -62,7 +63,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
 
 
-    //private final ExecutorService asyncExecutor;
+    private final Scheduler scheduler;
 
 
 
@@ -78,7 +79,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         this.queueMeter = metricsFactory.getMeter(ApplicationQueueManagerImpl.class, "notification.queue");
         this.sendMeter = metricsFactory.getMeter(NotificationsService.class, "queue.send");
 
-        /**
+
         int maxAsyncThreads;
         int workerQueueSize;
 
@@ -99,11 +100,11 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
 
         // create our own executor which has a bounded queue w/ caller runs policy for rejected tasks
-        this.asyncExecutor = TaskExecutorFactory
+        this.scheduler = Schedulers.from(TaskExecutorFactory
             .createTaskExecutor( "push-device-io", maxAsyncThreads, workerQueueSize,
-                TaskExecutorFactory.RejectionAction.CALLERRUNS );
+                TaskExecutorFactory.RejectionAction.CALLERRUNS ));
+
 
-        **/
     }
 
     private boolean scheduleQueueJob(Notification notification) throws Exception {
@@ -306,7 +307,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                         })
                         .map(sendMessageFunction)
-                        .subscribeOn(Schedulers.io());
+                        .subscribeOn(scheduler);
 
                 }, concurrencyFactor)
                 .distinct( queueMessage -> {
@@ -314,7 +315,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                     if(queueMessage.isPresent()) {
                         return queueMessage.get().getNotificationId();
                     }
-                    
+
                     return queueMessage; // this will always be distinct, default handling for the Optional.empty() case
 
                 } )
@@ -372,7 +373,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                 });
 
-            processMessagesObservable.subscribeOn(Schedulers.io()).subscribe(); // fire the queuing into the background
+            processMessagesObservable.subscribeOn(scheduler).subscribe(); // fire the queuing into the background
 
         }
 


[24/54] [abbrv] usergrid git commit: Merge commit 'refs/pull/511/head' of github.com:apache/usergrid into release-2.1.1

Posted by mr...@apache.org.
Merge commit 'refs/pull/511/head' of github.com:apache/usergrid into release-2.1.1


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

Branch: refs/heads/apm
Commit: 81eb25158b517f82e8966649aa014a47194f5d74
Parents: 158b5de 7a08296
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 16:19:29 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 16:19:29 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/TaskManager.java     | 25 +++++++
 .../gcm/NotificationsServiceIT.java             | 77 ++++++++++++++++++++
 2 files changed, 102 insertions(+)
----------------------------------------------------------------------



[17/54] [abbrv] usergrid git commit: Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1

Posted by mr...@apache.org.
Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1


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

Branch: refs/heads/apm
Commit: 6488b05fb09cce74872169ce497f7a4613be8f13
Parents: 2d2435f d069185
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Apr 20 11:03:13 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Apr 20 11:03:13 2016 -0400

----------------------------------------------------------------------
 stack/pom.xml                                   |  2 +-
 .../services/notifications/gcm/GCMAdapter.java  | 12 +++-----
 .../gcm/NotificationsServiceIT.java             | 32 ++++++++++++++++++++
 3 files changed, 37 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[48/54] [abbrv] usergrid git commit: Removing .bash_profile and making sure the jar is up to date.

Posted by mr...@apache.org.
Removing .bash_profile and making sure the jar is up to date.


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

Branch: refs/heads/apm
Commit: 07d5ee2cea4efe6da26de0dc42330cf16aca8407
Parents: 9cccc90
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu May 19 11:57:36 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu May 19 11:57:36 2016 -0500

----------------------------------------------------------------------
 sdks/java/.bash_profile                  |   1 -
 sdks/java/usergrid-java-client-2.1.0.jar | Bin 1992239 -> 1992232 bytes
 2 files changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/07d5ee2c/sdks/java/.bash_profile
----------------------------------------------------------------------
diff --git a/sdks/java/.bash_profile b/sdks/java/.bash_profile
deleted file mode 100644
index 7a3d262..0000000
--- a/sdks/java/.bash_profile
+++ /dev/null
@@ -1 +0,0 @@
-export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home

http://git-wip-us.apache.org/repos/asf/usergrid/blob/07d5ee2c/sdks/java/usergrid-java-client-2.1.0.jar
----------------------------------------------------------------------
diff --git a/sdks/java/usergrid-java-client-2.1.0.jar b/sdks/java/usergrid-java-client-2.1.0.jar
index 733839e..fa90a59 100644
Binary files a/sdks/java/usergrid-java-client-2.1.0.jar and b/sdks/java/usergrid-java-client-2.1.0.jar differ


[16/54] [abbrv] usergrid git commit: Ensure that applicationId cache does not cache nulls.

Posted by mr...@apache.org.
Ensure that applicationId cache does not cache nulls.


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

Branch: refs/heads/apm
Commit: 2d2435fde5c8e9d4819b64af923f1d6ba96f4c61
Parents: 666c49e
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Apr 20 11:02:14 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Apr 20 11:02:14 2016 -0400

----------------------------------------------------------------------
 .../usergrid/corepersistence/ApplicationIdCacheImpl.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2d2435fd/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
index 7745359..7403c81 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
@@ -27,6 +27,7 @@ import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.exceptions.PersistenceException;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.StringField;
@@ -65,7 +66,11 @@ public class ApplicationIdCacheImpl implements ApplicationIdCache {
             .build(new CacheLoader<String, UUID>() {
                 @Override
                 public UUID load(final String key) throws Exception {
-                    return fetchApplicationId(key);
+                    UUID appId = fetchApplicationId(key);
+                    if ( appId == null ) {
+                        throw new PersistenceException("Error getting applicationId");
+                    }
+                    return appId;
                 }
             });
     }


[21/54] [abbrv] usergrid git commit: Added a test for counters that isn't correctly configured to work with other tests yet, and added the counters to the backend of notifications for further examination.

Posted by mr...@apache.org.
Added a test for counters that isn't correctly configured to work with other tests yet, and added the counters to the backend of notifications for further examination.


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

Branch: refs/heads/apm
Commit: 7a08296aed6776c50aebc886f1a24074e78d3b5d
Parents: 9553d44
Author: George Reyes <gr...@apache.org>
Authored: Wed Apr 20 15:50:39 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Wed Apr 20 15:50:39 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/TaskManager.java     | 25 +++++++
 .../gcm/NotificationsServiceIT.java             | 77 ++++++++++++++++++++
 2 files changed, 102 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/7a08296a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
index 531ca7c..e908c3b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
@@ -26,6 +26,8 @@ import org.apache.usergrid.persistence.entities.Receipt;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.time.Instant;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -54,7 +56,13 @@ public class TaskManager {
 
         successes.incrementAndGet();
 
+
         try {
+            //.{year}.{month}.{day}.{HH24} possibly minute.
+            //random date and time for format
+
+
+            incrementNotificationCounter( "completed" );
 
             EntityRef deviceRef = new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID);
 
@@ -91,6 +99,9 @@ public class TaskManager {
         failures.incrementAndGet();
 
         try {
+
+            incrementNotificationCounter( "failed" );
+
             if (logger.isDebugEnabled()) {
                 logger.debug("Notification {} for device {} got error {}", notification.getUuid(), deviceUUID, code);
             }
@@ -156,6 +167,20 @@ public class TaskManager {
         }
     }
 
+    public void incrementNotificationCounter(String status){
+        em.incrementAggregateCounters( null,null,null,"counters.notifications."+notification.getUuid()+"."+status,1 );
+
+        LocalDateTime localDateTime = LocalDateTime.now();
+        StringBuilder currentDate = new StringBuilder(  );
+        currentDate.append( "counters.notifications.aggregate."+status+"." );
+        currentDate.append( localDateTime.getYear()+"." );
+        currentDate.append( localDateTime.getMonth()+"." );
+        currentDate.append( localDateTime.getDayOfMonth()+"." );
+        currentDate.append( localDateTime.getMinute() );
+        em.incrementAggregateCounters( null,null,null,currentDate.toString(),1 );
+
+    }
+
 
     public void finishedBatch() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/7a08296a/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
index 77abb56..1a9f4f7 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
@@ -19,14 +19,19 @@ package org.apache.usergrid.services.notifications.gcm;
 import com.google.android.gcm.server.Constants;
 import com.google.android.gcm.server.InvalidRequestException;
 import net.jcip.annotations.NotThreadSafe;
+
+import org.apache.usergrid.ServiceApplication;
 import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.entities.*;
+import org.apache.usergrid.persistence.index.query.CounterResolution;
+import org.apache.usergrid.services.ServiceResults;
 import org.apache.usergrid.services.notifications.*;
 import org.junit.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.lang.reflect.Field;
+import java.time.LocalDateTime;
 import java.util.*;
 
 import org.apache.usergrid.services.ServiceAction;
@@ -304,6 +309,78 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         checkReceipts(notification, 1);
     }
 
+    @Ignore("turn this on and run individually when you want to verify. there is an issue with the aggregate counter, because of all the other tests"
+        + "AND, there is an issue with the batcher where we have to turn it up/down to see the results in time. ")
+    @Test
+    public void singlePushNotificationWithCounters() throws Exception {
+
+        long ts = System.currentTimeMillis() - ( 24 * 60 * 60 * 1000 );
+        app.clear();
+        String payload = "Hello, World!";
+        Map<String, String> payloads = new HashMap<String, String>(1);
+        payloads.put(notifier.getUuid().toString(), payload);
+        app.put("payloads", payloads);
+        app.put("queued", System.currentTimeMillis());
+        app.put("debug", false);
+        app.put("expire", System.currentTimeMillis() + 300000); // add 5 minutes to current time
+
+        Entity e = app.testRequest(ServiceAction.POST, 1, "devices", device1.getUuid(), "notifications").getEntity();
+        app.testRequest(ServiceAction.GET, 1, "notifications", e.getUuid());
+
+        Notification notification = app.getEntityManager().get(e.getUuid(), Notification.class);
+        assertEquals(
+            notification.getPayloads().get(notifier.getUuid().toString()),
+            payload);
+
+        // perform push //
+        notification = notificationWaitForComplete(notification);
+        //        checkReceipts(notification, 1);
+
+
+        verifyNotificationCounter( notification,"completed",ts,1 );
+        verifyNotificationCounter( notification,"failed",ts, 0 );
+
+
+
+
+    }
+
+    public void verifyNotificationCounter(Notification notification,String status,Long timestamp, int expected){
+
+        Results countersResults = app.getEntityManager().getAggregateCounters( null,null,null,"counters.notifications."+notification.getUuid()+"."+status,
+            CounterResolution.ALL,timestamp,System.currentTimeMillis(),false ) ;
+
+        assertEquals( 1, countersResults.getCounters().size() );
+        if(expected > 0) {
+            assertEquals( expected, countersResults.getCounters().get( 0 ).getValues().get( 0 ).getValue() );
+        }else if (expected == 0){
+            assertEquals( 0,countersResults.getCounters().get( 0 ).getValues().size());
+        }
+
+        LocalDateTime localDateTime = LocalDateTime.now();
+        StringBuilder currentDate = new StringBuilder(  );
+        currentDate.append( "counters.notifications.aggregate."+status+"." );
+        currentDate.append( localDateTime.getYear()+"." );
+        currentDate.append( localDateTime.getMonth()+"." );
+        currentDate.append( localDateTime.getDayOfMonth()); //+"." );
+
+        countersResults = app.getEntityManager().getAggregateCounters( null,null,null,currentDate.toString(),
+            CounterResolution.ALL,timestamp,System.currentTimeMillis(),false ) ;
+
+        //checks to see that it exists
+        assertEquals( 1, countersResults.getCounters().size() );
+        if(expected > 0) {
+            assertEquals( expected, countersResults.getCounters().get( 0 ).getValues().get( 0 ).getValue() );
+
+        }
+        else if (expected == 0){
+            assertEquals( 0,countersResults.getCounters().get( 0 ).getValues().size());
+        }
+
+    }
+
+
+
     @Test
     public void singlePushNotificationMultipleDevices() throws Exception {
 


[09/54] [abbrv] usergrid git commit: Updating ReadMe.

Posted by mr...@apache.org.
Updating ReadMe.


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

Branch: refs/heads/apm
Commit: 09dd7f69d40074137bd2115be2b2298cbfeaee4b
Parents: 960ada2
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu Apr 14 14:27:07 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu Apr 14 14:27:07 2016 -0500

----------------------------------------------------------------------
 sdks/java/README.md | 598 +++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 579 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/09dd7f69/sdks/java/README.md
----------------------------------------------------------------------
diff --git a/sdks/java/README.md b/sdks/java/README.md
index 7943c41..95e4d04 100644
--- a/sdks/java/README.md
+++ b/sdks/java/README.md
@@ -1,20 +1,580 @@
+# Usergrid Java SDK
 
-#Usergrid Java Client
-
-#License
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
+Usergrid SDK written for Java 
+
+## Initialization
+
+There are two different ways of initializing the Usergrid Java SDK: 
+
+1. The singleton pattern is both convenient and enables the developer to use a globally available and always-initialized instance of Usergrid. 
+
+```java
+Usergrid.initSharedInstance("orgId", "appId");
+```
+
+2. The Instance pattern enables the developer to manage instances of the Usergrid client independently and in an isolated fashion. The primary use-case for this is when an application connects to multiple Usergrid targets.
+
+```java
+UsergridClient client = new UsergridClient("orgId","appId");
+```
+
+_Note: Examples in this readme assume you are using the `Usergrid` shared instance. If you've implemented the instance pattern instead, simply replace `Usergrid` with your client instance variable._
+
+## RESTful operations
+
+When making any RESTful call, a `type` parameter (or `path`) is always required. Whether you specify this as an argument or in an object as a parameter is up to you.
+
+### GET
+
+- To get entities in a collection:
+
+```java
+UsergridResponse response = Usergrid.GET("collection");
+List<UsergridEntity> entities = response.getEntities();
+```
+
+- To get a specific entity in a collection by uuid or name:
+
+```java
+UsergridResponse response = Usergrid.GET("collection","<uuid-or-name>");
+UsergridEntity entities = response.entity();
+```
+
+- To get specific entities in a collection by passing a `UsergridQuery` object:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").gt("weight", 2.4)
+                                 	.contains("color", "bl*")
+                                 .not()
+                                 .eq("color", "blue")
+                                 .or()
+                                 .eq("color", "orange");
+	
+// this will build out the following query:
+// select * where weight > 2.4 and color contains 'bl*' and not color = 'blue' or color = 'orange'
+	
+UsergridResponse response = Usergrid.GET(query);
+List<UsergridEntity> entities = response.getEntities();
+```
+
+### POST and PUT
+
+POST and PUT requests both require a JSON body payload. You can pass either a Java object or a `UsergridEntity` instance. While the former works in principle, best practise is to use a `UsergridEntity` wherever practical. When an entity has a uuid or name property and already exists on the server, use a PUT request to update it. If it does not, use POST to create it.
+
+- To create a new entity in a collection (**POST**):
+
+```java
+HashMap<String,String> propertyMap = new HashMap<>();
+propertyMap.put("cuisine","pizza");
+UsergridEntity entity = new UsergridEntity("restaurant","Dino's Deep Dish", propertyMap);	
+Usergrid.POST(entity); // entity should now have a uuid property and be created
+	
+// you can also POST an array of entities:
+	
+HashMap<String,String> propertyMap = new HashMap<>();
+propertyMap.put("cuisine","pizza");
+
+ArrayList<UsergridEntity> entities = new ArrayList<>();
+entities.add(new UsergridEntity("restaurant","Dino's Deep Dish", propertyMap));
+entities.add(new UsergridEntity("restaurant","Pizza da Napoli", propertyMap));
+UsergridResponse response = Usergrid.POST(entities);
+List<UsergridEntity> responseEntities = response.getEntities(); // responseEntities should now contain now valid posted entities.
+```
+
+- To update an entity in a collection (**PUT**):
+
+```java
+HashMap<String,String> propertyMap = new HashMap<>();
+propertyMap.put("cuisine","pizza");
+UsergridEntity entity = new UsergridEntity("restaurant","Dino's Deep Dish", propertyMap);	
+UsergridResponse response = Usergrid.POST(entity);
+if( response.ok() ) {
+	entity.putProperty("owner","Mia Carrara");
+	Usergrid.PUT(entity); // entity now has the property 'owner'
+}
+	
+// or update a set of entities by passing a UsergridQuery object
+
+HashMap<String,String> propertiesToUpdate = new HashMap<>();
+propertiesToUpdate.put("cuisine","pizza");
+UsergridQuery query = new UsergridQuery("restaurants").eq("cuisine","italian");
+
+UsergridResponse response = Usergrid.PUT(query, propertiesToUpdate);
+	
+    /* the first 10 entities matching this query criteria will be updated:
+    e.g.:
+        [
+            {
+                "type": "restaurant",
+                "restaurant": "Il Tarazzo",
+                "cuisine": "italian",
+                "keywords": ["pasta"]
+            },
+            {
+                "type": "restaurant",
+                "restaurant": "Cono Sur Pizza & Pasta",
+                "cuisine": "italian",
+                "keywords": ["pasta"]
+            }
+        ]
+    */
+```
+
+### DELETE
+
+DELETE requests require either a specific entity or a `UsergridQuery` object to be passed as an argument.
+
+- To delete a specific entity in a collection by uuid or name:
+
+```java
+UsergridResponse response = Usergrid.DELETE("collection", "<uuid-or-name>"); // if successful, entity will now be deleted
+```
+
+- To specific entities in a collection to delete by passing a `UsergridQuery` object:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").or().eq("color","white");
+	
+// this will build out the following query:
+// select * where color = 'black' or color = 'white'
+	
+UsergridResponse response = Usergrid.DELETE(query); // the first 10 entities matching this query criteria will be deleted
+```
+
+## Entity operations and convenience methods
+
+`UsergridEntity` has a number of helper/convenience methods to make working with entities more convenient.
+
+### reload()
+
+Reloads the entity from the server:
+
+```java
+entity.reload(); // entity is now reloaded from the server
+```
+
+### save()
+
+Saves (or creates) the entity on the server:
+
+
+```java
+entity.putProperty("aNewProperty","A new value");
+entity.save(); // entity is now updated on the server
+```
+
+### remove()
+
+Deletes the entity from the server:
+
+```java
+entity.remove(); // entity is now deleted on the server and the local instance should be destroyed
+```
+
+## Authentication, current user, and auth-fallback
+
+### appAuth and authenticateApp()
+
+`Usergrid` can use the app client ID and secret that were passed upon initialization and automatically retrieve an app-level token for these credentials.
+
+```java
+Usergrid.setAppAuth(new UsergridAppAuth("<client-id>", "<client-secret>"));
+Usergrid.authenticateApp(); // Usergrid.appAuth is authenticated automatically when this call is successful
+```
+
+### currentUser, userAuth,  and authenticateUser()
+
+`Usergrid` has a special `currentUser` property. 
+
+By default, when calling `authenticateUser()`, `.currentUser` will be set to this user if the authentication flow is successful.
+
+```java
+UsergridUserAuth userAuth = new UsergridUserAuth("<username>","<password>");
+Usergrid.authenticateUser(userAuth); // Usergrid.currentUser is set to the authenticated user and the token is stored within that context
+```
+    
+If you want to utilize authenticateUser without setting as the current user, simply pass a `false` boolean value as the second parameter:
+
+```java
+UsergridUserAuth userAuth = new UsergridUserAuth("<username>","<password>");
+Usergrid.authenticateUser(userAuth,false); // user is authenticated but Usergrid.currentUser is not set.
+```
+
+### authMode
+
+Auth-mode defines what the client should pass in for the authorization header. 
+
+By default, `Usergrid.authMode` is set to `.User`, when a `Usergrid.currentUser` is present and authenticated, an API call will be performed using the token for the user. 
+
+If `Usergrid.authMode` is set to `.None`, all API calls will be performed unauthenticated. 
+
+If instead `Usergrid.authMode` is set to `.App`, the API call will instead be performed using client credentials, _if_ they're available (i.e. `authenticateApp()` was performed at some point). 
+
+### usingAuth()
+
+At times it is desireable to have complete, granular control over the authentication context of an API call. 
+
+To facilitate this, the passthrough function `.usingAuth()` allows you to pre-define the auth context of the next API call.
+
+```java
+// assume Usergrid.authMode = UsergridAuthMode.NONE.
+
+Map<String, String> permissionsMap = new HashMap<>();
+permissionsMap.put("permission","get,post,put,delete:/**");
+UsergridResponse response = Usergrid.usingAuth(Usergrid.getAppAuth()).POST("roles/guest/permissions",permissionsMap);
+
+// here we've temporarily used the client credentials to modify permissions
+// subsequent calls will not use this auth context
+```
+
+## User operations and convenience methods
+
+`UsergridUser` has a number of helper/convenience methods to make working with user entities more convenient. If you are _not_ utilizing the `Usergrid` shared instance, you must pass an instance of `UsergridClient` as the first argument to any of these helper methods.
+    
+### create()
+
+Creating a new user:
+
+```java
+UsergridUser user = new UsergridUser("username","password");
+user.create(); // user has now been created and should have a valid uuid
+```
+
+### login()
+
+A simpler means of retrieving a user-level token:
+
+```java
+user.login("username","password"); // user is now logged in
+```
+
+### logout()
+
+Logs out the selected user. You can also use this convenience method on `Usergrid.currentUser`.
+
+```java
+user.logout(); // user is now logged out
+```
+
+### resetPassword()
+
+Resets the password for the selected user.
+
+```java
+// if it was done correctly, the new password will be changed
+user.resetPassword("oldPassword", "newPassword");
+```
+
+### UsergridUser.CheckAvailable()
+
+This is a class (static) method that allows you to check whether a username or email address is available or not.
+
+```java
+boolean available = UsergridUser.checkAvailable("email", null); // 'available' == whether an email already exists for a user
+
+available = UsergridUser.checkAvailable(null, "username"); // 'available' == whether an username already exists for a user
+
+available = UsergridUser.checkAvailable("email", "username"); // 'available' == whether an email or username already exist for a user
+```
+
+## Querying and filtering data
+
+### UsergridQuery initialization
+
+The `UsergridQuery` class allows you to build out complex query filters using the Usergrid [query syntax](http://docs.apigee.com/app-services/content/querying-your-data).
+
+The first parameter of the `UsergridQuery` builder pattern should be the collection (or type) you intend to query. You can either pass this as an argument, or as the first builder object:
+
+```java
+UsergridQuery query = new UsergridQuery("cats");
+// or
+UsergridQuery query = new UsergridQuery().collection("cats");
+```
+
+You then can layer on additional queries:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").gt("weight",2.4).contains("color","bl*")
+                                 .not()
+                                 .eq("color","white")
+                                 .or()
+                                 .eq("color","orange");
+```
+
+You can also adjust the number of results returned:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").limit(100);
+                                 
+// returns a maximum of 100 entities
+```
+
+And sort the results:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").limit(100).asc("name")
+                                 
+// sorts by 'name', ascending
+```
+
+And you can do geo-location queries:
+
+```java
+UsergridQuery query = new UsergridQuery("devices").locationWithin(<distance>, <lat>, <long>);
+```
+
+### Using a query in a request
+
+Queries can be passed as parameters to GET, PUT, and DELETE requests:
+
+```java
+// Gets entities matching the query.
+Usergrid.GET(query);
+
+// Updates the entities matching the query with the new property.
+Usergrid.PUT(query, Collections.singletonMap("aNewProperty","A new value"));
+
+// Deletes entities of a given type matching the query.
+Usergrid.DELETE(query);
+```
+### List of query builder objects
+
+`type("string")`
+
+> The collection name to query
+
+`collection("string")`
+
+> An alias for `type`
+
+`eq("key","value")` or 
+`equals("key","value")` or 
+`filter("key","value")` 
+
+> Equal to (e.g. `where color = 'black'`)
+
+`contains("key","value")` or
+`containsString("key","value")` or
+`containsWord("key","value")`
+
+> Contains a string (e.g.` where color contains 'bl*'`)
+
+`gt("key","value")` or
+`greaterThan("key","value")`
+
+> Greater than (e.g. `where weight > 2.4`)
+
+`gte("key","value")` or 
+`greaterThanOrEqual("key","value")`
+
+> Greater than or equal to (e.g. `where weight >= 2.4`)
+
+`lt("key","value")` or `lessThan("key","value")`
+
+> Less than (e.g. `where weight < 2.4`)
+
+`lte("key","value")` or `lessThanOrEqual("key","value")`
+
+> Less than or equal to (e.g. `where weight <= 2.4`)
+
+`not()`
+
+> Negates the next block in the builder pattern, e.g.:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").not().eq("color","black");
+// select * from cats where not color = 'black'
+```
+
+`and()`
+
+> Joins two queries by requiring both of them. `and` is also implied when joining two queries _without_ an operator. E.g.:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").eq("fur","longHair");
+// is identical to:
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").and().eq("fur","longHair");
+```
+
+`or()`
+
+> Joins two queries by requiring only one of them. `or` is never implied. e.g.:
+
+```java
+UsergridQuery query = new UsergridQuery("cats").eq("color","black").or().eq("color", "white");
+```
+    
+> When using `or()` and `and()` operators, `and()` joins will take precedence over `or()` joins. You can read more about query operators and precedence [here](http://docs.apigee.com/api-baas/content/supported-query-operators-data-types).
+
+`locationWithin(distanceInMeters, latitude, longitude)`
+
+> Returns entities which have a location within the specified radius. Arguments can be `float` or `int`.
+
+`asc("key")` or `ascending("key")`
+
+> Sorts the results by the specified property, ascending
+
+`desc("key")` or `descending("key")`
+
+> Sorts the results by the specified property, descending
+
+`sort("key",UsergridQuerySortOrder.ASC)`
+
+> Sorts the results by the specified property, in the specified `UsergridQuerySortOrder` (`.ASC` or `.DESC`).
+ 
+`limit(int)`
+
+> The maximum number of entities to return
+
+`cursor("string")`
+
+> A pagination cursor string
+
+`fromString("query string")`
+
+> A special builder property that allows you to input a pre-defined query string. All builder properties will be ignored when this property is defined. For example:
+    
+```java
+UsergridQuery query = new UsergridQuery().fromString("select * where color = 'black' order by name asc");
+```
+
+## UsergridResponse object
+
+`UsergridResponse` is the core class that handles both successful and unsuccessful HTTP responses from Usergrid. 
+
+If a request is successful, any entities returned in the response will be automatically parsed into `UsergridEntity` objects and pushed to the `entities` property.
+
+If a request fails, the `error` property will contain information about the problem encountered.
+
+### ok
+
+You can check `UsergridResponse.ok`, a `Bool` value, to see if the response was successful. Any status code `< 400` returns true.
+
+```java
+UsergridResponse response = Usergrid.GET("collection");
+if( response.ok() ) {
+    // woo!
+}
+```
+    
+### entity, entities, user, users, first, last
+
+Depending on the call you make, any entities returned in the response will be automatically parsed into `UsergridEntity` objects and pushed to the `entities` property. If you're querying the `users` collection, these will also be `UsergridUser` objects, a subclass of `UsergridEntity`.
+
+- `.first()` returns the first entity in an array of entities; `.entity()` is an alias to `.first()`. If there are no entities, both of these will be undefined.
+
+- `.last()` returns the last entity in an array of entities; if there is only one entity in the array, this will be the same as `.first()` _and_ `.entity()`, and will be undefined if there are no entities in the response.
+
+- `.getEntities()` will either be an array of entities in the response, or an empty array.
+
+- `.user()` is a special alias for `.entity()` for when querying the `users()` collection. Instead of being a `UsergridEntity`, it will be its subclass, `UsergridUser`.
+
+- `.users()` is the same as `.user()`, though behaves as `.getEntities()` does by returning either an array of UsergridUser objects or an empty array.
+
+Examples:
+
+```java
+UsergridResponse response = Usergrid.GET("collection");
+    // you can access:
+    //     response.getEntities() (the returned entities)
+    //     response.first() (the first entity)
+    //     response.entity() (same as response.first)
+    //     response.last() (the last entity returned)
+
+UsergridResponse response = Usergrid.GET("collection","<uuid-or-name>");
+    // you can access:
+    //     response.entity() (the returned entity) 
+    //     response.getEntities() (containing only the returned entity)
+    //     response.first() (same as response.entity)
+    //     response.last() (same as response.entity)
+
+UsergridResponse response = Usergrid.GET("users");
+    // you can access:
+    //     response.users() (the returned users)
+    //     response.getEntities() (same as response.users)
+    //     response.user() (the first user)    
+    //     response.entity() (same as response.user)   
+    //     response.first() (same as response.user)  
+    //     response.last() (the last user)
+
+UsergridResponse response = Usergrid.GET("users","<uuid-or-name>");
+    // you can access;
+    //     response.users() (containing only the one user)
+    //     response.getEntities() (same as response.users)
+    //     response.user() (the returned user)    
+    //     response.entity() (same as response.user)   
+    //     response.first() (same as response.user)  
+    //     response.last() (same as response.user)  
+```
+
+## Connections
+
+Connections can be managed using `Usergrid.connect()`, `Usergrid.disconnect()`, and `Usergrid.getConnections()`, or entity convenience methods of the same name. 
+
+When retrieving connections via `Usergrid.getConnections()`, you can pass in a optional `UsergridQuery` object in order to filter the connectioned entities returned.
+
+### Connect
+
+Create a connection between two entities:
+
+```java
+Usergrid.connect(entity1, "relationship", entity2); // entity1 now has an outbound connection to entity2
+```
+
+### Retrieve Connections
+
+Retrieve outbound connections:
+
+```java
+Usergrid.getConnections(UsergridDirection.OUT, entity1, "relationship");
+    // entities is an array of entities that entity1 is connected to via 'relationship'
+    // in this case, we'll see entity2 in the array
+```
+
+Retrieve inbound connections:
+
+```java
+Usergrid.getConnections(UsergridDirection.IN, entity2, "relationship");
+    // entities is an array of entities that connect to entity2 via 'relationship'
+    // in this case, we'll see entity1 in the array
+```
+
+### Disconnect
+
+Delete a connection between two entities:
+
+```java
+Usergrid.disconnect(entity1, "relationship", entity2);
+    // entity1's outbound connection to entity2 has been destroyed
+```
+
+## Custom UsergridEntity Subclasses
+
+Creating custom subclasses of the base `UsergridEntity` class (just like `UsergridUser` and `UsergridDevice`) is possible.
+
+- To do so, subclass `UsergridEntity` and implement the required methods:
+
+```java
+public class ActivityEntity extends UsergridEntity {
+	public static final String ACTIVITY_ENTITY_TYPE = "activity";
+	
+   public ActivityEntity(){
+       super(ACTIVITY_ENTITY_TYPE);
+   }
+}
+```
+- You will also need to register the custom subclass:
+
+```java
+Usergrid.initSharedInstance("orgId","appId");
+UsergridEntity.mapCustomSubclassToType("activity", ActivityEntity.class);
+```
+
+By registering your custom subclass, the `UsergridEntity` and `UsergridResponse` classes are able to generate instances of these classes based on the an entities `type`.
+
+In the above example, entities which have a `type` value of `activity` can now be cast as `ActivityEntity` objects. e.g.:
+
+```java
+UsergridResponse response = Usergrid.GET("activity");
+ActivityEntity activityEntity = (ActivityEntity)response.entity();
+```


[22/54] [abbrv] usergrid git commit: Merge commit 'refs/pull/507/head' of github.com:apache/usergrid into release-2.1.1

Posted by mr...@apache.org.
Merge commit 'refs/pull/507/head' of github.com:apache/usergrid into release-2.1.1


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

Branch: refs/heads/apm
Commit: c5b06dba4a7b6fafebe613d7d8e4be89cd68755d
Parents: 9553d44 f76aeaf
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 16:16:17 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 16:16:17 2016 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  4 +-
 .../events/ApplicationRequestCounterIT.java     | 48 ++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/c5b06dba/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------


[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).

Posted by mr...@apache.org.
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);


[50/54] [abbrv] usergrid git commit: Merge branch 'master' of https://github.com/RobertWalsh/usergrid

Posted by mr...@apache.org.
Merge branch 'master' of https://github.com/RobertWalsh/usergrid


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

Branch: refs/heads/apm
Commit: 886e837c15e8c9eb25bdf383655ab535a5cf4ea1
Parents: 8f8b467 7d5836a
Author: George Reyes <gr...@apache.org>
Authored: Thu May 19 10:18:09 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Thu May 19 10:18:09 2016 -0700

----------------------------------------------------------------------
 UsergridSDK.podspec                             |   18 +
 sdks/swift/README.md                            |    2 +-
 .../Source/Base.lproj/Main.storyboard           |   26 +-
 .../ActivityFeed/Source/FormTextField.swift     |    2 +-
 .../Source/MessageViewController.swift          |   26 +-
 .../Samples/Push/Source/UsergridManager.swift   |    2 +-
 sdks/swift/Source/Usergrid.swift                |   32 +-
 sdks/swift/Source/UsergridAsset.swift           |   18 +-
 sdks/swift/Source/UsergridAuth.swift            |    6 +-
 sdks/swift/Source/UsergridClient.swift          |   89 +-
 sdks/swift/Source/UsergridClientConfig.swift    |   14 +-
 sdks/swift/Source/UsergridDevice.swift          |   41 +-
 sdks/swift/Source/UsergridEntity.swift          |  104 +-
 sdks/swift/Source/UsergridEnums.swift           |   22 +-
 sdks/swift/Source/UsergridExtensions.swift      |   82 +-
 sdks/swift/Source/UsergridFileMetaData.swift    |    4 +-
 sdks/swift/Source/UsergridQuery.swift           |    3 +-
 sdks/swift/Source/UsergridRequest.swift         |    2 +-
 sdks/swift/Source/UsergridRequestManager.swift  |   72 +-
 sdks/swift/Source/UsergridResponse.swift        |    6 +-
 sdks/swift/Source/UsergridUser.swift            |   62 +-
 sdks/swift/Tests/ASSET_Tests.swift              |  218 ++-
 sdks/swift/Tests/AUTH_Tests.swift               |   92 +-
 sdks/swift/Tests/CONNECTION_Tests.swift         |   42 +-
 sdks/swift/Tests/ClientCreationTests.swift      |   44 +-
 sdks/swift/Tests/GET_Tests.swift                |   38 +-
 sdks/swift/Tests/PUT_Tests.swift                |   38 +-
 sdks/swift/Tests/TestAssets/UsergridGuy.jpg     |  Bin 0 -> 12981 bytes
 sdks/swift/Tests/User_Tests.swift               |  310 +++-
 sdks/swift/UsergridSDK.podspec                  |   18 -
 .../swift/UsergridSDK.xcodeproj/project.pbxproj |    4 +-
 sdks/swift/docs/Classes.html                    |   16 +-
 sdks/swift/docs/Classes/Usergrid.html           |  290 ++-
 sdks/swift/docs/Classes/UsergridAppAuth.html    |   30 +-
 sdks/swift/docs/Classes/UsergridAsset.html      |   44 +-
 .../Classes/UsergridAssetUploadRequest.html     |   20 +-
 sdks/swift/docs/Classes/UsergridAuth.html       |   34 +-
 sdks/swift/docs/Classes/UsergridClient.html     |  275 ++-
 .../docs/Classes/UsergridClientConfig.html      |   54 +-
 sdks/swift/docs/Classes/UsergridDevice.html     |  205 ++-
 sdks/swift/docs/Classes/UsergridEntity.html     |  215 ++-
 .../docs/Classes/UsergridFileMetaData.html      |   30 +-
 sdks/swift/docs/Classes/UsergridQuery.html      |  156 +-
 sdks/swift/docs/Classes/UsergridRequest.html    |   36 +-
 sdks/swift/docs/Classes/UsergridResponse.html   |   42 +-
 .../docs/Classes/UsergridResponseError.html     |   24 +-
 sdks/swift/docs/Classes/UsergridUser.html       |  231 ++-
 sdks/swift/docs/Classes/UsergridUserAuth.html   |   30 +-
 sdks/swift/docs/Enums.html                      |   28 +-
 sdks/swift/docs/Enums/UsergridAuthMode.html     |  283 +++
 .../docs/Enums/UsergridDeviceProperties.html    |   20 +-
 sdks/swift/docs/Enums/UsergridDirection.html    |   16 +-
 .../docs/Enums/UsergridEntityProperties.html    |   24 +-
 sdks/swift/docs/Enums/UsergridHttpMethod.html   |   16 +-
 .../docs/Enums/UsergridImageContentType.html    |   16 +-
 .../swift/docs/Enums/UsergridQueryOperator.html |   20 +-
 .../docs/Enums/UsergridQuerySortOrder.html      |   20 +-
 .../docs/Enums/UsergridUserProperties.html      |   20 +-
 sdks/swift/docs/Extensions.html                 |   72 +-
 sdks/swift/docs/Extensions/NSDate.html          |  448 +++++
 sdks/swift/docs/Global Variables.html           |   18 +-
 sdks/swift/docs/Typealiases.html                |   36 +-
 .../Contents/Resources/Documents/Classes.html   |  209 ++-
 .../Resources/Documents/Classes/Usergrid.html   | 1086 ++++++++---
 .../Documents/Classes/UsergridAppAuth.html      |  183 +-
 .../Documents/Classes/UsergridAsset.html        |  265 ++-
 .../Classes/UsergridAssetUploadRequest.html     |  356 ++++
 .../Documents/Classes/UsergridAuth.html         |  274 ++-
 .../Documents/Classes/UsergridClient.html       | 1310 +++++++++----
 .../Documents/Classes/UsergridClientConfig.html |  345 +++-
 .../Documents/Classes/UsergridDevice.html       |  519 +++++-
 .../Documents/Classes/UsergridEntity.html       |  809 +++++---
 .../Documents/Classes/UsergridFileMetaData.html |  217 ++-
 .../Documents/Classes/UsergridQuery.html        |  540 ++++--
 .../Documents/Classes/UsergridRequest.html      |  619 +++++++
 .../Documents/Classes/UsergridResponse.html     |  309 ++--
 .../Classes/UsergridResponseError.html          |  473 +++++
 .../Documents/Classes/UsergridUser.html         | 1734 ++++++++++++++++--
 .../Documents/Classes/UsergridUserAuth.html     |  169 +-
 .../Contents/Resources/Documents/Enums.html     |  115 +-
 .../Documents/Enums/UsergridAuthFallback.html   |   53 +-
 .../Documents/Enums/UsergridAuthMode.html       |  283 +++
 .../Enums/UsergridDeviceProperties.html         |   83 +-
 .../Documents/Enums/UsergridDirection.html      |   71 +-
 .../Enums/UsergridEntityProperties.html         |  101 +-
 .../Documents/Enums/UsergridHttpMethod.html     |  341 ++++
 .../Enums/UsergridImageContentType.html         |   73 +-
 .../Documents/Enums/UsergridQueryOperator.html  |   89 +-
 .../Documents/Enums/UsergridQuerySortOrder.html |   83 +-
 .../Documents/Enums/UsergridUserProperties.html |   95 +-
 .../Resources/Documents/Extensions.html         |   72 +-
 .../Resources/Documents/Extensions/NSDate.html  |  448 +++++
 .../Resources/Documents/Global Variables.html   |  210 +++
 .../Resources/Documents/Typealiases.html        |  159 +-
 .../Resources/Documents/css/highlight.css       |    6 +-
 .../Contents/Resources/Documents/css/jazzy.css  |   65 +-
 .../Contents/Resources/Documents/index.html     |  741 +++++++-
 .../Contents/Resources/Documents/js/jazzy.js    |   11 +-
 .../Resources/Documents/undocumented.txt        |   11 -
 .../.docset/Contents/Resources/docSet.dsidx     |  Bin 114688 -> 147456 bytes
 sdks/swift/docs/docsets/.tgz                    |  Bin 111866 -> 148251 bytes
 sdks/swift/docs/index.html                      |   24 +-
 102 files changed, 13753 insertions(+), 3004 deletions(-)
----------------------------------------------------------------------



[11/54] [abbrv] usergrid git commit: Merge branch 'usergrid-1278' into release-2.1.1

Posted by mr...@apache.org.
Merge branch 'usergrid-1278' into release-2.1.1


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

Branch: refs/heads/apm
Commit: f505e59c4fa56297b523ff246ba6180f0d24120f
Parents: 2e344cb 44d81fb
Author: Dave Johnson <sn...@apache.org>
Authored: Thu Apr 14 19:19:45 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Thu Apr 14 19:19:45 2016 -0400

----------------------------------------------------------------------
 .../collection/CollectionsResourceIT.java       | 113 ++++++++++++++++++-
 1 file changed, 110 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[31/54] [abbrv] usergrid git commit: Increase limit of device fetching per user to 50.

Posted by mr...@apache.org.
Increase limit of device fetching per user to 50.


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

Branch: refs/heads/apm
Commit: 2b38d2400ada3c0a625e45e4afefa12f3c2b3b9d
Parents: a8ba65f
Author: Michael Russo <mr...@apigee.com>
Authored: Thu Apr 21 10:08:09 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Thu Apr 21 10:08:09 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/impl/ApplicationQueueManagerImpl.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b38d240/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 44ccf2b..80e8cbe 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -45,8 +45,6 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
     private static final Logger logger = LoggerFactory.getLogger(ApplicationQueueManagerImpl.class);
 
-    //this is for tests, will not mark initial post complete, set to false for tests
-
     private final EntityManager em;
     private final QueueManager qm;
     private final JobScheduler jobScheduler;
@@ -245,6 +243,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                                 Query devicesQuery = new Query();
                                 devicesQuery.setCollection("devices");
                                 devicesQuery.setResultsLevel(Query.Level.CORE_PROPERTIES);
+                                devicesQuery.setLimit(50); // for now, assume a user has no more than 50 devices
 
                                 try {
 


[41/54] [abbrv] usergrid git commit: Update logging statements to be trace level.

Posted by mr...@apache.org.
Update logging statements to be trace level.


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

Branch: refs/heads/apm
Commit: 46cd401deac94235982991ca218591fceaa43264
Parents: 1284db7
Author: Michael Russo <mr...@apigee.com>
Authored: Sat Apr 30 21:00:09 2016 +0800
Committer: Michael Russo <mr...@apigee.com>
Committed: Sat Apr 30 21:00:09 2016 +0800

----------------------------------------------------------------------
 .../impl/shard/impl/NodeShardAllocationImpl.java              | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/46cd401d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index 0c65912..47b630f 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -94,7 +94,6 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
 
         else {
             existingShards = edgeShardSerialization.getShardMetaData( scope, maxShardId, directedEdgeMeta );
-            //logger.info("existing shards has something: {}", existingShards.hasNext());
 
             /**
              * We didn't get anything out of cassandra, so we need to create the minimum shard
@@ -113,8 +112,6 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
             }
         }
 
-        //logger.info("getShards existing shards: {}", existingShards);
-
         return new ShardEntryGroupIterator( existingShards, graphFig.getShardMinDelta(), shardGroupCompaction, scope,
             directedEdgeMeta );
     }
@@ -240,7 +237,9 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
 
         final Shard newShard = new Shard( marked.getTimestamp(), createTimestamp, false );
 
-        logger.info( "Allocating new shard {} for edge meta {}", newShard, directedEdgeMeta );
+        if(logger.isTraceEnabled()) {
+            logger.trace("Allocating new shard {} for edge meta {}", newShard, directedEdgeMeta);
+        }
 
         final MutationBatch batch = this.edgeShardSerialization.writeShardMeta( scope, newShard, directedEdgeMeta );
 


[46/54] [abbrv] usergrid git commit: Added UsergridEntity.toMapValue() and fixed bugs in UsergridRequest.

Posted by mr...@apache.org.
Added UsergridEntity.toMapValue() and fixed bugs in UsergridRequest.

Also added the generated jar artifact to the repo.


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

Branch: refs/heads/apm
Commit: fb353884b334b83d401a6a32362646db942445d6
Parents: f0829ac
Author: Robert Walsh <rj...@gmail.com>
Authored: Wed May 11 12:24:14 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Wed May 11 12:24:14 2016 -0500

----------------------------------------------------------------------
 .../usergrid/java/client/UsergridRequest.java    |   4 ++--
 .../java/client/model/UsergridEntity.java        |   2 ++
 sdks/java/usergrid-java-client-2.1.0.jar         | Bin 0 -> 1991588 bytes
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/fb353884/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
index 6939eb2..0ac29d6 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
@@ -157,12 +157,12 @@ public class UsergridRequest {
     protected HttpUrl constructUrl() {
         String url = this.baseUrl;
         if( this.query != null ) {
-            url += this.query.build();
+            url += this.query.build(false);
         }
         HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder();
         if( this.pathSegments != null ) {
             for( String path : this.pathSegments ) {
-                urlBuilder.addPathSegment(path);
+                urlBuilder.addPathSegments(path);
             }
         }
         if( this.parameters != null ) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/fb353884/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
index 689f818..e7af748 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
@@ -103,6 +103,8 @@ public class UsergridEntity {
     @NotNull public JsonNode toJsonObjectValue() {
         return toJsonNode(this);
     }
+    @SuppressWarnings("unchecked")
+    @NotNull public Map<String,?> toMapValue() { return entityUpdateMapper.convertValue(this,Map.class); }
 
     @JsonIgnore
     public boolean isUser() { return (this instanceof UsergridUser || this.getType().equalsIgnoreCase(UsergridUser.USER_ENTITY_TYPE)); }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/fb353884/sdks/java/usergrid-java-client-2.1.0.jar
----------------------------------------------------------------------
diff --git a/sdks/java/usergrid-java-client-2.1.0.jar b/sdks/java/usergrid-java-client-2.1.0.jar
new file mode 100644
index 0000000..ce5a1e6
Binary files /dev/null and b/sdks/java/usergrid-java-client-2.1.0.jar differ


[06/54] [abbrv] usergrid git commit: Minor updates to pom.xml and UsergridRequestManager.

Posted by mr...@apache.org.
Minor updates to pom.xml and UsergridRequestManager.


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

Branch: refs/heads/apm
Commit: 588ce4831e1ff056fb7340f132ea4ea5e3e407d1
Parents: 2e127e6
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu Apr 14 12:53:19 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu Apr 14 12:53:19 2016 -0500

----------------------------------------------------------------------
 sdks/java/pom.xml                                         | 10 ++++++----
 .../usergrid/java/client/UsergridRequestManager.java      |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/588ce483/sdks/java/pom.xml
----------------------------------------------------------------------
diff --git a/sdks/java/pom.xml b/sdks/java/pom.xml
index 31bb429..a9b95bb 100644
--- a/sdks/java/pom.xml
+++ b/sdks/java/pom.xml
@@ -5,7 +5,9 @@
         <bundle.symbolicName>org.apache.usergrid</bundle.symbolicName>
         <bundle.namespace>org.apache.usergrid</bundle.namespace>
         <jackson-version>2.7.3</jackson-version>
-        <junit.version>4.11</junit.version>
+        <junit-version>4.11</junit-version>
+        <okhttp-version>3.2.0</okhttp-version>
+        <intellij-annotations-version>9.0.4</intellij-annotations-version>
     </properties>
 
     <modelVersion>4.0.0</modelVersion>
@@ -79,7 +81,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
+            <version>${junit-version}</version>
             <scope>test</scope>
         </dependency>
 
@@ -104,13 +106,13 @@
         <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
-            <version>3.2.0</version>
+            <version>${okhttp-version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.intellij</groupId>
             <artifactId>annotations</artifactId>
-            <version>9.0.4</version>
+            <version>${intellij-annotations-version}</version>
         </dependency>
     </dependencies>
     <name>Apache Usergrid Java SDK</name>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/588ce483/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
index b3e3597..ef771e7 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
@@ -34,7 +34,7 @@ import static org.apache.usergrid.java.client.utils.ObjectUtils.isEmpty;
 
 public class UsergridRequestManager {
 
-    @NotNull public static final String USERGRID_USER_AGENT = "usergrid-java/v" + Usergrid.UsergridSDKVersion;
+    @NotNull public static String USERGRID_USER_AGENT = "usergrid-java/v" + Usergrid.UsergridSDKVersion;
 
     @NotNull private final UsergridClient usergridClient;
     @NotNull private final OkHttpClient httpClient;


[33/54] [abbrv] usergrid git commit: Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1

Posted by mr...@apache.org.
Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1


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

Branch: refs/heads/apm
Commit: 11ee98ab468e544b98143d3da01688cc905b21a6
Parents: 02352df 2b38d24
Author: Mike Dunker <md...@apigee.com>
Authored: Thu Apr 21 10:09:06 2016 -0700
Committer: Mike Dunker <md...@apigee.com>
Committed: Thu Apr 21 10:09:06 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/impl/ApplicationQueueManagerImpl.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------



[47/54] [abbrv] usergrid git commit: Updates. See commit details.

Posted by mr...@apache.org.
Updates.  See commit details.

Added default constructors to some classes.
Added @JsonProperty annotations to some constructor methods.
Added UsergridEntity.toPrettyString() for constructing a pretty printed Json string.
Fixed UsergridResponse.fromException method to check for null.


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

Branch: refs/heads/apm
Commit: 9cccc9089078559e0860019f52c87e57d76fb432
Parents: fb35388
Author: Robert Walsh <rj...@gmail.com>
Authored: Fri May 13 11:50:15 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Fri May 13 11:50:15 2016 -0500

----------------------------------------------------------------------
 .../java/client/UsergridClientConfig.java       |   3 +++
 .../usergrid/java/client/UsergridRequest.java   |   2 ++
 .../java/client/auth/UsergridAppAuth.java       |   7 ++++++-
 .../usergrid/java/client/auth/UsergridAuth.java |   5 +++--
 .../java/client/auth/UsergridUserAuth.java      |   8 +++++++-
 .../client/exception/UsergridException.java     |   2 ++
 .../java/client/model/UsergridEntity.java       |   3 ++-
 .../java/client/model/UsergridUser.java         |   5 +++--
 .../java/client/response/UsergridResponse.java  |  12 ++++++++++--
 .../usergrid/java/client/utils/JsonUtils.java   |  18 ++++++++++++++++++
 sdks/java/usergrid-java-client-2.1.0.jar        | Bin 1991588 -> 1992239 bytes
 11 files changed, 56 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
index b27d914..f12f9ec 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
@@ -37,6 +37,9 @@ public class UsergridClientConfig {
 
     @Nullable public UsergridAppAuth appAuth = null;
 
+    @SuppressWarnings("unused")
+    private UsergridClientConfig() {}
+
     public UsergridClientConfig(@NotNull final String orgId, @NotNull final String appId) {
         this.orgId = orgId;
         this.appId = appId;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
index 0ac29d6..b16783e 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
@@ -80,6 +80,8 @@ public class UsergridRequest {
     public String[] getPathSegments() { return pathSegments; }
     public void setPathSegments(@Nullable final String[] pathSegments) { this.pathSegments = pathSegments; }
 
+    private UsergridRequest() {}
+
     public UsergridRequest(@NotNull final UsergridHttpMethod method,
                            @NotNull final MediaType contentType,
                            @NotNull final String url,

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
index 3ad7251..a7ac64d 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
@@ -16,6 +16,7 @@
  */
 package org.apache.usergrid.java.client.auth;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.HashMap;
@@ -42,7 +43,11 @@ public class UsergridAppAuth extends UsergridAuth {
         return credentials;
     }
 
-    public UsergridAppAuth(@NotNull final String clientId, @NotNull final String clientSecret) {
+    public UsergridAppAuth() {
+        this("","");
+    }
+
+    public UsergridAppAuth(@JsonProperty("clientId") @NotNull final String clientId, @JsonProperty("clientSecret") @NotNull final String clientSecret) {
         super();
         this.clientId = clientId;
         this.clientSecret = clientSecret;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
index 81d9187..94b4809 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
@@ -16,6 +16,7 @@
  */
 package org.apache.usergrid.java.client.auth;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -30,12 +31,12 @@ public class UsergridAuth {
 
     public UsergridAuth() { }
 
-    public UsergridAuth(@Nullable final String accessToken) {
+    public UsergridAuth(@JsonProperty("accessToken") @Nullable final String accessToken) {
         this.usingToken = true;
         setAccessToken(accessToken);
     }
 
-    public UsergridAuth(@Nullable final String accessToken, @Nullable final Long expiry) {
+    public UsergridAuth(@JsonProperty("accessToken") @Nullable final String accessToken, @JsonProperty("expiry") @Nullable final Long expiry) {
         this.usingToken = true;
         setAccessToken(accessToken);
         setExpiry(expiry);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
index 961be70..e1831c2 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
@@ -16,6 +16,8 @@
  */
 package org.apache.usergrid.java.client.auth;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.usergrid.java.client.model.UsergridUser;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.HashMap;
@@ -42,7 +44,11 @@ public class UsergridUserAuth extends UsergridAuth {
         return credentials;
     }
 
-    public UsergridUserAuth(@NotNull final String username, @NotNull final String password) {
+    public UsergridUserAuth() {
+        this("","");
+    }
+
+    public UsergridUserAuth(@JsonProperty("username") @NotNull final String username, @JsonProperty("password") @NotNull final String password) {
         super();
         this.username = username;
         this.password = password;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
index a9b0cf7..ff30a0d 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
@@ -28,6 +28,8 @@ public class UsergridException extends RuntimeException {
     }
     public void setResponseCode(final int responseCode) { this.responseCode = responseCode; }
 
+    private UsergridException() {}
+
     public UsergridException(@NotNull final String message) {
         super(message);
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
index e7af748..e3dbb77 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
@@ -100,11 +100,12 @@ public class UsergridEntity {
     @NotNull @Override public String toString() {
         return toJsonString(this);
     }
+    @NotNull public String toPrettyString() { return toPrettyJsonString(this); }
     @NotNull public JsonNode toJsonObjectValue() {
         return toJsonNode(this);
     }
     @SuppressWarnings("unchecked")
-    @NotNull public Map<String,?> toMapValue() { return entityUpdateMapper.convertValue(this,Map.class); }
+    @NotNull public Map<String,?> toMapValue() { return toMap(this); }
 
     @JsonIgnore
     public boolean isUser() { return (this instanceof UsergridUser || this.getType().equalsIgnoreCase(UsergridUser.USER_ENTITY_TYPE)); }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
index 9a5bd86..f967e46 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
@@ -16,6 +16,7 @@
  */
 package org.apache.usergrid.java.client.model;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import org.apache.usergrid.java.client.Usergrid;
 import org.apache.usergrid.java.client.UsergridClient;
@@ -85,8 +86,8 @@ public class UsergridUser extends UsergridEntity {
     public boolean isDisabled() { return this.disabled; }
     public void setDisabled(final boolean disabled) { this.disabled = disabled; }
 
-    @Nullable public UsergridUserAuth getUserAuth() { return this.userAuth; }
-    public void setUserAuth(@Nullable final UsergridUserAuth userAuth) { this.userAuth = userAuth; }
+    @JsonIgnore @Nullable public UsergridUserAuth getUserAuth() { return this.userAuth; }
+    @JsonIgnore public void setUserAuth(@Nullable final UsergridUserAuth userAuth) { this.userAuth = userAuth; }
 
     @Nullable
     public String uuidOrUsername() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
index 8618d94..ee649c4 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
@@ -183,9 +183,17 @@ public class UsergridResponse {
 
     @NotNull
     public static UsergridResponse fromException(@Nullable final UsergridClient client, @NotNull final Exception ex) {
-        UsergridResponse response = new UsergridResponse();
+        final UsergridResponse response = new UsergridResponse();
         response.client = client;
-        response.responseError = new UsergridResponseError(ex.getClass().toString(), ex.getMessage(), ex.getCause().toString());
+        final UsergridResponseError responseError = new UsergridResponseError();
+        responseError.setErrorDescription(ex.getMessage());
+        if( ex.getClass() != null ) {
+            responseError.setErrorName(ex.getClass().toString());
+        }
+        if( ex.getCause() != null ) {
+            responseError.setErrorException(ex.getCause().toString());
+        }
+        response.responseError = responseError;
         return response;
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
index d2f43fb..dc1514b 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
@@ -82,11 +82,29 @@ public final class JsonUtils {
     }
 
     @NotNull
+    public static String toPrettyJsonString(@NotNull final Object obj) {
+        try {
+            return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj);
+        } catch (JsonGenerationException e) {
+            throw new UsergridException("Unable to generate json", e);
+        } catch (JsonMappingException e) {
+            throw new UsergridException("Unable to map json", e);
+        } catch (IOException e) {
+            throw new UsergridException("IO error", e);
+        }
+    }
+
+    @NotNull
     public static JsonNode toJsonNode(@NotNull final Object obj) {
         return mapper.convertValue(obj, JsonNode.class);
     }
 
     @NotNull
+    public static Map toMap(@NotNull final Object obj) {
+        return mapper.convertValue(obj,Map.class);
+    }
+
+    @NotNull
     public static <T> T fromJsonNode(@NotNull final JsonNode json, @NotNull final Class<T> c) {
         try {
             JsonParser jp = json.traverse();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/9cccc908/sdks/java/usergrid-java-client-2.1.0.jar
----------------------------------------------------------------------
diff --git a/sdks/java/usergrid-java-client-2.1.0.jar b/sdks/java/usergrid-java-client-2.1.0.jar
index ce5a1e6..733839e 100644
Binary files a/sdks/java/usergrid-java-client-2.1.0.jar and b/sdks/java/usergrid-java-client-2.1.0.jar differ


[27/54] [abbrv] usergrid git commit: Update distinct code.

Posted by mr...@apache.org.
Update distinct code.


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

Branch: refs/heads/apm
Commit: 7df40ac4122240c0f4c5ac06fd6071726f7cf85f
Parents: 938bef0
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 18:26:48 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 18:26:48 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/impl/ApplicationQueueManagerImpl.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/7df40ac4/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 4b2612f..d50bd81 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -23,6 +23,7 @@ import org.apache.usergrid.persistence.core.executor.TaskExecutorFactory;
 import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
 import org.apache.usergrid.persistence.entities.*;
 import org.apache.usergrid.persistence.Query;
+import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.persistence.queue.QueueManager;
 import org.apache.usergrid.persistence.queue.QueueMessage;
 import org.apache.usergrid.services.notifications.*;
@@ -316,7 +317,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                         return queueMessage.get().getNotificationId();
                     }
 
-                    return queueMessage; // this will always be distinct, default handling for the Optional.empty() case
+                    return UUIDUtils.newTimeUUID(); // this should be distinct, default handling for the Optional.empty() case
 
                 } )
                 .doOnNext( message -> {


[29/54] [abbrv] usergrid git commit: Back to Schedulers.io()

Posted by mr...@apache.org.
Back to Schedulers.io()


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

Branch: refs/heads/apm
Commit: 949f71be2b2f8dd6352d82195a72f8c3f31c32f1
Parents: e76e65d
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 19:42:44 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 19:42:44 2016 -0700

----------------------------------------------------------------------
 .../notifications/impl/ApplicationQueueManagerImpl.java  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/949f71be/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index fa8c8a2..44ccf2b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -64,7 +64,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
 
 
-    private final Scheduler scheduler;
+    //private final Scheduler scheduler;
 
 
 
@@ -79,8 +79,10 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         this.queueName = getQueueNames(properties);
         this.queueMeter = metricsFactory.getMeter(ApplicationQueueManagerImpl.class, "notification.queue");
         this.sendMeter = metricsFactory.getMeter(NotificationsService.class, "queue.send");
+        this.concurrencyFactor = Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50"));
 
 
+        /**
         int maxAsyncThreads;
         int workerQueueSize;
 
@@ -88,7 +90,6 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
             maxAsyncThreads = Integer.valueOf(System.getProperty(PUSH_PROCESSING_MAXTHREADS_PROP, "200"));
             workerQueueSize = Integer.valueOf(System.getProperty(PUSH_PROCESSING_QUEUESIZE_PROP, "2000"));
-            this.concurrencyFactor = Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50"));
 
         } catch (Exception e){
 
@@ -104,7 +105,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         this.scheduler = Schedulers.from(TaskExecutorFactory
             .createTaskExecutor( "push-device-io", maxAsyncThreads, workerQueueSize,
                 TaskExecutorFactory.RejectionAction.CALLERRUNS ));
-
+         **/
 
     }
 
@@ -308,7 +309,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                         })
                         .map(sendMessageFunction)
-                        .subscribeOn(scheduler);
+                        .subscribeOn(Schedulers.io());
 
                 }, concurrencyFactor)
                 .distinct( queueMessage -> {
@@ -374,7 +375,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                 });
 
-            processMessagesObservable.subscribeOn(scheduler).subscribe(); // fire the queuing into the background
+            processMessagesObservable.subscribeOn(Schedulers.io()).subscribe(); // fire the queuing into the background
 
         }
 


[08/54] [abbrv] usergrid git commit: Fixed UsergridClient.logoutUser to set the current user to null if the user logging out is the current user.

Posted by mr...@apache.org.
Fixed UsergridClient.logoutUser to set the current user to null if the user logging out is the current user.

Also the CRUD methods that take in a map now use Map<String,?> for ease of use.


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

Branch: refs/heads/apm
Commit: 960ada28676d652966a9e652b975f453f49a4de9
Parents: 5aacc34
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu Apr 14 13:49:12 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu Apr 14 13:49:12 2016 -0500

----------------------------------------------------------------------
 .../apache/usergrid/java/client/Usergrid.java   | 10 +++++-----
 .../usergrid/java/client/UsergridClient.java    | 21 +++++++++++++-------
 2 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/960ada28/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
index 69be358..f7cd545 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
@@ -174,12 +174,12 @@ public final class Usergrid {
     }
 
     @NotNull
-    public static UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+    public static UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, ?> jsonBody) {
         return Usergrid.getInstance().PUT(type, uuidOrName, jsonBody);
     }
 
     @NotNull
-    public static UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+    public static UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, ?> jsonBody) {
         return Usergrid.getInstance().PUT(type, jsonBody);
     }
 
@@ -189,7 +189,7 @@ public final class Usergrid {
     }
 
     @NotNull
-    public static UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, Object> jsonBody) {
+    public static UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, ?> jsonBody) {
         return Usergrid.getInstance().PUT(query, jsonBody);
     }
 
@@ -199,12 +199,12 @@ public final class Usergrid {
     }
 
     @NotNull
-    public static UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+    public static UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, ?> jsonBody) {
         return Usergrid.getInstance().POST(type, jsonBody);
     }
 
     @NotNull
-    public static UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, Object>> jsonBodies) {
+    public static UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, ?>> jsonBodies) {
         return Usergrid.getInstance().POST(type, jsonBodies);
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/960ada28/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
index 396c8f6..87a84ae 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
@@ -198,7 +198,14 @@ public class UsergridClient {
             pathSegments[len-1] = "revoketokens";
         }
         UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), param, null, this.authForRequests() , pathSegments);
-        return this.sendRequest(request);
+        UsergridResponse response = this.sendRequest(request);
+        UsergridUser currentUser = this.getCurrentUser();
+        if( currentUser != null && response.ok() ) {
+            if( uuidOrUsername.equalsIgnoreCase(currentUser.uuidOrUsername()) ) {
+                this.setCurrentUser(null);
+            }
+        }
+        return response;
     }
 
     @NotNull
@@ -231,14 +238,14 @@ public class UsergridClient {
     }
 
     @NotNull
-    public UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+    public UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, ?> jsonBody) {
         String[] pathSegments = { type, uuidOrName };
         UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , pathSegments);
         return this.sendRequest(request);
     }
 
     @NotNull
-    public UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+    public UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, ?> jsonBody) {
         String uuidOrName = null;
         Object uuid = jsonBody.get(UsergridEntityProperties.UUID.toString());
         if( uuid != null ) {
@@ -269,7 +276,7 @@ public class UsergridClient {
     }
 
     @NotNull
-    public UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, Object> jsonBody) {
+    public UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, ?> jsonBody) {
         String collectionName = query.getCollection();
         if( collectionName == null ) {
             return UsergridResponse.fromError(this,  "Query collection name missing.", "Query collection name is missing.");
@@ -296,20 +303,20 @@ public class UsergridClient {
     }
 
     @NotNull
-    public UsergridResponse POST(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+    public UsergridResponse POST(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, ?> jsonBody) {
         String[] pathSegments = {type, uuidOrName};
         UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , pathSegments);
         return this.sendRequest(request);
     }
 
     @NotNull
-    public UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+    public UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, ?> jsonBody) {
         UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , type);
         return this.sendRequest(request);
     }
 
     @NotNull
-    public UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, Object>> jsonBodies) {
+    public UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, ?>> jsonBodies) {
         UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBodies, this.authForRequests() , type);
         return this.sendRequest(request);
     }


[03/54] [abbrv] usergrid git commit: Initial commit for new JavaSDK.

Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/User.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/User.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/User.java
deleted file mode 100644
index 0046ab2..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/User.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-import static com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion.NON_NULL;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getBooleanProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setBooleanProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setStringProperty;
-
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-public class User extends Entity {
-
-	public final static String ENTITY_TYPE = "user";
-
-	public final static String PROPERTY_USERNAME = "username";
-	public final static String PROPERTY_EMAIL = "email";
-	public final static String PROPERTY_NAME = "name";
-	public final static String PROPERTY_FIRSTNAME = "firstname";
-	public final static String PROPERTY_MIDDLENAME = "middlename";
-	public final static String PROPERTY_LASTNAME = "lastname";
-	public final static String PROPERTY_ACTIVATED = "activated";
-	public final static String PROPERTY_PICTURE = "picture";
-	public final static String PROPERTY_DISABLED = "disabled";
-
-	public User() {
-		super();
-		setType(ENTITY_TYPE);
-	}
-
-	public User(Entity entity) {
-		super();
-		properties = entity.properties;
-		setType(ENTITY_TYPE);
-	}
-
-	@Override
-	@JsonIgnore
-	public String getNativeType() {
-		return ENTITY_TYPE;
-	}
-
-	@Override
-	@JsonIgnore
-	public List<String> getPropertyNames() {
-		List<String> properties = super.getPropertyNames();
-		properties.add(PROPERTY_USERNAME);
-		properties.add(PROPERTY_EMAIL);
-		properties.add(PROPERTY_NAME);
-		properties.add(PROPERTY_FIRSTNAME);
-		properties.add(PROPERTY_MIDDLENAME);
-		properties.add(PROPERTY_LASTNAME);
-		properties.add(PROPERTY_ACTIVATED);
-		properties.add(PROPERTY_PICTURE);
-		properties.add(PROPERTY_DISABLED);
-		return properties;
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getUsername() {
-		return getStringProperty(properties, PROPERTY_USERNAME);
-	}
-
-	public void setUsername(String username) {
-		setStringProperty(properties, PROPERTY_USERNAME, username);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getName() {
-		return getStringProperty(properties, PROPERTY_NAME);
-	}
-
-	public void setName(String name) {
-		setStringProperty(properties, PROPERTY_NAME, name);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getEmail() {
-		return getStringProperty(properties, PROPERTY_EMAIL);
-	}
-
-	public void setEmail(String email) {
-		setStringProperty(properties, PROPERTY_EMAIL, email);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public Boolean isActivated() {
-		return getBooleanProperty(properties, PROPERTY_ACTIVATED);
-	}
-
-	public void setActivated(Boolean activated) {
-		setBooleanProperty(properties, PROPERTY_ACTIVATED, activated);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public Boolean isDisabled() {
-		return getBooleanProperty(properties, PROPERTY_DISABLED);
-	}
-
-	public void setDisabled(Boolean disabled) {
-		setBooleanProperty(properties, PROPERTY_DISABLED, disabled);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getFirstname() {
-		return getStringProperty(properties, PROPERTY_FIRSTNAME);
-	}
-
-	public void setFirstname(String firstname) {
-		setStringProperty(properties, PROPERTY_FIRSTNAME, firstname);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getMiddlename() {
-		return getStringProperty(properties, PROPERTY_MIDDLENAME);
-	}
-
-	public void setMiddlename(String middlename) {
-		setStringProperty(properties, PROPERTY_MIDDLENAME, middlename);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getLastname() {
-		return getStringProperty(properties, PROPERTY_LASTNAME);
-	}
-
-	public void setLastname(String lastname) {
-		setStringProperty(properties, PROPERTY_LASTNAME, lastname);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getPicture() {
-		return getStringProperty(properties, PROPERTY_PICTURE);
-	}
-
-	public void setPicture(String picture) {
-		setStringProperty(properties, PROPERTY_PICTURE, picture);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/ClientException.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/ClientException.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/ClientException.java
deleted file mode 100644
index 24f27e2..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/ClientException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.exception;
-
-/**
- * Simple wrapper for client exceptions
- * @author tnine
- *
- */
-public class ClientException extends RuntimeException{
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * @param message
-     * @param cause
-     */
-    public ClientException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
new file mode 100644
index 0000000..a9b0cf7
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/exception/UsergridException.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.exception;
+
+import org.jetbrains.annotations.NotNull;
+
+@SuppressWarnings("unused")
+public class UsergridException extends RuntimeException {
+
+    private int responseCode;
+
+    public int getResponseCode() {
+        return responseCode;
+    }
+    public void setResponseCode(final int responseCode) { this.responseCode = responseCode; }
+
+    public UsergridException(@NotNull final String message) {
+        super(message);
+    }
+
+    public UsergridException(@NotNull final String message, @NotNull final Throwable cause) {
+        super(message, cause);
+    }
+
+    public UsergridException(@NotNull final String message, final int responseCode) {
+        super(message);
+        this.responseCode = responseCode;
+    }
+
+    public UsergridException(@NotNull final String message, @NotNull final Throwable cause, final int responseCode) {
+        super(message, cause);
+        this.responseCode = responseCode;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridDevice.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridDevice.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridDevice.java
new file mode 100644
index 0000000..1833afb
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridDevice.java
@@ -0,0 +1,60 @@
+package org.apache.usergrid.java.client.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public class UsergridDevice extends UsergridEntity {
+    @NotNull public static String DEVICE_ENTITY_TYPE = "device";
+
+    @Nullable private String model;
+    @Nullable private String platform;
+    @Nullable private String osVersion;
+
+    public UsergridDevice() {
+        super(DEVICE_ENTITY_TYPE);
+    }
+
+    public UsergridDevice(@Nullable final String name) {
+        super(DEVICE_ENTITY_TYPE,name);
+    }
+
+    public UsergridDevice(@NotNull final Map<String, JsonNode> properties) {
+        super(DEVICE_ENTITY_TYPE,null,properties);
+    }
+
+    public UsergridDevice(@Nullable final String name, @NotNull final Map<String, JsonNode> properties) {
+        super(DEVICE_ENTITY_TYPE,name,properties);
+    }
+
+    @Nullable @JsonProperty("deviceModel")
+    public String getModel() {
+        return this.model;
+    }
+    @JsonProperty("deviceModel")
+    public void setModel(@Nullable final String model) {
+        this.model = model;
+    }
+
+    @Nullable @JsonProperty("devicePlatform")
+    public String getPlatform() {
+        return this.platform;
+    }
+    @JsonProperty("devicePlatform")
+    public void setPlatform(@Nullable final String platform) {
+        this.platform = platform;
+    }
+
+    @Nullable @JsonProperty("deviceOSVersion")
+    public String getOsVersion() {
+        return this.osVersion;
+    }
+    @JsonProperty("deviceOSVersion")
+    public void setOsVersion(@Nullable final String osVersion) {
+        this.osVersion = osVersion;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
new file mode 100644
index 0000000..f1dc622
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
@@ -0,0 +1,484 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.model;
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectReader;
+import com.fasterxml.jackson.databind.node.*;
+import org.apache.usergrid.java.client.UsergridEnums.*;
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridClient;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.apache.usergrid.java.client.utils.JsonUtils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.util.*;
+
+import static org.apache.usergrid.java.client.utils.JsonUtils.*;
+
+@SuppressWarnings("unused")
+public class UsergridEntity {
+
+    @NotNull private static final HashMap<String,Class<? extends UsergridEntity>> subclassMappings = new HashMap<>();
+    @NotNull private static final ObjectMapper entityUpdateMapper = new ObjectMapper();
+    @NotNull private final ObjectReader entityUpdateReader = entityUpdateMapper.readerForUpdating(this);
+
+    static {
+        subclassMappings.put("user",UsergridUser.class);
+        subclassMappings.put("device",UsergridDevice.class);
+    }
+
+    @NotNull private String type;
+    @Nullable private String uuid;
+    @Nullable private String name;
+    @Nullable private Long created;
+    @Nullable private Long modified;
+
+    @NotNull private Map<String, JsonNode> properties = new HashMap<>();
+
+    public UsergridEntity(@JsonProperty("type") @NotNull final String type) {
+        this.type = type;
+    }
+
+    public UsergridEntity(@NotNull final String type, @Nullable final String name) {
+        this(type);
+        if( name != null ) {
+            this.name = name;
+        }
+    }
+
+    public UsergridEntity(@NotNull final String type, @Nullable final String name, @NotNull final Map<String, JsonNode> properties) {
+        this(type,name);
+        this.updatePropertiesWithMap(properties);
+    }
+
+    @Nullable
+    public static Class<? extends UsergridEntity> customSubclassForType(@NotNull final String type) {
+        return UsergridEntity.subclassMappings.get(type);
+    }
+
+    public void copyAllProperties(@NotNull final UsergridEntity fromEntity) {
+        try {
+            this.updatePropertiesWithJsonNode(entityUpdateMapper.valueToTree(fromEntity));
+        } catch( IllegalArgumentException e ) { System.out.print("Usergrid Error: Unable to update properties from entity - " + fromEntity.toString()); }
+    }
+
+    public void updatePropertiesWithMap(@NotNull final Map<String,JsonNode> properties) {
+        try {
+            this.updatePropertiesWithJsonNode(entityUpdateMapper.valueToTree(properties));
+        } catch( IllegalArgumentException e ) { System.out.print("Usergrid Error: Unable to update properties from map - " + properties.toString()); }
+    }
+
+    public void updatePropertiesWithJsonNode(@NotNull final JsonNode node) {
+        try {
+            entityUpdateReader.readValue(node);
+        } catch( IOException e ) { System.out.print("Usergrid Error: Unable to update properties from jsonNode - " + node.toString()); }
+    }
+
+    public static void mapCustomSubclassToType(@NotNull final String type, @NotNull final Class<? extends UsergridEntity> subclass) {
+        UsergridEntity.subclassMappings.put(type,subclass);
+    }
+
+    @NotNull @Override public String toString() {
+        return toJsonString(this);
+    }
+    @NotNull public JsonNode toJsonObjectValue() {
+        return toJsonNode(this);
+    }
+
+    @JsonIgnore
+    public boolean isUser() { return (this instanceof UsergridUser || this.getType().equalsIgnoreCase(UsergridUser.USER_ENTITY_TYPE)); }
+
+    @NotNull public String getType() { return this.type; }
+    private void setType(@NotNull final String type) { this.type = type; }
+
+    @Nullable public String getUuid() { return this.uuid; }
+    private void setUuid(@NotNull final String uuid) { this.uuid = uuid; }
+
+    @Nullable public String getName() { return this.name; }
+    protected void setName(@Nullable final String name) { this.name = name; }
+
+    @Nullable public Long getCreated() { return this.created; }
+    private void setCreated(@NotNull final Long created) { this.created = created; }
+
+    @Nullable public Long getModified() { return this.modified; }
+    private void setModified(@NotNull final Long modified) { this.modified = modified; }
+
+    public void setLocation(final double latitude, final double longitude) {
+        ObjectNode rootNode = JsonUtils.createObjectNode();
+        rootNode.put("latitude", latitude);
+        rootNode.put("longitude", longitude);
+        setObjectProperty(this.properties, "location", rootNode);
+    }
+
+    @Nullable
+    public String uuidOrName() {
+        String uuidOrName = this.getUuid();
+        if( uuidOrName == null ) {
+            uuidOrName = this.getName();
+        }
+        return uuidOrName;
+    }
+
+    @NotNull
+    public UsergridResponse reload() {
+        return this.reload(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse reload(@NotNull final UsergridClient client) {
+        String uuidOrName = this.uuidOrName();
+        if( uuidOrName == null ) {
+            return UsergridResponse.fromError(client,  "No UUID or name found.", "The entity object must have a `uuid` or `name` assigned.");
+        }
+        UsergridResponse response = client.GET(this.getType(), uuidOrName);
+        if( response.ok() ) {
+            UsergridEntity responseEntity = response.first();
+            if( responseEntity != null ) {
+                this.copyAllProperties(responseEntity);
+            }
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse save() {
+        return this.save(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse save(@NotNull final UsergridClient client) {
+        UsergridResponse response;
+        if( this.getUuid() != null ) {
+            response = client.PUT(this);
+        } else {
+            response = client.POST(this);
+        }
+        if( response.ok() ) {
+            UsergridEntity responseEntity = response.first();
+            if( responseEntity != null ) {
+                this.copyAllProperties(responseEntity);
+            }
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse remove() {
+        return this.remove(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse remove(@NotNull final UsergridClient client) {
+        return client.DELETE(this);
+    }
+
+    @NotNull
+    public UsergridResponse connect(@NotNull final String relationship, @NotNull final UsergridEntity toEntity) {
+        return this.connect(Usergrid.getInstance(), relationship, toEntity);
+    }
+
+    @NotNull
+    public UsergridResponse connect(@NotNull final UsergridClient client, @NotNull final String relationship, @NotNull final UsergridEntity toEntity) {
+        return client.connect(this,relationship,toEntity);
+    }
+
+    @NotNull
+    public UsergridResponse disconnect(@NotNull final String relationship, @NotNull final UsergridEntity fromEntity) {
+        return this.disconnect(Usergrid.getInstance(), relationship, fromEntity);
+    }
+
+    @NotNull
+    public UsergridResponse disconnect(@NotNull final UsergridClient client, @NotNull final String relationship, @NotNull final UsergridEntity fromEntity) {
+        return client.disconnect(this,relationship,fromEntity);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final String relationship) {
+        return this.getConnections(Usergrid.getInstance(),direction,relationship);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridClient client, @NotNull final UsergridDirection direction, @NotNull final String relationship) {
+        return client.getConnections(direction,this,relationship);
+    }
+
+    public void removeProperty(@NotNull final String name) {
+        putProperty(name, NullNode.getInstance());
+    }
+
+    public void removeProperties(@NotNull final List<String> names) {
+        for( String propertyName : names ) {
+            this.removeProperty(propertyName);
+        }
+    }
+
+    public void putProperty(@NotNull final String name, @NotNull final String value) {
+        this.putProperty(name, JsonNodeFactory.instance.textNode(value));
+    }
+    public void putProperty(@NotNull final String name, final boolean value) {
+        this.putProperty(name, JsonNodeFactory.instance.booleanNode(value));
+    }
+    public void putProperty(@NotNull final String name, @NotNull final List value) {
+        this.putProperty(name, JsonNodeFactory.instance.pojoNode(value));
+    }
+    public void putProperty(@NotNull final String name, final int value) {
+        this.putProperty(name, JsonNodeFactory.instance.numberNode(value));
+    }
+    public void putProperty(@NotNull final String name, final long value) {
+        this.putProperty(name, JsonNodeFactory.instance.numberNode(value));
+    }
+    public void putProperty(@NotNull final String name, final float value) {
+        this.putProperty(name, JsonNodeFactory.instance.numberNode(value));
+    }
+    public void putProperty(@NotNull final String name, @Nullable final JsonNode value) {
+        UsergridEntityProperties entityProperty = UsergridEntityProperties.fromString(name);
+        if( entityProperty != null && !entityProperty.isMutableForEntity(this)) {
+            return;
+        }
+
+        JsonNode valueNode = value;
+        if( valueNode == null ) {
+            valueNode = NullNode.getInstance();
+        }
+        this.updatePropertiesWithMap(Collections.singletonMap(name,valueNode));
+    }
+    public void putProperties(@NotNull final String jsonString) {
+        try {
+            JsonNode jsonNode = entityUpdateMapper.readTree(jsonString);
+            this.putProperties(jsonNode);
+        } catch( Exception ignore ) {}
+    }
+    public void putProperties(@NotNull final Map<String, Object> properties) {
+        try {
+            JsonNode jsonNode = entityUpdateMapper.valueToTree(properties);
+            this.putProperties(jsonNode);
+        } catch( Exception ignore ) {}
+    }
+    public void putProperties(@NotNull final JsonNode jsonNode) {
+        HashMap<String,JsonNode> propertiesToUpdate = new HashMap<>();
+        Iterator<Map.Entry<String,JsonNode>> keys = jsonNode.fields();
+        while (keys.hasNext()) {
+            Map.Entry<String,JsonNode> entry = keys.next();
+            String key = entry.getKey();
+            UsergridEntityProperties entityProperty = UsergridEntityProperties.fromString(key);
+            if( entityProperty == null || entityProperty.isMutableForEntity(this) ) {
+                propertiesToUpdate.put(key,entry.getValue());
+            }
+        }
+        if( !propertiesToUpdate.isEmpty() ) {
+            this.updatePropertiesWithMap(propertiesToUpdate);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public void append(@NotNull final String name, @NotNull final Object value) {
+        this.append(name, (value instanceof List) ? (List<Object>) value : Collections.singletonList(value));
+    }
+
+    public void append(@NotNull final String name, @NotNull final List<Object> value) {
+        this.insert(name, value, Integer.MAX_VALUE);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void insert(@NotNull final String name, @NotNull final Object value) {
+        this.insert(name, (value instanceof List) ? (List<Object>) value : Collections.singletonList(value), 0);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void insert(@NotNull final String name, @NotNull final Object value, final int index) {
+        this.insert(name, (value instanceof List) ? (List<Object>) value : Collections.singletonList(value), index);
+    }
+
+    public void insert(@NotNull final String name, @NotNull final List<Object> value) {
+        this.insert(name,value,0);
+    }
+
+    public void insert(@NotNull final String name, @NotNull final List<Object> value, final int index) {
+        int indexToInsert = index;
+        if (indexToInsert < 0) {
+            indexToInsert = 0;
+        }
+        Object propertyValue = this.getEntityProperty(name);
+        if( propertyValue != null ) {
+            ArrayList<Object> propertyArrayValue = this.convertToList(propertyValue);
+            propertyArrayValue = this.insertIntoArray(propertyArrayValue,value,indexToInsert);
+            this.putProperty(name, propertyArrayValue);
+        } else {
+            this.putProperty(name, value);
+        }
+    }
+
+    public void pop(@NotNull final String name) {
+        ArrayList<Object> arrayToPop = this.getArrayToPopOrShift(name);
+        if( arrayToPop != null && !arrayToPop.isEmpty() ) {
+            arrayToPop.remove(arrayToPop.size() - 1);
+            this.putProperty(name, arrayToPop);
+        }
+    }
+
+    public void shift(@NotNull final String name) {
+        ArrayList<Object> arrayToShift = this.getArrayToPopOrShift(name);
+        if( arrayToShift != null && !arrayToShift.isEmpty() ) {
+            arrayToShift.remove(0);
+            this.putProperty(name, arrayToShift);
+        }
+    }
+
+    @Nullable
+    public <T> T getEntityProperty(@NotNull final String name) {
+        return JsonUtils.getProperty(this.properties, name);
+    }
+
+    @Nullable
+    public JsonNode getJsonNodeProperty(@NotNull final String name) {
+        return this.getProperties().get(name);
+    }
+
+    @Nullable
+    public String getStringProperty(@NotNull final String name) {
+        return JsonUtils.getStringProperty(this.getProperties(), name);
+    }
+
+    @Nullable
+    public Boolean getBooleanProperty(@NotNull final String name) {
+        Boolean booleanValue = null;
+        Object object = JsonUtils.getProperty(this.getProperties(), name);
+        if( object instanceof Boolean ) {
+            booleanValue = (Boolean)object;
+        }
+        return booleanValue;
+    }
+
+    @Nullable
+    public Number getNumberProperty(@NotNull final String name) {
+        Number numberValue = null;
+        Object object = JsonUtils.getProperty(this.getProperties(), name);
+        if( object instanceof Number ) {
+            numberValue = (Number)object;
+        }
+        return numberValue;
+    }
+
+    @Nullable
+    public Integer getIntegerProperty(@NotNull final String name) {
+        Integer integerValue = null;
+        Object object = JsonUtils.getProperty(this.getProperties(), name);
+        if( object instanceof Number ) {
+            integerValue = ((Number)object).intValue();
+        }
+        return integerValue;
+    }
+
+    @Nullable
+    public Float getFloatProperty(@NotNull final String name) {
+        Float floatValue = null;
+        Object object = JsonUtils.getProperty(this.getProperties(), name);
+        if( object instanceof Number ) {
+            floatValue = ((Number)object).floatValue();
+        }
+        return floatValue;
+    }
+
+    @Nullable
+    public Long getLongProperty(@NotNull final String name) {
+        Long longValue = null;
+        Object object = JsonUtils.getProperty(this.getProperties(), name);
+        if( object instanceof Number ) {
+            longValue = ((Number)object).longValue();
+        }
+        return longValue;
+    }
+
+    @JsonAnyGetter @NotNull
+    private Map<String, JsonNode> getProperties() {
+        return this.properties;
+    }
+
+    @JsonAnySetter
+    private void internalPutProperty(@NotNull final String name, @Nullable final JsonNode value) {
+        if (value == null) {
+            properties.put(name, NullNode.instance);
+        } else {
+            properties.put(name, value);
+        }
+    }
+
+    @Nullable
+    @SuppressWarnings("unchecked")
+    private ArrayList<Object> getArrayToPopOrShift(@NotNull final String name) {
+        Object entityProperty = getEntityProperty(name);
+        ArrayList<Object> arrayToPopOrShift = null;
+        if (entityProperty instanceof POJONode) {
+            Object objectValue = ((POJONode) entityProperty).getPojo();
+            if (objectValue instanceof List) {
+                arrayToPopOrShift = new ArrayList<>((List) objectValue);
+            } else {
+                arrayToPopOrShift = new ArrayList<>();
+                arrayToPopOrShift.add(objectValue);
+            }
+        } else if( entityProperty instanceof ArrayNode ) {
+            arrayToPopOrShift = JsonUtils.convertToArrayList((ArrayNode)entityProperty);
+        } else if( entityProperty instanceof List ) {
+            arrayToPopOrShift = new ArrayList<>((List) entityProperty);
+        }
+        return arrayToPopOrShift;
+    }
+
+    @NotNull
+    private ArrayList<Object> convertToList(@NotNull final Object value) {
+        ArrayList<Object> arrayList = new ArrayList<>();
+        if( value instanceof ArrayNode ) {
+            arrayList = JsonUtils.convertToArrayList((ArrayNode)value);
+        } else if (value instanceof POJONode) {
+            Object objectValue = ((POJONode) value).getPojo();
+            if( objectValue instanceof List ) {
+                arrayList.addAll((List)objectValue);
+            } else {
+                arrayList.add(objectValue);
+            }
+        } else if (value instanceof List) {
+            arrayList.addAll((List)value);
+        } else {
+            arrayList.add(value);
+        }
+        return arrayList;
+    }
+
+    @NotNull
+    private ArrayList<Object> insertIntoArray(@NotNull final List<Object> propertyArrayNode, @NotNull final List<Object> arrayToInsert, final int index) {
+        ArrayList<Object> mergedArray = new ArrayList<>();
+        if (propertyArrayNode.size() <= 0 || arrayToInsert.isEmpty()) {
+            mergedArray.addAll(arrayToInsert);
+        }  else if ( index <= 0 ) {
+            mergedArray.addAll(arrayToInsert);
+            mergedArray.addAll(propertyArrayNode);
+        } else if ( index > 0 ) {
+            mergedArray.addAll(propertyArrayNode);
+            if ( index > propertyArrayNode.size() ) {
+                mergedArray.addAll(arrayToInsert);
+            } else {
+                mergedArray.addAll(index,arrayToInsert);
+            }
+        }
+        return mergedArray;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
new file mode 100644
index 0000000..4092a21
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridUser.java
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.model;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridClient;
+import org.apache.usergrid.java.client.UsergridEnums.*;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+
+@SuppressWarnings("unused")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class UsergridUser extends UsergridEntity {
+    @NotNull public final static String USER_ENTITY_TYPE = "user";
+
+    @Nullable private UsergridUserAuth userAuth = null;
+
+    @Nullable private String username;
+    @Nullable private String email;
+    @Nullable private String password;
+    @Nullable private String picture;
+
+    private boolean activated = false;
+    private boolean disabled = false;
+
+    public UsergridUser() {
+        super(USER_ENTITY_TYPE);
+    }
+
+    public UsergridUser(@NotNull final String username, @Nullable final String password) {
+        super(USER_ENTITY_TYPE);
+        setUsername(username);
+        setPassword(password);
+    }
+
+    public UsergridUser(@NotNull final String name, @NotNull final HashMap<String, Object> propertyMap) {
+        super(USER_ENTITY_TYPE,name);
+        putProperties(propertyMap);
+    }
+
+    public UsergridUser(@Nullable final String name, @Nullable final String username, @Nullable final String email, @Nullable final String password) {
+        super(USER_ENTITY_TYPE,name);
+        setUsername(username);
+        setEmail(email);
+        setPassword(password);
+    }
+
+    public void setName(@Nullable final String name) { super.setName(name); }
+
+    @Nullable public String getUsername() { return this.username; }
+    public void setUsername(@Nullable final String username) { this.username = username; }
+
+    @Nullable public String getEmail() { return this.email; }
+    public void setEmail(@Nullable final String email) { this.email = email; }
+
+    @Nullable public String getPassword() { return this.password; }
+    public void setPassword(@Nullable final String password) { this.password = password; }
+
+    @Nullable public String setPicture() { return this.picture; }
+    public void setPicture(@Nullable final String picture) { this.picture = picture; }
+
+    public boolean isActivated() { return this.activated; }
+    public void setActivated(final boolean activated) { this.activated = activated; }
+
+    public boolean isDisabled() { return this.disabled; }
+    public void setDisabled(final boolean disabled) { this.disabled = disabled; }
+
+    @Nullable public UsergridUserAuth getUserAuth() { return this.userAuth; }
+    public void setUserAuth(@Nullable final UsergridUserAuth userAuth) { this.userAuth = userAuth; }
+
+    @Nullable
+    public String uuidOrUsername() {
+        String uuidOrUsername = this.getUuid();
+        if( uuidOrUsername == null ) {
+            uuidOrUsername = this.getUsername();
+        }
+        return uuidOrUsername;
+    }
+
+    @Nullable
+    public String usernameOrEmail() {
+        String usernameOrEmail = this.getUsername();
+        if( usernameOrEmail == null ) {
+            usernameOrEmail = this.getEmail();
+        }
+        return usernameOrEmail;
+    }
+
+    public static boolean checkAvailable(@Nullable final String email, @Nullable final String username) {
+        return UsergridUser.checkAvailable(Usergrid.getInstance(), email, username);
+    }
+
+    public static boolean checkAvailable(@NotNull final UsergridClient client, @Nullable final String email, @Nullable final String username) {
+        if (email == null && username == null) {
+            throw new IllegalArgumentException("email and username both are null ");
+        }
+        UsergridQuery query = new UsergridQuery(USER_ENTITY_TYPE);
+        if (username != null) {
+            query.eq(UsergridUserProperties.USERNAME.toString(), username);
+        }
+        if (email != null) {
+            query.or().eq(UsergridUserProperties.EMAIL.toString(), email);
+        }
+        return client.GET(query).first() != null;
+    }
+
+    @NotNull
+    public UsergridResponse create() {
+        return this.create(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse create(@NotNull final UsergridClient client) {
+        UsergridResponse response = client.POST(this);
+        UsergridUser createdUser = response.user();
+        if( createdUser != null ) {
+            this.copyAllProperties(createdUser);
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse login(@NotNull final String username, @NotNull final String password) {
+        return this.login(Usergrid.getInstance(),username,password);
+    }
+
+    @NotNull
+    public UsergridResponse login(@NotNull final UsergridClient client, @NotNull final String username, @NotNull final String password) {
+        UsergridUserAuth userAuth = new UsergridUserAuth(username,password);
+        UsergridResponse response = client.authenticateUser(userAuth,false);
+        if( response.ok() ) {
+            this.userAuth = userAuth;
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse resetPassword(@NotNull final String oldPassword, @NotNull final String newPassword) {
+        return this.resetPassword(Usergrid.getInstance(),oldPassword,newPassword);
+    }
+
+    @NotNull
+    public UsergridResponse resetPassword(@NotNull final UsergridClient client, @NotNull final String oldPassword, @NotNull final String newPassword) {
+        return client.resetPassword(this,oldPassword,newPassword);
+    }
+
+    @NotNull
+    public UsergridResponse reauthenticate() {
+        return this.reauthenticate(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse reauthenticate(@NotNull final UsergridClient client) {
+        return this.userAuth == null ? UsergridResponse.fromError(client, "Invalid UsergridUserAuth.", "No UsergridUserAuth found on the UsergridUser.") : client.authenticateUser(this.userAuth, false);
+    }
+
+    @NotNull
+    public UsergridResponse logout() {
+        return this.logout(Usergrid.getInstance());
+    }
+
+    @NotNull
+    public UsergridResponse logout(@NotNull final UsergridClient client) {
+        UsergridResponse response;
+        String uuidOrUsername = this.uuidOrUsername();
+        String accessToken = (this.userAuth != null) ? this.userAuth.getAccessToken() : null;
+        if (uuidOrUsername == null || accessToken == null ) {
+            response = UsergridResponse.fromError(client,  "Logout Failed.", "UUID or Access Token not found on UsergridUser object.");
+        } else {
+            response = client.logoutUser(uuidOrUsername, accessToken);
+            if( response.ok() ) {
+                this.userAuth = null;
+            }
+        }
+        return response;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
new file mode 100644
index 0000000..dc359c0
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/query/UsergridQuery.java
@@ -0,0 +1,434 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.query;
+
+import org.apache.usergrid.java.client.UsergridEnums.UsergridQueryOperator;
+import org.apache.usergrid.java.client.UsergridEnums.UsergridQuerySortOrder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.net.URLEncoder;
+import java.util.*;
+
+@SuppressWarnings("unused")
+public final class UsergridQuery {
+
+    @NotNull private final ArrayList<String> requirementStrings = new ArrayList<>();
+    @NotNull private final ArrayList<String> urlTerms = new ArrayList<>();
+    @NotNull private final HashMap<String, UsergridQuerySortOrder> orderClauses = new HashMap<>();
+    @NotNull private Integer limit = UsergridQuery.LIMIT_DEFAULT;
+    @Nullable private String cursor = null;
+    @Nullable private String fromStringValue = null;
+    @Nullable private String collectionName = null;
+
+    public UsergridQuery() {
+        this(null);
+    }
+
+    public UsergridQuery(@Nullable final String collectionName) {
+        this.collectionName = collectionName;
+        this.requirementStrings.add(UsergridQuery.EMPTY_STRING);
+    }
+
+    private static boolean isUUID(@NotNull final String string) {
+        try {
+            UUID uuid = UUID.fromString(string);
+            return true;
+        } catch (Exception ex) {
+            return false;
+        }
+    }
+
+    @NotNull
+    private static String encode(@NotNull final String stringValue) {
+        String escapedString;
+        try {
+            escapedString = URLEncoder.encode(stringValue, UTF8);
+        } catch (Exception e) {
+            escapedString = stringValue;
+        }
+        return escapedString;
+    }
+
+    @NotNull
+    public static String strJoin(@NotNull final List<String> array, @NotNull final String separator) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (int i = 0, il = array.size(); i < il; i++) {
+            if (i > 0) {
+                stringBuilder.append(separator);
+            }
+            stringBuilder.append(array.get(i));
+        }
+        return stringBuilder.toString();
+    }
+
+    @NotNull
+    public UsergridQuery fromString(@NotNull final String stringValue) {
+        this.fromStringValue = stringValue;
+        return this;
+    }
+
+    @Nullable
+    public String getType() {
+        return this.collectionName;
+    }
+
+    @Nullable
+    public String getCollectionName() {
+        return this.collectionName;
+    }
+
+    @Nullable
+    public String getCollection() {
+        return this.collectionName;
+    }
+
+    @NotNull
+    public UsergridQuery type(@Nullable final String type) {
+        this.collectionName = type;
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery collection(@Nullable final String collectionName) {
+        return this.type(collectionName);
+    }
+
+    @NotNull
+    public UsergridQuery collectionName(@Nullable final String collectionName) {
+        return this.type(collectionName);
+    }
+
+    @NotNull
+    public UsergridQuery cursor(@Nullable final String value) {
+        this.cursor = value;
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery limit(@NotNull final Integer limit) {
+        this.limit = limit;
+        return this;
+    }
+
+    @NotNull
+    private UsergridQuery addConditionalSeparator(@NotNull final String separator) {
+        if (!this.requirementStrings.get(0).isEmpty()) {
+            this.requirementStrings.add(0, separator);
+            this.requirementStrings.add(0, UsergridQuery.EMPTY_STRING);
+        }
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery and() {
+        return this.addConditionalSeparator(UsergridQuery.AND);
+    }
+
+    @NotNull
+    public UsergridQuery or() {
+        return this.addConditionalSeparator(UsergridQuery.OR);
+    }
+
+    @NotNull
+    public UsergridQuery not() {
+        return this.addConditionalSeparator(UsergridQuery.NOT);
+    }
+
+    @NotNull
+    public UsergridQuery sort(@NotNull final String term, @NotNull final UsergridQuerySortOrder sortOrder) {
+        this.orderClauses.put(term, sortOrder);
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery ascending(@NotNull final String term) {
+        return this.asc(term);
+    }
+
+    @NotNull
+    public UsergridQuery asc(@NotNull final String term) {
+        return this.sort(term, UsergridQuerySortOrder.ASC);
+    }
+
+    @NotNull
+    public UsergridQuery descending(@NotNull final String term) {
+        return this.desc(term);
+    }
+
+    @NotNull
+    public UsergridQuery desc(@NotNull final String term) {
+        return this.sort(term, UsergridQuerySortOrder.DESC);
+    }
+
+    @NotNull
+    public UsergridQuery contains(@NotNull final String term, @NotNull final String value) {
+        return this.containsWord(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery containsString(@NotNull final String term, @NotNull final String value) {
+        return this.containsWord(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery containsWord(@NotNull final String term, @NotNull final String value) {
+        return this.addRequirement(term + SPACE + CONTAINS + SPACE + ((UsergridQuery.isUUID(value)) ? EMPTY_STRING : APOSTROPHE) + value + ((UsergridQuery.isUUID(value)) ? EMPTY_STRING : APOSTROPHE));
+    }
+
+    @NotNull
+    public UsergridQuery filter(@NotNull final String term, @NotNull final Object value) {
+        return this.eq(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery equals(@NotNull final String term, @NotNull final Object value) {
+        return this.eq(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery eq(@NotNull final String term, @NotNull final Object value) {
+        return this.addOperationRequirement(term, UsergridQueryOperator.EQUAL, value);
+    }
+
+    @NotNull
+    public UsergridQuery greaterThan(@NotNull final String term, @NotNull final Object value) {
+        return this.gt(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery gt(@NotNull final String term, @NotNull final Object value) {
+        return this.addOperationRequirement(term, UsergridQueryOperator.GREATER_THAN, value);
+    }
+
+    @NotNull
+    public UsergridQuery greaterThanOrEqual(@NotNull final String term, @NotNull final Object value) {
+        return this.gte(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery gte(@NotNull final String term, @NotNull final Object value) {
+        return this.addOperationRequirement(term, UsergridQueryOperator.GREATER_THAN_EQUAL_TO, value);
+    }
+
+    @NotNull
+    public UsergridQuery lessThan(@NotNull final String term, @NotNull final Object value) {
+        return this.lt(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery lt(@NotNull final String term, @NotNull final Object value) {
+        return this.addOperationRequirement(term, UsergridQueryOperator.LESS_THAN, value);
+    }
+
+    @NotNull
+    public UsergridQuery lessThanOrEqual(@NotNull final String term, @NotNull final Object value) {
+        return this.lte(term, value);
+    }
+
+    @NotNull
+    public UsergridQuery lte(@NotNull final String term, @NotNull final Object value) {
+        return this.addOperationRequirement(term, UsergridQueryOperator.LESS_THAN_EQUAL_TO, value);
+    }
+
+    @NotNull
+    public UsergridQuery locationWithin(final double distance, final double latitude, final double longitude) {
+        return this.addRequirement(LOCATION + SPACE + WITHIN + SPACE + distance + SPACE + OF + SPACE + latitude + SPACE + COMMA + longitude);
+    }
+
+    @NotNull
+    public UsergridQuery urlTerm(@NotNull final String term, @NotNull final String equalsValue) {
+        if (term.equalsIgnoreCase(QL)) {
+            this.ql(equalsValue);
+        } else {
+            this.urlTerms.add(UsergridQuery.encode(term) + EQUALS + UsergridQuery.encode(equalsValue));
+        }
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery ql(@NotNull final String value) {
+        return this.addRequirement(value);
+    }
+
+    @NotNull
+    public UsergridQuery addRequirement(@NotNull final String requirement) {
+        String requirementString = this.requirementStrings.remove(0);
+        if (!requirement.isEmpty() && !requirementString.isEmpty()) {
+            requirementString += SPACE + AND + SPACE;
+        }
+        requirementString += requirement;
+        this.requirementStrings.add(0, requirementString);
+        return this;
+    }
+
+    @NotNull
+    public UsergridQuery addOperationRequirement(@NotNull final String term, @NotNull final UsergridQueryOperator operation, final int intValue) {
+        return this.addOperationRequirement(term, operation, Integer.valueOf(intValue));
+    }
+
+    @NotNull
+    public UsergridQuery addOperationRequirement(@NotNull final String term, @NotNull final UsergridQueryOperator operation, @NotNull final Object value) {
+        if (value instanceof String) {
+            String valueString = value.toString();
+            if (!UsergridQuery.isUUID(valueString)) {
+                valueString = APOSTROPHE + value + APOSTROPHE;
+            }
+            return addRequirement(term + SPACE + operation.operatorValue() + SPACE + valueString);
+        } else {
+            return addRequirement(term + SPACE + operation.operatorValue() + SPACE + value.toString());
+        }
+    }
+
+    @NotNull
+    private String constructOrderByString() {
+        String orderByString = EMPTY_STRING;
+        if (!this.orderClauses.isEmpty()) {
+            for (Map.Entry<String, UsergridQuerySortOrder> orderClause : this.orderClauses.entrySet()) {
+                if (!orderByString.isEmpty()) {
+                    orderByString += COMMA;
+                }
+                orderByString += orderClause.getKey() + SPACE + orderClause.getValue().toString();
+            }
+            if (!orderByString.isEmpty()) {
+                orderByString = SPACE + ORDER_BY + SPACE + orderByString;
+            }
+        }
+        return orderByString;
+    }
+
+    @NotNull
+    private String constructURLTermsString() {
+        String urlTermsString = EMPTY_STRING;
+        if (!this.urlTerms.isEmpty()) {
+            urlTermsString = UsergridQuery.strJoin(this.urlTerms, AMPERSAND);
+        }
+        return urlTermsString;
+    }
+
+    @NotNull
+    private String constructRequirementString() {
+        ArrayList<String> requirementStrings = new ArrayList<>(this.requirementStrings);
+        String firstString = requirementStrings.get(0);
+        if (firstString.isEmpty()) {
+            requirementStrings.remove(0);
+        }
+        String requirementsString = EMPTY_STRING;
+        if (!requirementStrings.isEmpty()) {
+            firstString = requirementStrings.get(0);
+            if (firstString.equalsIgnoreCase(OR) || firstString.equalsIgnoreCase(AND) || firstString.equalsIgnoreCase(NOT)) {
+                requirementStrings.remove(0);
+            }
+            if (!requirementStrings.isEmpty()) {
+                Collections.reverse(requirementStrings);
+                requirementsString = UsergridQuery.strJoin(requirementStrings, SPACE);
+            }
+        }
+        return requirementsString;
+    }
+
+    @NotNull
+    private String constructURLAppend() {
+        return this.constructURLAppend(true);
+    }
+
+    @NotNull
+    private String constructURLAppend(final boolean autoURLEncode) {
+        if (this.fromStringValue != null) {
+            String requirementsString = this.fromStringValue;
+            if (autoURLEncode) {
+                requirementsString = UsergridQuery.encode(requirementsString);
+            }
+            return QUESTION_MARK + QL + EQUALS + requirementsString;
+        }
+        String urlAppend = EMPTY_STRING;
+        if (this.limit != LIMIT_DEFAULT) {
+            urlAppend += LIMIT + EQUALS + this.limit.toString();
+        }
+        String urlTermsString = this.constructURLTermsString();
+        if (!urlTermsString.isEmpty()) {
+            if (!urlAppend.isEmpty()) {
+                urlAppend += AMPERSAND;
+            }
+            urlAppend += urlTermsString;
+        }
+        if (this.cursor != null && !this.cursor.isEmpty()) {
+            if (!urlAppend.isEmpty()) {
+                urlAppend += AMPERSAND;
+            }
+            urlAppend += CURSOR + EQUALS + this.cursor;
+        }
+
+        String requirementsString = this.constructRequirementString();
+        if (!requirementsString.isEmpty()) {
+            requirementsString = SELECT_ALL + SPACE + WHERE + SPACE + requirementsString;
+        } else {
+            requirementsString = SELECT_ALL + SPACE;
+        }
+
+        String orderByString = this.constructOrderByString();
+        if (!orderByString.isEmpty()) {
+            requirementsString += orderByString;
+        }
+        if (!requirementsString.isEmpty()) {
+            if (autoURLEncode) {
+                requirementsString = UsergridQuery.encode(requirementsString);
+            }
+            if (!urlAppend.isEmpty()) {
+                urlAppend += AMPERSAND;
+            }
+            urlAppend += QL + EQUALS + requirementsString;
+        }
+        if (!urlAppend.isEmpty()) {
+            urlAppend = QUESTION_MARK + urlAppend;
+        }
+        return urlAppend;
+    }
+
+    @NotNull
+    public String build() {
+        return this.build(true);
+    }
+
+    @NotNull
+    public String build(final boolean autoURLEncode) {
+        return this.constructURLAppend(autoURLEncode);
+    }
+
+    private static final int LIMIT_DEFAULT = 10;
+    @NotNull private static final String AMPERSAND = "&";
+    @NotNull private static final String AND = "and";
+    @NotNull private static final String APOSTROPHE = "'";
+    @NotNull private static final String COMMA = ",";
+    @NotNull private static final String CONTAINS = "contains";
+    @NotNull private static final String CURSOR = "cursor";
+    @NotNull private static final String EMPTY_STRING = "";
+    @NotNull private static final String EQUALS = "=";
+    @NotNull private static final String LIMIT = "limit";
+    @NotNull private static final String LOCATION = "location";
+    @NotNull private static final String NOT = "not";
+    @NotNull private static final String OF = "of";
+    @NotNull private static final String OR = "or";
+    @NotNull private static final String ORDER_BY = "order by";
+    @NotNull private static final String QL = "ql";
+    @NotNull private static final String QUESTION_MARK = "?";
+    @NotNull private static final String SELECT_ALL = "select *";
+    @NotNull private static final String SPACE = " ";
+    @NotNull private static final String UTF8 = "UTF-8";
+    @NotNull private static final String WHERE = "where";
+    @NotNull private static final String WITHIN = "within";
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounter.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounter.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounter.java
deleted file mode 100644
index 240d09f..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.response;
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.toJsonString;
-
-public class AggregateCounter {
-
-	private long timestamp;
-	private long value;
-
-	public AggregateCounter(long timestamp, long value) {
-		this.timestamp = timestamp;
-		this.value = value;
-	}
-
-	public long getTimestamp() {
-		return timestamp;
-	}
-
-	public void setTimestamp(long timestamp) {
-		this.timestamp = timestamp;
-	}
-
-	public long getValue() {
-		return value;
-	}
-
-	public void setValue(long value) {
-		this.value = value;
-	}
-
-	@Override
-	public String toString() {
-		return toJsonString(this);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounterSet.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounterSet.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounterSet.java
deleted file mode 100644
index 499af3e..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/AggregateCounterSet.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.response;
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.toJsonString;
-
-import java.util.List;
-import java.util.UUID;
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
-
-public class AggregateCounterSet {
-	private String name;
-	private UUID user;
-	private UUID group;
-	private UUID queue;
-	private String category;
-	private List<AggregateCounter> values;
-
-	public AggregateCounterSet(String name, UUID user, UUID group,
-			String category, List<AggregateCounter> values) {
-		this.name = name;
-		this.user = user;
-		this.group = group;
-		this.category = category;
-		this.values = values;
-	}
-
-	public AggregateCounterSet(String name, UUID queue, String category,
-			List<AggregateCounter> values) {
-		this.name = name;
-		setQueue(queue);
-		this.category = category;
-		this.values = values;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getUser() {
-		return user;
-	}
-
-	public void setUser(UUID user) {
-		this.user = user;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getGroup() {
-		return group;
-	}
-
-	public void setGroup(UUID group) {
-		this.group = group;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getCategory() {
-		return category;
-	}
-
-	public void setCategory(String category) {
-		this.category = category;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<AggregateCounter> getValues() {
-		return values;
-	}
-
-	public void setValues(List<AggregateCounter> values) {
-		this.values = values;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getQueue() {
-		return queue;
-	}
-
-	public void setQueue(UUID queue) {
-		this.queue = queue;
-	}
-
-	@Override
-	public String toString() {
-		return toJsonString(this);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ApiResponse.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ApiResponse.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ApiResponse.java
deleted file mode 100644
index a87e293..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ApiResponse.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.response;
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.toJsonString;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
-import org.apache.usergrid.java.client.entities.Entity;
-import org.apache.usergrid.java.client.entities.Message;
-import org.apache.usergrid.java.client.entities.User;
-
-public class ApiResponse {
-
-	private String accessToken;
-
-	private String error;
-	private String errorDescription;
-	private String errorUri;
-	private String exception;
-
-	private String path;
-	private String uri;
-	private String status;
-	private long timestamp;
-	private UUID application;
-	private List<Entity> entities;
-	private UUID next;
-	private String cursor;
-	private String action;
-	private List<Object> list;
-	private Object data;
-	private Map<String, UUID> applications;
-	private Map<String, JsonNode> metadata;
-	private Map<String, List<String>> params;
-	private List<AggregateCounterSet> counters;
-	private ClientCredentialsInfo credentials;
-
-	private List<Message> messages;
-	private List<QueueInfo> queues;
-	private UUID last;
-	private UUID queue;
-	private UUID consumer;
-
-	private User user;
-
-	private final Map<String, JsonNode> properties = new HashMap<String, JsonNode>();
-
-	public ApiResponse() {
-	}
-
-	@JsonAnyGetter
-	public Map<String, JsonNode> getProperties() {
-		return properties;
-	}
-
-	@JsonAnySetter
-	public void setProperty(String key, JsonNode value) {
-		properties.put(key, value);
-	}
-
-	@JsonProperty("access_token")
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getAccessToken() {
-		return accessToken;
-	}
-
-	@JsonProperty("access_token")
-	public void setAccessToken(String accessToken) {
-		this.accessToken = accessToken;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getError() {
-		return error;
-	}
-
-	public void setError(String error) {
-		this.error = error;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	@JsonProperty("error_description")
-	public String getErrorDescription() {
-		return errorDescription;
-	}
-
-	@JsonProperty("error_description")
-	public void setErrorDescription(String errorDescription) {
-		this.errorDescription = errorDescription;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	@JsonProperty("error_uri")
-	public String getErrorUri() {
-		return errorUri;
-	}
-
-	@JsonProperty("error_uri")
-	public void setErrorUri(String errorUri) {
-		this.errorUri = errorUri;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getException() {
-		return exception;
-	}
-
-	public void setException(String exception) {
-		this.exception = exception;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getPath() {
-		return path;
-	}
-
-	public void setPath(String path) {
-		this.path = path;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getUri() {
-		return uri;
-	}
-
-	public void setUri(String uri) {
-		this.uri = uri;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getStatus() {
-		return status;
-	}
-
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	public long getTimestamp() {
-		return timestamp;
-	}
-
-	public void setTimestamp(long timestamp) {
-		this.timestamp = timestamp;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getApplication() {
-		return application;
-	}
-
-	public void setApplication(UUID application) {
-		this.application = application;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<Entity> getEntities() {
-		return entities;
-	}
-
-	public void setEntities(List<Entity> entities) {
-		this.entities = entities;
-	}
-
-	public int getEntityCount() {
-		if (entities == null) {
-			return 0;
-		}
-		return entities.size();
-	}
-
-	public Entity getFirstEntity() {
-		if ((entities != null) && (entities.size() > 0)) {
-			return entities.get(0);
-		}
-		return null;
-	}
-
-	public <T extends Entity> T getFirstEntity(Class<T> t) {
-		return Entity.toType(getFirstEntity(), t);
-	}
-
-	public Entity getLastEntity() {
-		if ((entities != null) && (entities.size() > 0)) {
-			return entities.get(entities.size() - 1);
-		}
-		return null;
-	}
-
-	public <T extends Entity> T getLastEntity(Class<T> t) {
-		return Entity.toType(getLastEntity(), t);
-	}
-
-	public <T extends Entity> List<T> getEntities(Class<T> t) {
-		return Entity.toType(entities, t);
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getNext() {
-		return next;
-	}
-
-	public void setNext(UUID next) {
-		this.next = next;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getCursor() {
-		return cursor;
-	}
-
-	public void setCursor(String cursor) {
-		this.cursor = cursor;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public String getAction() {
-		return action;
-	}
-
-	public void setAction(String action) {
-		this.action = action;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<Object> getList() {
-		return list;
-	}
-
-	public void setList(List<Object> list) {
-		this.list = list;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public Object getData() {
-		return data;
-	}
-
-	public void setData(Object data) {
-		this.data = data;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public Map<String, UUID> getApplications() {
-		return applications;
-	}
-
-	public void setApplications(Map<String, UUID> applications) {
-		this.applications = applications;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public Map<String, JsonNode> getMetadata() {
-		return metadata;
-	}
-
-	public void setMetadata(Map<String, JsonNode> metadata) {
-		this.metadata = metadata;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public Map<String, List<String>> getParams() {
-		return params;
-	}
-
-	public void setParams(Map<String, List<String>> params) {
-		this.params = params;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<AggregateCounterSet> getCounters() {
-		return counters;
-	}
-
-	public void setCounters(List<AggregateCounterSet> counters) {
-		this.counters = counters;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public ClientCredentialsInfo getCredentials() {
-		return credentials;
-	}
-
-	public void setCredentials(ClientCredentialsInfo credentials) {
-		this.credentials = credentials;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public User getUser() {
-		return user;
-	}
-
-	public void setUser(User user) {
-		this.user = user;
-	}
-
-	@Override
-	public String toString() {
-		return toJsonString(this);
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<Message> getMessages() {
-		return messages;
-	}
-
-	public void setMessages(List<Message> messages) {
-		this.messages = messages;
-	}
-
-	@JsonIgnore
-	public int getMessageCount() {
-		if (messages == null) {
-			return 0;
-		}
-		return messages.size();
-	}
-
-	@JsonIgnore
-	public Message getFirstMessage() {
-		if ((messages != null) && (messages.size() > 0)) {
-			return messages.get(0);
-		}
-		return null;
-	}
-
-	@JsonIgnore
-	public Entity getLastMessage() {
-		if ((messages != null) && (messages.size() > 0)) {
-			return messages.get(messages.size() - 1);
-		}
-		return null;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getLast() {
-		return last;
-	}
-
-	public void setLast(UUID last) {
-		this.last = last;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public List<QueueInfo> getQueues() {
-		return queues;
-	}
-
-	public void setQueues(List<QueueInfo> queues) {
-		this.queues = queues;
-	}
-
-	@JsonIgnore
-	public QueueInfo getFirstQueue() {
-		if ((queues != null) && (queues.size() > 0)) {
-			return queues.get(0);
-		}
-		return null;
-	}
-
-	@JsonIgnore
-	public QueueInfo getLastQueue() {
-		if ((queues != null) && (queues.size() > 0)) {
-			return queues.get(queues.size() - 1);
-		}
-		return null;
-	}
-
-	@JsonIgnore
-	public UUID getLastQueueId() {
-		QueueInfo q = getLastQueue();
-		if (q != null) {
-			return q.getQueue();
-		}
-		return null;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getQueue() {
-		return queue;
-	}
-
-	public void setQueue(UUID queue) {
-		this.queue = queue;
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public UUID getConsumer() {
-		return consumer;
-	}
-
-	public void setConsumer(UUID consumer) {
-		this.consumer = consumer;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ClientCredentialsInfo.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ClientCredentialsInfo.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ClientCredentialsInfo.java
deleted file mode 100644
index 7ac6b36..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/ClientCredentialsInfo.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.response;
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.toJsonString;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class ClientCredentialsInfo {
-
-	private String id;
-	private String secret;
-
-	public ClientCredentialsInfo(String id, String secret) {
-		this.id = id;
-		this.secret = secret;
-	}
-
-	@JsonProperty("client_id")
-	public String getId() {
-		return id;
-	}
-
-	@JsonProperty("client_id")
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	@JsonProperty("client_secret")
-	public String getSecret() {
-		return secret;
-	}
-
-	@JsonProperty("client_secret")
-	public void setSecret(String secret) {
-		this.secret = secret;
-	}
-
-	@Override
-	public String toString() {
-		return toJsonString(this);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/QueueInfo.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/QueueInfo.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/QueueInfo.java
deleted file mode 100644
index 04fe717..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/QueueInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.response;
-
-import java.util.UUID;
-
-public class QueueInfo {
-
-	String path;
-	UUID queue;
-
-	public QueueInfo() {
-	}
-
-	public String getPath() {
-		return path;
-	}
-
-	public void setPath(String path) {
-		this.path = path;
-	}
-
-	public UUID getQueue() {
-		return queue;
-	}
-
-	public void setQueue(UUID queue) {
-		this.queue = queue;
-	}
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
new file mode 100644
index 0000000..8618d94
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponse.java
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.response;
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.databind.JsonNode;
+import okhttp3.Headers;
+import org.apache.usergrid.java.client.UsergridClient;
+import org.apache.usergrid.java.client.UsergridEnums;
+import org.apache.usergrid.java.client.UsergridRequest;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.model.UsergridUser;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.utils.JsonUtils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+import static org.apache.usergrid.java.client.utils.JsonUtils.toJsonString;
+
+@SuppressWarnings("unused")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class UsergridResponse {
+
+    @Nullable private UsergridClient client;
+    @NotNull private Map<String, JsonNode> properties = new HashMap<>();
+
+    private int statusCode = 0;
+    @Nullable private JsonNode responseJson = null;
+    @Nullable private String cursor;
+    @Nullable private List<UsergridEntity> entities;
+    @Nullable private Map<String, String> headers;
+    @Nullable private UsergridQuery query;
+    @Nullable private UsergridResponseError responseError = null;
+
+    @Nullable private String accessToken;
+    @Nullable private Long expires;
+
+    public boolean ok() { return (statusCode > 0 && statusCode < 400); }
+    public int count()  { return (entities == null) ? 0 : entities.size(); }
+    public boolean hasNextPage() { return (cursor != null); }
+    @NotNull @Override public String toString() {
+        return toJsonString(this);
+    }
+
+    @Nullable public UsergridEntity first() { return (entities == null || entities.isEmpty()) ? null : entities.get(0); }
+    @Nullable public UsergridEntity entity() {
+        return first();
+    }
+    @Nullable public UsergridEntity last() { return (entities == null || entities.isEmpty()) ? null : entities.get(entities.size() - 1); }
+
+    @Nullable
+    public UsergridUser user() {
+        UsergridEntity entity = this.first();
+        if( entity != null && entity instanceof UsergridUser ) {
+            return (UsergridUser) entity;
+        }
+        return null;
+    }
+
+    @Nullable
+    public List<UsergridUser> users() {
+        ArrayList<UsergridUser> users = null;
+        if( entities != null && !entities.isEmpty() ) {
+            for( UsergridEntity entity : entities ) {
+                if( entity instanceof UsergridUser ) {
+                    if( users == null )  {
+                        users = new ArrayList<>();
+                    }
+                    users.add((UsergridUser)entity);
+                }
+            }
+        }
+        return users;
+    }
+
+    public int getStatusCode() { return this.statusCode; }
+
+    @Nullable @JsonIgnore
+    public UsergridClient getClient() {
+        return client;
+    }
+    @JsonIgnore public void setClient(@Nullable final UsergridClient client) { this.client = client; }
+
+    @Nullable @JsonIgnore
+    public JsonNode getResponseJson() {
+        return responseJson;
+    }
+    private void setResponseJson(@Nullable final JsonNode responseJson) {this.responseJson = responseJson; }
+
+    @Nullable @JsonIgnore
+    public UsergridQuery getQuery() {
+        return query;
+    }
+    private void setQuery(@Nullable final UsergridQuery query) { this.query = query; }
+
+    @Nullable
+    public UsergridResponseError getResponseError() {
+        return responseError;
+    }
+    private void setResponseError(@Nullable final UsergridResponseError responseError) { this.responseError = responseError; }
+
+    @Nullable
+    public Map<String, String> getHeaders() {
+        return headers;
+    }
+    private void setHeaders(@Nullable final Map<String, String> headers) { this.headers = headers; }
+
+    @Nullable
+    public List<UsergridEntity> getEntities() { return entities; }
+    private void setEntities(@NotNull final List<UsergridEntity> entities) { this.entities = entities; }
+
+    @Nullable @JsonProperty("cursor")
+    public String getCursor() {
+        return cursor;
+    }
+    @JsonProperty("cursor")
+    private void setCursor(@NotNull final String cursor) { this.cursor = cursor; }
+
+    @Nullable @JsonProperty("access_token")
+    public String getAccessToken() { return this.accessToken; }
+    @JsonProperty("access_token")
+    private void setAccessToken(@NotNull final String accessToken) { this.accessToken = accessToken; }
+
+    @Nullable @JsonProperty("expires_in")
+    public Long getExpires() { return this.expires; }
+    @JsonProperty("expires_in")
+    private void setExpires(@NotNull final Long expires) { this.expires = expires; }
+
+    @JsonProperty("user")
+    private void setUser(@NotNull final UsergridUser user) {
+        if( this.entities == null ) {
+            this.entities = new ArrayList<>();
+        }
+        this.entities.add(user);
+    }
+
+    @NotNull @JsonAnyGetter
+    public Map<String, JsonNode> getProperties() {
+        return properties;
+    }
+    @JsonAnySetter
+    private void setProperty(@NotNull final  String key, @NotNull final JsonNode value) {
+        properties.put(key, value);
+    }
+
+    @NotNull
+    public UsergridResponse loadNextPage() {
+        UsergridClient client = this.client;
+        UsergridEntity entity = this.first();
+        if( this.hasNextPage() && client != null && entity != null ) {
+            Map<String, Object> paramsMap = new HashMap<>();
+            paramsMap.put("cursor", getCursor());
+            UsergridRequest request = new UsergridRequest(UsergridEnums.UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, client.clientAppUrl(), paramsMap, null, null, this.getQuery(), client.authForRequests() , entity.getType());
+            return client.sendRequest(request);
+        } else {
+            return UsergridResponse.fromError(client,"Error Loading Next Page.","Unable to load next page.");
+        }
+    }
+
+    @NotNull
+    public static UsergridResponse fromError(@Nullable final UsergridClient client, @NotNull final String errorName, @NotNull final String errorDescription) {
+        UsergridResponse response = new UsergridResponse();
+        response.client = client;
+        response.responseError = new UsergridResponseError(errorName,errorDescription);
+        return response;
+    }
+
+    @NotNull
+    public static UsergridResponse fromException(@Nullable final UsergridClient client, @NotNull final Exception ex) {
+        UsergridResponse response = new UsergridResponse();
+        response.client = client;
+        response.responseError = new UsergridResponseError(ex.getClass().toString(), ex.getMessage(), ex.getCause().toString());
+        return response;
+    }
+
+    @NotNull
+    public static UsergridResponse fromResponse(@NotNull final UsergridClient client, @NotNull final UsergridRequest request, @NotNull final okhttp3.Response requestResponse) {
+        UsergridResponse response;
+        JsonNode responseJson;
+        try {
+            String responseJsonString = requestResponse.body().string();
+            responseJson = JsonUtils.mapper.readTree(responseJsonString);
+        } catch ( Exception e ) {
+            return UsergridResponse.fromException(client,e);
+        }
+        if ( responseJson.has("error") )  {
+            response = new UsergridResponse();
+            response.responseError = JsonUtils.fromJsonNode(responseJson,UsergridResponseError.class);
+        } else {
+            response = JsonUtils.fromJsonNode(responseJson,UsergridResponse.class);
+        }
+        response.client = client;
+        response.responseJson = responseJson;
+        response.statusCode = requestResponse.code();
+
+        Headers responseHeaders = requestResponse.headers();
+        HashMap<String,String> headers = new HashMap<>();
+        for (int i = 0; i < responseHeaders.size(); i++) {
+            headers.put(responseHeaders.name(i),responseHeaders.value(i));
+        }
+
+        response.headers = headers;
+        response.query = request.getQuery();
+        return response;
+    }
+}


[35/54] [abbrv] usergrid git commit: Added fixes around caching and changed the endpoint to selective indexing to be /_index instead of /_indexes

Posted by mr...@apache.org.
Added fixes around caching and changed the endpoint to selective indexing to be /_index instead of /_indexes


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

Branch: refs/heads/apm
Commit: 262269082e67d24cd1904efe658b7f92db3f9a25
Parents: 70da5a2
Author: George Reyes <gr...@apache.org>
Authored: Fri Apr 22 14:45:07 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Fri Apr 22 14:45:07 2016 -0700

----------------------------------------------------------------------
 .../index/IndexSchemaCacheFig.java              |  2 +-
 .../index/IndexSchemaCacheImpl.java             |  3 +-
 .../rest/applications/CollectionResource.java   |  8 ++---
 .../collection/CollectionsResourceIT.java       | 38 ++++++++++----------
 4 files changed, 24 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/26226908/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheFig.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheFig.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheFig.java
index 0953abd..a99b48e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheFig.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheFig.java
@@ -33,7 +33,7 @@ public interface IndexSchemaCacheFig extends GuicyFig {
     int getCacheSize();
 
     @Key( "usergrid.index_schema_cache_timeout_ms" )
-    @Default( "60000" )
+    @Default( "15000" )
     int getCacheTimeout();
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/26226908/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
index fd0b676..d4bade4 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
@@ -19,6 +19,7 @@ package org.apache.usergrid.corepersistence.index;
 
 
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -49,7 +50,7 @@ public class IndexSchemaCacheImpl implements IndexSchemaCache {
         this.mapManager = mapManager;
         indexSchemaCache = CacheBuilder.newBuilder()
             .maximumSize( indexSchemaCacheFig.getCacheSize() )
-            //.expireAfterWrite( indexSchemaCacheFig.getCacheTimeout(), TimeUnit.MILLISECONDS ) <-- I don't think we want this to expire that quickly.
+            .expireAfterWrite( indexSchemaCacheFig.getCacheTimeout(), TimeUnit.MILLISECONDS )
             .build( new CacheLoader<String, Optional<Map>>() {
                 @Override
                 public Optional<Map> load( final String collectionName ) throws Exception {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/26226908/stack/rest/src/main/java/org/apache/usergrid/rest/applications/CollectionResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/CollectionResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/CollectionResource.java
index 5bd895c..1e94832 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/CollectionResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/CollectionResource.java
@@ -91,7 +91,7 @@ public class CollectionResource extends ServiceResource {
      * @throws Exception
      */
     @POST
-    @Path( "{itemName}/_indexes" )
+    @Path( "{itemName}/_index" )
     @Produces({ MediaType.APPLICATION_JSON,"application/javascript"})
     @RequireApplicationAccess
     @JSONP
@@ -153,7 +153,7 @@ public class CollectionResource extends ServiceResource {
     }
 
     @DELETE
-    @Path( "{itemName}/_indexes" )
+    @Path( "{itemName}/_index" )
     @Produces({ MediaType.APPLICATION_JSON,"application/javascript"})
     @RequireApplicationAccess
     @JSONP
@@ -222,10 +222,6 @@ public class CollectionResource extends ServiceResource {
 
         addItemToServiceContext( ui, itemName );
 
-//        final ReIndexRequestBuilder request =
-//            createRequest().withApplicationId( services.getApplicationId() ).withCollection(
-//                String.valueOf( getServiceParameters().get( 0 ) ) ).withDelay( 50, TimeUnit.MILLISECONDS );
-//
         IndexResource indexResource = new IndexResource(injector);
         return indexResource.rebuildIndexesPost( services.getApplicationId().toString(),itemName.getPath(),false,callback );
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/26226908/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index 0e682a7..db07c3f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@ -136,7 +136,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
         try {
 
-            this.pathResource( getOrgAppPath( "testcollections/_indexes" ) ).post( false, payload,
+            this.pathResource( getOrgAppPath( "testcollections/_index" ) ).post( false, payload,
                 new QueryParameters().addParam( "grant_type", "client_credentials" ).addParam( "client_id",
                     String.valueOf( ( ( Map ) appCredentials.get( "credentials" ) ).get( "client_id" ) ) )
                                      .addParam( "client_secret", String.valueOf(
@@ -167,7 +167,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        Entity thing = this.app().collection( "testCollections" ).collection( "_indexes" ).post( payload );
+        Entity thing = this.app().collection( "testCollections" ).collection( "_index" ).post( payload );
         refreshIndex();
 
 
@@ -206,7 +206,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         //to prove that the entity exists
 
         //next part is to delete the schema then reindex it and it should work.
-        this.app().collection( "testCollections" ).collection( "_indexes" ).delete();
+        this.app().collection( "testCollections" ).collection( "_index" ).delete();
         refreshIndex();
 
         this.app().collection( "testCollections" ).collection( "_reindex" )
@@ -245,7 +245,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
         //Post index to the collection metadata
         try {
-            this.app().collection( "testCollections" ).collection( "_indexes" ).post( payload );
+            this.app().collection( "testCollections" ).collection( "_index" ).post( payload );
             fail();
         }catch(BadRequestException bre){
             //this is expected.
@@ -259,7 +259,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingMap);
 
         try {
-            this.app().collection( "testCollections" ).collection( "_indexes" ).post( payload );
+            this.app().collection( "testCollections" ).collection( "_index" ).post( payload );
             fail();
         }catch(BadRequestException bre){
             //this is expected.
@@ -269,7 +269,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         try {
-            this.app().collection( "testCollections" ).collection( "_indexes" ).post( payload );
+            this.app().collection( "testCollections" ).collection( "_index" ).post( payload );
         }catch(BadRequestException bre){
             fail( "This shouldn't fail" );
         }
@@ -292,7 +292,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        Entity thing = this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        Entity thing = this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
 
@@ -366,7 +366,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        Entity thing = this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        Entity thing = this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
 
@@ -417,7 +417,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        Entity thing = this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        Entity thing = this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         Collection collection = this.app().collection( "testCollection" ).collection( "_index" ).get();
@@ -445,7 +445,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
 
         collection = this.app().collection( "testCollection" ).collection( "_index" ).get();
 
@@ -497,7 +497,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         //Create test collection with a test entity that is partially indexed.
@@ -539,7 +539,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         Map<String,Object> arrayFieldsForTesting = new HashMap<>();
@@ -589,7 +589,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         Map<String,Object> arrayFieldsForTesting = new HashMap<>();
@@ -632,7 +632,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         Map<String,Object> arrayFieldsForTestingSelectiveIndexing = new HashMap<>();
@@ -687,7 +687,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         Map<String,Object> arrayFieldsForTestingSelectiveIndexing = new HashMap<>();
@@ -738,7 +738,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         //Post index to the collection metadata
-        this.app().collection( "testCollection" ).collection( "_indexes" ).post( payload );
+        this.app().collection( "testCollection" ).collection( "_index" ).post( payload );
         refreshIndex();
 
         //Create test collection with a test entity that is partially indexed.
@@ -961,7 +961,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
         String randomizer = RandomStringUtils.randomAlphanumeric(10);
         String collectionName = "col_" + randomizer;
-        app().collection( collectionName ).collection( "_indexes" ).post( payload );
+        app().collection( collectionName ).collection( "_index" ).post( payload );
         refreshIndex();
 
         // was the no-index wildcard saved and others ignored?
@@ -1009,7 +1009,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
         String randomizer = RandomStringUtils.randomAlphanumeric(10);
         String unIndexedCollectionName = "col_" + randomizer;
-        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload );
+        app().collection( unIndexedCollectionName ).collection( "_index" ).post( payload );
         refreshIndex();
 
         String entityName1 = "unindexed1";
@@ -1070,7 +1070,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put( "fields", indexingArray);
 
         String unIndexedCollectionName = "col_" + randomizer;
-        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload );
+        app().collection( unIndexedCollectionName ).collection( "_index" ).post( payload );
         refreshIndex();
 
         String entityName1 = "unindexed1";


[19/54] [abbrv] usergrid git commit: Add a separate executor pool for async processing instead of unbounded Schedulers.io()

Posted by mr...@apache.org.
Add a separate executor pool for async processing instead of unbounded Schedulers.io()


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

Branch: refs/heads/apm
Commit: f272af2f3b41ce6ded649ffcd7410f23e33587fb
Parents: 6488b05
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 19:50:41 2016 +0100
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 19:50:41 2016 +0100

----------------------------------------------------------------------
 .../services/notifications/TaskManager.java     | 96 +++++++++-----------
 .../impl/ApplicationQueueManagerImpl.java       | 86 +++++++++++++-----
 2 files changed, 105 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f272af2f/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
index ce2b82c..531ca7c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
@@ -37,12 +37,10 @@ public class TaskManager {
     private AtomicLong successes = new AtomicLong();
     private AtomicLong failures = new AtomicLong();
     private EntityManager em;
-    private boolean hasFinished;
 
     public TaskManager(EntityManager em, Notification notification) {
         this.em = em;
         this.notification = notification;
-        hasFinished = false;
     }
 
     public long getSuccesses(){return successes.get();}
@@ -53,77 +51,69 @@ public class TaskManager {
         completed(notifier,null,deviceUUID,null);
     }
     public void completed(Notifier notifier, Receipt receipt, UUID deviceUUID, String newProviderId) throws Exception {
-        if (logger.isTraceEnabled()) {
-            logger.trace("REMOVED {}", deviceUUID);
-        }
+
+        successes.incrementAndGet();
+
         try {
-            if (logger.isTraceEnabled()) {
-                logger.trace("notification {} removing device {} from remaining", notification.getUuid(), deviceUUID);
-            }
 
             EntityRef deviceRef = new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID);
+
             if (receipt != null) {
-                if (logger.isTraceEnabled()) {
-                    logger.trace("notification {} sent to device {}. saving receipt.", notification.getUuid(), deviceUUID);
-                }
+
                 receipt.setSent(System.currentTimeMillis());
                 this.saveReceipt(notification, deviceRef, receipt,false);
                 if (logger.isTraceEnabled()) {
-                    logger.trace("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
+                    logger.trace("Notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
                 }
-                successes.incrementAndGet();
+
             }
 
             if (newProviderId != null) {
                 if (logger.isTraceEnabled()) {
-                    logger.trace("notification {} replacing device {} notifierId", notification.getUuid(), deviceUUID);
+                    logger.trace("Notification {} replacing notifier id for device {} ", notification.getUuid(), deviceUUID);
                 }
                 replaceProviderId(deviceRef, notifier, newProviderId);
             }
 
             if (logger.isTraceEnabled()) {
-                logger.trace("notification {} completed device {}", notification.getUuid(), deviceUUID);
+                logger.trace("Notification {} sending completed for device {}", notification.getUuid(), deviceUUID);
             }
 
-        } finally {
-            if (logger.isTraceEnabled()) {
-                logger.trace("COUNT is: {}", successes.get());
-            }
-//            if (hasFinished) { //process has finished but notifications are still coming in
-//                finishedBatch();
-//
-//            }
+        } catch(Exception e) {
+
+            logger.error("Unable to mark notification {} as completed due to: {}", notification.getUuid(), e);
+
         }
     }
 
     public void failed(Notifier notifier, Receipt receipt, UUID deviceUUID, Object code, String message) throws Exception {
 
+        failures.incrementAndGet();
+
         try {
             if (logger.isDebugEnabled()) {
-                logger.debug("notification {} for device {} got error {}", notification.getUuid(), deviceUUID, code);
+                logger.debug("Notification {} for device {} got error {}", notification.getUuid(), deviceUUID, code);
             }
 
-            failures.incrementAndGet();
-            if(receipt!=null) {
-                if ( receipt.getUuid() != null ) {
-                    successes.decrementAndGet();
-                }
+            if(receipt != null) {
                 receipt.setErrorCode( code );
                 receipt.setErrorMessage( message );
                 this.saveReceipt( notification, new SimpleEntityRef( Device.ENTITY_TYPE, deviceUUID ), receipt, true );
-                if ( logger.isDebugEnabled() ) {
-                    logger.debug( "notification {} receipt saved for device {}", notification.getUuid(), deviceUUID );
-                }
             }
-        } finally {
+
             completed(notifier, deviceUUID);
             finishedBatch();
+
+        } catch (Exception e){
+
+            logger.error("Unable to finish marking notification {} as failed due to error: ", notification.getUuid(), e);
+
         }
     }
 
-    /*
-    * called from TaskManager - creates a persistent receipt and updates the
-    * passed one w/ the UUID
+    /**
+    * Called from TaskManager - Creates a persistent receipt
+    *
     */
     private void saveReceipt(EntityRef notification, EntityRef device, Receipt receipt, boolean hasError) throws Exception {
 
@@ -142,11 +132,16 @@ public class TaskManager {
             } else {
                 em.addToCollections(entities, Notification.RECEIPTS_COLLECTION, receipt);
             }
+
+            if ( logger.isDebugEnabled() ) {
+                logger.debug( "Notification {} receipt saved for device {}", notification.getUuid(), device.getUuid() );
+            }
+
         }
 
     }
 
-    protected void replaceProviderId(EntityRef device, Notifier notifier,
+    private void replaceProviderId(EntityRef device, Notifier notifier,
                                      String newProviderId) throws Exception {
         Object value = em.getProperty(device, notifier.getName()
                 + ApplicationQueueManager.NOTIFIER_ID_POSTFIX);
@@ -161,33 +156,24 @@ public class TaskManager {
         }
     }
 
-    public void finishedBatch() throws Exception {
-        finishedBatch(true);
-    }
 
-    public void finishedBatch(boolean refreshNotification) throws Exception {
-
-        long successes = this.successes.get(); //reset counters
-        long failures = this.failures.get(); //reset counters
+    public void finishedBatch() throws Exception {
 
-        for (int i = 0; i < successes; i++) {
-            this.successes.decrementAndGet();
-        }
-        for (int i = 0; i < failures; i++) {
-            this.failures.decrementAndGet();
-        }
+        long successes = this.successes.get();
+        long failures = this.failures.get();
 
-        this.hasFinished = true;
+        // reset the counters
+        this.successes.set(0);
+        this.failures.set(0);
 
-        // force refresh notification by fetching it
-        if (refreshNotification) {
-            notification = em.get(this.notification.getUuid(), Notification.class);
-        }
+        // get the latest notification info
+        notification = em.get(this.notification.getUuid(), Notification.class);
 
         notification.updateStatistics(successes, failures);
         notification.setModified(System.currentTimeMillis());
         notification.setFinished(notification.getModified());
 
         em.update(notification);
+
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f272af2f/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 2f39ae4..1bb92b7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -19,6 +19,7 @@ package org.apache.usergrid.services.notifications.impl;
 import com.codahale.metrics.Meter;
 import org.apache.usergrid.batch.JobExecution;
 import org.apache.usergrid.persistence.*;
+import org.apache.usergrid.persistence.core.executor.TaskExecutorFactory;
 import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
 import org.apache.usergrid.persistence.entities.*;
 import org.apache.usergrid.persistence.Query;
@@ -52,11 +53,19 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
     private final Meter queueMeter;
     private final Meter sendMeter;
 
+    private final static String PUSH_PROCESSING_MAXTHREADS_PROP = "usergrid.push.async.processing.threads";
+    private final static String PUSH_PROCESSING_QUEUESIZE_PROP = "usergrid.push.async.processing.queue.size";
     private final static String PUSH_PROCESSING_CONCURRENCY_PROP = "usergrid.push.async.processing.concurrency";
 
     HashMap<Object, ProviderAdapter> notifierHashMap; // only retrieve notifiers once
 
 
+
+    private final ExecutorService asyncExecutor;
+
+
+
+
     public ApplicationQueueManagerImpl( JobScheduler jobScheduler, EntityManager entityManager,
                                         QueueManager queueManager, MetricsFactory metricsFactory,
                                         Properties properties) {
@@ -65,8 +74,31 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         this.jobScheduler = jobScheduler;
         this.metricsFactory = metricsFactory;
         this.queueName = getQueueNames(properties);
-        queueMeter = metricsFactory.getMeter(ApplicationQueueManagerImpl.class, "notification.queue");
-        sendMeter = metricsFactory.getMeter(NotificationsService.class, "queue.send");
+        this.queueMeter = metricsFactory.getMeter(ApplicationQueueManagerImpl.class, "notification.queue");
+        this.sendMeter = metricsFactory.getMeter(NotificationsService.class, "queue.send");
+
+        int maxAsyncThreads;
+        int workerQueueSize;
+
+        try {
+
+            maxAsyncThreads = Integer.valueOf(System.getProperty(PUSH_PROCESSING_MAXTHREADS_PROP, "200"));
+            workerQueueSize = Integer.valueOf(System.getProperty(PUSH_PROCESSING_QUEUESIZE_PROP, "2000"));
+
+        } catch (Exception e){
+
+            // if junk is passed into the property, just default the values
+            maxAsyncThreads = 200;
+            workerQueueSize = 2000;
+
+        }
+
+
+        // create our own executor which has a bounded queue w/ caller runs policy for rejected tasks
+        this.asyncExecutor = TaskExecutorFactory
+            .createTaskExecutor( "push-device-io", maxAsyncThreads, workerQueueSize,
+                TaskExecutorFactory.RejectionAction.CALLERRUNS );
+
 
     }
 
@@ -296,7 +328,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                             }
 
 
-                        }).subscribeOn(Schedulers.io());
+                        }).subscribeOn(Schedulers.from(asyncExecutor));
 
                 }, Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50")))
                 .doOnError(throwable -> {
@@ -327,7 +359,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                 });
 
-            processMessagesObservable.subscribeOn(Schedulers.io()).subscribe(); // fire the queuing into the background
+            processMessagesObservable.subscribeOn(Schedulers.from(asyncExecutor)).subscribe(); // fire the queuing into the background
 
         }
 
@@ -348,7 +380,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         // if no devices, go ahead and mark the batch finished
         if (deviceCount.get() <= 0 ) {
             TaskManager taskManager = new TaskManager(em, notification);
-            taskManager.finishedBatch(true);
+            taskManager.finishedBatch();
         }
 
 
@@ -540,32 +572,43 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
 
     /**
-     * Validates that a notifier and adapter exists to send notifications to;
-     * {"winphone":"mymessage","apple":"mymessage"}
-     * TODO: document this method better
+     *  Validates that a notifier and adapter exists to send notifications to. For the example payload
+     *
+     *  { "payloads" : {"winphone":"mymessage","apple":"mymessage"} }
+     *
+     *  Notifiers with name "winphone" and "apple" must exist.
      */
-    private Map<String, Object> translatePayloads(Map<String, Object> payloads, Map<Object, ProviderAdapter>
-        notifierMap) throws Exception {
-        Map<String, Object> translatedPayloads = new HashMap<String, Object>(payloads.size());
+    private Map<String, Object> translatePayloads(Map<String, Object> payloads,
+                                                  Map<Object, ProviderAdapter> notifierMap) throws Exception {
+
+        final Map<String, Object> translatedPayloads = new HashMap<String, Object>(payloads.size());
+
         for (Map.Entry<String, Object> entry : payloads.entrySet()) {
+
             String payloadKey = entry.getKey().toLowerCase();
             Object payloadValue = entry.getValue();
+
             //look for adapter from payload map
             ProviderAdapter providerAdapter = notifierMap.get(payloadKey);
             if (providerAdapter != null) {
+
                 //translate payload to usable information
                 Object translatedPayload = payloadValue != null ? providerAdapter.translatePayload(payloadValue) : null;
                 if (translatedPayload != null) {
                     translatedPayloads.put(payloadKey, translatedPayload);
                 }
+
             }
         }
         return translatedPayloads;
     }
 
     public static String getQueueNames(Properties properties) {
-        String name = properties.getProperty(ApplicationQueueManagerImpl.DEFAULT_QUEUE_PROPERTY, ApplicationQueueManagerImpl.DEFAULT_QUEUE_NAME);
+
+        String name = properties.getProperty(ApplicationQueueManagerImpl.DEFAULT_QUEUE_PROPERTY,
+            ApplicationQueueManagerImpl.DEFAULT_QUEUE_NAME);
         return name;
+
     }
 
     private static final class IteratorObservable<T> implements rx.Observable.OnSubscribe<T> {
@@ -585,15 +628,15 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
             try {
                 while (!subscriber.isUnsubscribed() && input.hasNext()) {
+
                     //send our input to the next
-                    //logger.debug("calling next on iterator: {}", input.getClass().getSimpleName());
                     subscriber.onNext((T) input.next());
+
                 }
 
                 //tell the subscriber we don't have any more data
-                //logger.debug("finished iterator: {}", input.getClass().getSimpleName());
-
                 subscriber.onCompleted();
+
             } catch (Throwable t) {
                 logger.error("failed on subscriber", t);
                 subscriber.onError(t);
@@ -617,10 +660,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                     }
                 }
             } catch (Exception e) {
-                logger.error("checkForInactiveDevices", e); // not
-                // essential so
-                // don't fail,
-                // but log
+                // not essential so don't fail, but log
+                logger.error("checkForInactiveDevices", e);
+
             }
         }
     }
@@ -630,14 +672,14 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
         if (notification.getCanceled() == Boolean.TRUE) {
             if (logger.isDebugEnabled()) {
-                logger.debug("notification {} canceled. not sending.",
+                logger.debug("Notification {} canceled. Not sending.",
                     notification.getUuid());
             }
             return false;
         }
         if (notification.isExpired()) {
             if (logger.isDebugEnabled()) {
-                logger.debug("notification {} expired. not sending.",
+                logger.debug("Notification {} expired. Not sending.",
                     notification.getUuid());
             }
             return false;
@@ -654,7 +696,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
             }
             return value != null ? value.toString() : null;
         } catch (Exception e) {
-            logger.error("Error getting provider ID, proceeding with rest of batch", e);
+            logger.error("Error getting notifier for device {}, proceeding with rest of batch", device, e);
             return null;
         }
     }


[34/54] [abbrv] usergrid git commit: Tweak heap status to return used heap, and changed endpoint to status/heap.

Posted by mr...@apache.org.
Tweak heap status to return used heap, and changed endpoint to status/heap.


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

Branch: refs/heads/apm
Commit: 70da5a2c01e71ec6f72895222a237537eb91a4e4
Parents: 11ee98a
Author: Mike Dunker <md...@apigee.com>
Authored: Thu Apr 21 11:07:08 2016 -0700
Committer: Mike Dunker <md...@apigee.com>
Committed: Thu Apr 21 11:07:08 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/usergrid/rest/RootResource.java   | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/70da5a2c/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
index 9701105..b8abe54 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
@@ -249,22 +249,24 @@ public class RootResource extends AbstractContextResource implements MetricProce
     }
 
     @GET
-    @Path("/status/memory")
+    @Path("/status/heap")
     @JSONP
     @Produces({MediaType.APPLICATION_JSON, "application/javascript"})
-    public ApiResponse getMemoryStats(){
+    public ApiResponse getHeapStats(){
 
         ApiResponse response = createApiResponse();
 
         ObjectNode node = JsonNodeFactory.instance.objectNode();
 
-        long heapSize = Runtime.getRuntime().totalMemory();
+        long heapAllocatedSize = Runtime.getRuntime().totalMemory();
         long heapMaxSize = Runtime.getRuntime().maxMemory();
         long heapFreeSize = Runtime.getRuntime().freeMemory();
+        long heapUsedSize = heapAllocatedSize - heapFreeSize;
 
-        node.put( "currentHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapSize) );
-        node.put( "maxHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapMaxSize) );
-        node.put( "freeHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapFreeSize) );
+        node.put( "used", org.apache.usergrid.utils.StringUtils.readableByteSize(heapUsedSize) );
+        node.put( "free", org.apache.usergrid.utils.StringUtils.readableByteSize(heapFreeSize) );
+        node.put( "allocated", org.apache.usergrid.utils.StringUtils.readableByteSize(heapAllocatedSize) );
+        node.put( "max", org.apache.usergrid.utils.StringUtils.readableByteSize(heapMaxSize) );
 
         response.setProperty( "status", node );
         return response;


[38/54] [abbrv] usergrid git commit: Ensure the hector cluster is created with credentials from the properties file.

Posted by mr...@apache.org.
Ensure the hector cluster is created with credentials from the properties file.


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

Branch: refs/heads/apm
Commit: c07cdb56c995cedfd776603c8c2ea97039cf7bfa
Parents: 2622690
Author: Michael Russo <mr...@apigee.com>
Authored: Tue Apr 26 17:00:08 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Tue Apr 26 17:00:08 2016 -0700

----------------------------------------------------------------------
 stack/core/src/main/resources/usergrid-core-context.xml | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/c07cdb56/stack/core/src/main/resources/usergrid-core-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/main/resources/usergrid-core-context.xml b/stack/core/src/main/resources/usergrid-core-context.xml
index 1087f25..4a3e402 100644
--- a/stack/core/src/main/resources/usergrid-core-context.xml
+++ b/stack/core/src/main/resources/usergrid-core-context.xml
@@ -61,9 +61,15 @@
         <property name="loadBalancingPolicy" ref="loadBalancingPolicy"/>
 	</bean>
 
+    <util:map id="cassandraCredentials" map-class="java.util.HashMap">
+        <entry key="username" value="${cassandra.username}" />
+        <entry key="password" value="${cassandra.password}" />
+    </util:map>
+
 	<bean id="cassandraCluster" class="me.prettyprint.cassandra.service.ThriftCluster">
 		<constructor-arg value="${cassandra.cluster}" />
 		<constructor-arg ref="cassandraHostConfigurator" />
+        <constructor-arg ref="cassandraCredentials" />
 	</bean>
 
     <bean id="loadBalancingPolicy" class="me.prettyprint.cassandra.connection.DynamicLoadBalancingPolicy"/>


[49/54] [abbrv] usergrid git commit: Merge branch 'javaSDK' of https://github.com/RobertWalsh/usergrid

Posted by mr...@apache.org.
Merge branch 'javaSDK' of https://github.com/RobertWalsh/usergrid


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

Branch: refs/heads/apm
Commit: 8f8b46729cf3faa3fb6c425ae5e8ec54f6c2de9f
Parents: e4beaea 07d5ee2
Author: George Reyes <gr...@apache.org>
Authored: Thu May 19 10:16:45 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Thu May 19 10:16:45 2016 -0700

----------------------------------------------------------------------
 sdks/java/README.md                             |  598 +++++++-
 sdks/java/pom.xml                               |   73 +-
 .../org/apache/usergrid/java/client/Client.java | 1292 ------------------
 .../apache/usergrid/java/client/Usergrid.java   |  285 ++++
 .../usergrid/java/client/UsergridClient.java    |  427 ++++++
 .../java/client/UsergridClientConfig.java       |   60 +
 .../usergrid/java/client/UsergridEnums.java     |  170 +++
 .../usergrid/java/client/UsergridRequest.java   |  205 +++
 .../java/client/UsergridRequestManager.java     |   86 ++
 .../java/client/auth/UsergridAppAuth.java       |   55 +
 .../usergrid/java/client/auth/UsergridAuth.java |   75 +
 .../java/client/auth/UsergridUserAuth.java      |   56 +
 .../usergrid/java/client/entities/Activity.java |  625 ---------
 .../usergrid/java/client/entities/Device.java   |   68 -
 .../usergrid/java/client/entities/Entity.java   |  191 ---
 .../usergrid/java/client/entities/Group.java    |   79 --
 .../usergrid/java/client/entities/Message.java  |  148 --
 .../usergrid/java/client/entities/User.java     |  158 ---
 .../java/client/exception/ClientException.java  |   41 -
 .../client/exception/UsergridException.java     |   50 +
 .../java/client/model/UsergridDevice.java       |   60 +
 .../java/client/model/UsergridEntity.java       |  487 +++++++
 .../java/client/model/UsergridUser.java         |  198 +++
 .../java/client/query/UsergridQuery.java        |  434 ++++++
 .../java/client/response/AggregateCounter.java  |   52 -
 .../client/response/AggregateCounterSet.java    |  111 --
 .../java/client/response/ApiResponse.java       |  421 ------
 .../client/response/ClientCredentialsInfo.java  |   58 -
 .../java/client/response/QueueInfo.java         |   44 -
 .../java/client/response/UsergridResponse.java  |  230 ++++
 .../client/response/UsergridResponseError.java  |   98 ++
 .../usergrid/java/client/utils/JsonUtils.java   |  262 ++--
 .../usergrid/java/client/utils/MapUtils.java    |   27 +-
 .../usergrid/java/client/utils/ObjectUtils.java |   28 +-
 .../usergrid/java/client/utils/UrlUtils.java    |  124 --
 .../utils/UsergridEntityDeserializer.java       |   41 +
 .../client/ClientAuthFallBackTestCase.java      |   72 +
 .../usergrid/client/ClientAuthTestCase.java     |   85 ++
 .../client/ClientConnectionsTestCase.java       |  171 +++
 .../usergrid/client/ClientRestTestCase.java     |   90 ++
 .../apache/usergrid/client/EntityTestCase.java  |  676 +++++++++
 .../apache/usergrid/client/QueryTestCase.java   |  194 +++
 .../usergrid/client/SDKTestConfiguration.java   |   38 +
 .../apache/usergrid/client/SDKTestUtils.java    |  108 ++
 .../client/UsergridClientAuthTestCase.java      |   73 +
 .../usergrid/client/UsergridInitTestCase.java   |   48 +
 .../client/UsergridResponseErrorTestCase.java   |   62 +
 .../client/UsergridResponseTestCase.java        |   85 ++
 .../usergrid/client/UsergridTestCase.java       |   30 +
 sdks/java/usergrid-java-client-2.1.0.jar        |  Bin 0 -> 1992232 bytes
 50 files changed, 5511 insertions(+), 3638 deletions(-)
----------------------------------------------------------------------



[30/54] [abbrv] usergrid git commit: Increase AWS client timeouts.

Posted by mr...@apache.org.
Increase AWS client timeouts.


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

Branch: refs/heads/apm
Commit: a8ba65fda0925830a3b65b7a52ca40f0b5423449
Parents: 949f71b
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 19:45:56 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 19:45:56 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/usergrid/persistence/queue/QueueFig.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/a8ba65fd/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
index 533314b..6265a33 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java
@@ -88,11 +88,11 @@ public interface QueueFig extends GuicyFig {
     int getLocalQuorumTimeout();
 
     @Key( "usergrid.queue.client.connection.timeout")
-    @Default( "1000" ) // 1 second
+    @Default( "5000" ) // 5 seconds
     int getQueueClientConnectionTimeout();
 
     @Key( "usergrid.queue.client.socket.timeout")
-    @Default( "10000" ) // 10 seconds
+    @Default( "20000" ) // 20 seconds
     int getQueueClientSocketTimeout();
 
     @Key( "usergrid.queue.poll.timeshift")


[45/54] [abbrv] usergrid git commit: Fixed compiler errors in the ActivityFeed sample app caused by Swift updates.

Posted by mr...@apache.org.
Fixed compiler errors in the ActivityFeed sample app caused by Swift updates.


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

Branch: refs/heads/apm
Commit: 7d5836a505c04bc52ebb52d4c64fc0ff694c323d
Parents: 329de24
Author: Robert Walsh <rj...@gmail.com>
Authored: Tue May 10 17:33:26 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Tue May 10 17:33:26 2016 -0500

----------------------------------------------------------------------
 .../Source/Base.lproj/Main.storyboard           | 26 ++++++++++----------
 .../Source/MessageViewController.swift          | 26 ++++++++++----------
 2 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/7d5836a5/sdks/swift/Samples/ActivityFeed/Source/Base.lproj/Main.storyboard
----------------------------------------------------------------------
diff --git a/sdks/swift/Samples/ActivityFeed/Source/Base.lproj/Main.storyboard b/sdks/swift/Samples/ActivityFeed/Source/Base.lproj/Main.storyboard
index 5f38e98..8ec5316 100644
--- a/sdks/swift/Samples/ActivityFeed/Source/Base.lproj/Main.storyboard
+++ b/sdks/swift/Samples/ActivityFeed/Source/Base.lproj/Main.storyboard
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="0Ca-En-eac">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="0Ca-En-eac">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
     </dependencies>
     <scenes>
@@ -30,7 +30,7 @@
         <!--Chit-Chat-->
         <scene sceneID="tne-QT-ifu">
             <objects>
-                <viewController title="Chit-Chat" id="BYZ-38-t0r" customClass="LoginViewController" customModule="SDKSample" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController title="Chit-Chat" id="BYZ-38-t0r" customClass="LoginViewController" customModule="ActivityFeed" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
                         <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -39,7 +39,7 @@
                         <rect key="frame" x="0.0" y="64" width="414" height="672"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="AUv-4K-02z" userLabel="Password Text Field" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="AUv-4K-02z" userLabel="Password Text Field" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="221" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98039215686274506" green="0.98039215686274506" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -56,7 +56,7 @@
                                     <outlet property="nextResponderField" destination="Pj4-c5-WOw" id="ndL-qj-xzY"/>
                                 </connections>
                             </textField>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Z6O-sS-NMx" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Z6O-sS-NMx" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="54" y="183" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549019602" green="0.98431372549019602" blue="0.98431372549019602" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -142,7 +142,7 @@
         <!--Chat-->
         <scene sceneID="xKw-pF-1VK">
             <objects>
-                <viewController storyboardIdentifier="Chat" id="e2L-gy-keG" customClass="MessageViewController" customModule="SDKSample" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="Chat" id="e2L-gy-keG" customClass="MessageViewController" customModule="ActivityFeed" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="l0J-tj-N8R"/>
                         <viewControllerLayoutGuide type="bottom" id="aRQ-i9-bBv"/>
@@ -171,7 +171,7 @@
         <!--Follow-->
         <scene sceneID="L1J-vW-kjp">
             <objects>
-                <viewController id="dZf-Pa-FEf" customClass="FollowViewController" customModule="SDKSample" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController id="dZf-Pa-FEf" customClass="FollowViewController" customModule="ActivityFeed" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="bqC-DA-7jl"/>
                         <viewControllerLayoutGuide type="bottom" id="WfX-kG-aQR"/>
@@ -191,7 +191,7 @@
                                     <action selector="addFollowerButtonTouched:" destination="dZf-Pa-FEf" eventType="touchUpInside" id="yuv-da-ArK"/>
                                 </connections>
                             </button>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="30w-Hq-z3n" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="30w-Hq-z3n" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="229" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -236,7 +236,7 @@
         <!--Create Account-->
         <scene sceneID="KTq-tk-yrN">
             <objects>
-                <viewController title="Create Account" id="bnr-oZ-e0h" customClass="RegisterViewController" customModule="SDKSample" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController title="Create Account" id="bnr-oZ-e0h" customClass="RegisterViewController" customModule="ActivityFeed" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="54e-JK-PBR"/>
                         <viewControllerLayoutGuide type="bottom" id="JWP-YK-0Zj"/>
@@ -245,7 +245,7 @@
                         <rect key="frame" x="0.0" y="64" width="414" height="672"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Name" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="X55-Ni-6OO" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Name" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="X55-Ni-6OO" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="112" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -262,7 +262,7 @@
                                     <outlet property="nextResponderField" destination="T7U-9G-AS6" id="HUF-el-scZ"/>
                                 </connections>
                             </textField>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="T7U-9G-AS6" userLabel="Username Text Field" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Username" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="T7U-9G-AS6" userLabel="Username Text Field" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="150" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -279,7 +279,7 @@
                                     <outlet property="nextResponderField" destination="Fbi-gF-0jQ" id="sjv-Dm-5GL"/>
                                 </connections>
                             </textField>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Email" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Fbi-gF-0jQ" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Email" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Fbi-gF-0jQ" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="188" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
@@ -296,7 +296,7 @@
                                     <outlet property="nextResponderField" destination="3wi-7s-j5P" id="eE7-9Y-L0t"/>
                                 </connections>
                             </textField>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3wi-7s-j5P" userLabel="Password Text Field" customClass="FormTextField" customModule="SDKSample" customModuleProvider="target">
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3wi-7s-j5P" userLabel="Password Text Field" customClass="FormTextField" customModule="ActivityFeed" customModuleProvider="target">
                                 <rect key="frame" x="55" y="226" width="305" height="30"/>
                                 <color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/7d5836a5/sdks/swift/Samples/ActivityFeed/Source/MessageViewController.swift
----------------------------------------------------------------------
diff --git a/sdks/swift/Samples/ActivityFeed/Source/MessageViewController.swift b/sdks/swift/Samples/ActivityFeed/Source/MessageViewController.swift
index 28d32d4..b2a152c 100644
--- a/sdks/swift/Samples/ActivityFeed/Source/MessageViewController.swift
+++ b/sdks/swift/Samples/ActivityFeed/Source/MessageViewController.swift
@@ -40,7 +40,7 @@ class MessageViewController : SLKTextViewController {
         commonInit()
     }
 
-    required init!(coder decoder: NSCoder!) {
+    required init(coder decoder: NSCoder) {
         super.init(coder: decoder)
         commonInit()
     }
@@ -71,7 +71,7 @@ class MessageViewController : SLKTextViewController {
     func reloadMessages() {
         UsergridManager.getFeedMessages { (response) -> Void in
             self.messageEntities = response.entities as? [ActivityEntity] ?? []
-            self.tableView.reloadData()
+            self.tableView!.reloadData()
         }
     }
 
@@ -84,8 +84,8 @@ class MessageViewController : SLKTextViewController {
         self.textInputbar.maxCharCount = 256
         self.textInputbar.editorTitle.textColor = UIColor.darkGrayColor()
 
-        self.tableView.separatorStyle = .None
-        self.tableView.registerClass(MessageTableViewCell.self, forCellReuseIdentifier:MessageViewController.MESSAGE_CELL_IDENTIFIER)
+        self.tableView!.separatorStyle = .None
+        self.tableView!.registerClass(MessageTableViewCell.self, forCellReuseIdentifier:MessageViewController.MESSAGE_CELL_IDENTIFIER)
     }
 
     override func didPressRightButton(sender: AnyObject!) {
@@ -97,13 +97,13 @@ class MessageViewController : SLKTextViewController {
                 let rowAnimation: UITableViewRowAnimation = self.inverted ? .Bottom : .Top
                 let scrollPosition: UITableViewScrollPosition = self.inverted ? .Bottom : .Top
 
-                self.tableView.beginUpdates()
+                self.tableView!.beginUpdates()
                 self.messageEntities.insert(messageEntity, atIndex: 0)
-                self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: rowAnimation)
-                self.tableView.endUpdates()
+                self.tableView!.insertRowsAtIndexPaths([indexPath], withRowAnimation: rowAnimation)
+                self.tableView!.endUpdates()
 
-                self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: scrollPosition, animated: true)
-                self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
+                self.tableView!.scrollToRowAtIndexPath(indexPath, atScrollPosition: scrollPosition, animated: true)
+                self.tableView!.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
 
                 self.sendEntitiesToWatch(self.messageEntities)
             }
@@ -111,7 +111,7 @@ class MessageViewController : SLKTextViewController {
         super.didPressRightButton(sender)
     }
 
-    override func keyForTextCaching() -> String! {
+    override func keyForTextCaching() -> String? {
         return NSBundle.mainBundle().bundleIdentifier
     }
 
@@ -149,11 +149,11 @@ class MessageViewController : SLKTextViewController {
     }
 
     func messageCellForRowAtIndexPath(indexPath:NSIndexPath) -> MessageTableViewCell {
-        let cell = self.tableView.dequeueReusableCellWithIdentifier(MessageViewController.MESSAGE_CELL_IDENTIFIER) as! MessageTableViewCell
+        let cell = self.tableView!.dequeueReusableCellWithIdentifier(MessageViewController.MESSAGE_CELL_IDENTIFIER) as! MessageTableViewCell
         self.populateCell(cell, feedEntity: self.messageEntities[indexPath.row])
 
         cell.indexPath = indexPath
-        cell.transform = self.tableView.transform
+        cell.transform = self.tableView!.transform
 
         return cell
     }
@@ -176,7 +176,7 @@ class MessageViewController : SLKTextViewController {
         let pointSize = MessageTableViewCell.defaultFontSize
         let attributes = [NSFontAttributeName:UIFont.boldSystemFontOfSize(pointSize),NSParagraphStyleAttributeName:paragraphStyle]
 
-        let width: CGFloat = CGRectGetWidth(self.tableView.frame) - MessageTableViewCell.kMessageTableViewCellAvatarHeight - 25
+        let width: CGFloat = CGRectGetWidth(self.tableView!.frame) - MessageTableViewCell.kMessageTableViewCellAvatarHeight - 25
 
         let titleBounds = messageUsername.boundingRectWithSize(CGSize(width: width, height: CGFloat.max), options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)
         let bodyBounds = messageText.boundingRectWithSize(CGSize(width: width, height: CGFloat.max), options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)


[52/54] [abbrv] usergrid git commit: Remove incubator logo from website

Posted by mr...@apache.org.
Remove incubator logo from website


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

Branch: refs/heads/apm
Commit: 8c16d6add4bae0d3b5a483cc0815d79c838d539f
Parents: 279c020
Author: Dave Johnson <sn...@apache.org>
Authored: Mon May 23 10:15:12 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon May 23 10:15:12 2016 -0400

----------------------------------------------------------------------
 content/community/index.html | 3 +--
 content/index.html           | 3 +--
 content/releases/index.html  | 3 +--
 website/README.md            | 2 +-
 website/layouts/footer.html  | 3 +--
 5 files changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c16d6ad/content/community/index.html
----------------------------------------------------------------------
diff --git a/content/community/index.html b/content/community/index.html
index 2ff02f8..0a27b5ea 100644
--- a/content/community/index.html
+++ b/content/community/index.html
@@ -565,8 +565,7 @@
         </div> 
         <div class="row">
             <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Copyright � 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
+                <p>Copyright � The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
                 Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
                 <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a> + <a href="https://twitter.com/snoopdave">@snoopdave</a> .</p>
             </div>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c16d6ad/content/index.html
----------------------------------------------------------------------
diff --git a/content/index.html b/content/index.html
index 9416909..0394438 100644
--- a/content/index.html
+++ b/content/index.html
@@ -232,8 +232,7 @@
         </div> 
         <div class="row">
             <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Copyright � 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
+                <p>Copyright � The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
                 Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
                 <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a> + <a href="https://twitter.com/snoopdave">@snoopdave</a> .</p>
             </div>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c16d6ad/content/releases/index.html
----------------------------------------------------------------------
diff --git a/content/releases/index.html b/content/releases/index.html
index 086cb60..c02187c 100644
--- a/content/releases/index.html
+++ b/content/releases/index.html
@@ -200,8 +200,7 @@
         </div> 
         <div class="row">
             <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Copyright � 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
+                <p>Copyright � The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
                 Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
                 <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a> + <a href="https://twitter.com/snoopdave">@snoopdave</a> .</p>
             </div>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c16d6ad/website/README.md
----------------------------------------------------------------------
diff --git a/website/README.md b/website/README.md
index 2271ee0..735ad16 100644
--- a/website/README.md
+++ b/website/README.md
@@ -42,7 +42,7 @@ To test locally, you can use the autocompiler (will build changes on every reque
     
 ## 3. Publish your changes to the site    
 
-Run the nanoc compiler to generate the . It is configured via the ``nanoc.yaml`` to place website files into the ``content`` directory at the top 
+Run the nanoc compiler to generate the HTML for the website. It is configured via the ``nanoc.yaml`` to place website files into the ``content`` directory at the top 
 
     $ nanoc compile
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c16d6ad/website/layouts/footer.html
----------------------------------------------------------------------
diff --git a/website/layouts/footer.html b/website/layouts/footer.html
index 6101e04..ab21605 100644
--- a/website/layouts/footer.html
+++ b/website/layouts/footer.html
@@ -67,8 +67,7 @@
         </div> 
         <div class="row">
             <div id="copyright">
-                <img src="/img/egg-logo.png" /><br/><br/>
-                <p>Copyright � 2013 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
+                <p>Copyright � The Apache Software Foundation, Licensed under the Apache License, Version 2.0.<br>
                 Apache and the Apache feather logos are trademarks of The Apache Software Foundation.</p>
                 <p class="credits">Site designed & assembled with love by <a href="https://github.com/ryuneeee">@ryuneeee</a> + <a href="https://github.com/realbeast">@realbeast</a> + <a href="https://twitter.com/timanglade">@timanglade</a> + <a href="https://twitter.com/snoopdave">@snoopdave</a> .</p>
             </div>


[39/54] [abbrv] usergrid git commit: Re-work caching of push notification queue managers such that producing and consuming leverage the same cache.

Posted by mr...@apache.org.
Re-work caching of push notification queue managers such that producing and consuming leverage the same cache.


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

Branch: refs/heads/apm
Commit: d16f4c17c7b4eda01a8eddf2020139ec3898521d
Parents: c07cdb5
Author: Michael Russo <mr...@apigee.com>
Authored: Sat Apr 30 18:14:40 2016 +0800
Committer: Michael Russo <mr...@apigee.com>
Committed: Sat Apr 30 18:14:40 2016 +0800

----------------------------------------------------------------------
 .../main/resources/usergrid-default.properties  |  10 +-
 .../shard/impl/ShardGroupCompactionImpl.java    |  18 ++-
 .../queue/impl/QueueManagerFactoryImpl.java     |  27 ++--
 .../ApplicationQueueManagerCache.java           | 143 +++++++++++++++++++
 .../notifications/NotificationsService.java     |   6 +-
 .../services/notifications/QueueListener.java   |  58 ++------
 .../impl/ApplicationQueueManagerImpl.java       |   8 +-
 7 files changed, 197 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/config/src/main/resources/usergrid-default.properties
----------------------------------------------------------------------
diff --git a/stack/config/src/main/resources/usergrid-default.properties b/stack/config/src/main/resources/usergrid-default.properties
index 5cd7c7a..4f57cdd 100644
--- a/stack/config/src/main/resources/usergrid-default.properties
+++ b/stack/config/src/main/resources/usergrid-default.properties
@@ -455,12 +455,20 @@ usergrid.scheduler.job.queueName=/jobs
 
 # Set the number of queue consumers to read from the in-region push notification queue.
 #
-usergrid.push.worker_count=8
+usergrid.push.worker_count=2
 
 # Set the sleep time between queue polling ( in milliseconds)
 #
 usergrid.push.sleep=100
 
+# This setting determines the inmemory cache TTL (in minutes) for push notifications queue managers.
+#
+usergrid.push.queuemanager.cache.time-to-live=10
+
+# This setting determines the inmemory cache size (# elements) for push notifications queue managers.
+#
+usergrid.push.queuemanager.cache.size=200
+
 
 
 ###############################  Usergrid Central SSO  #############################

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
index b26ee46..0853adb 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
@@ -303,9 +303,6 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
             logger.trace("Finished compacting {} shards and moved {} edges", sourceShards, totalEdgeCount);
         }
 
-        logger.info("Finished compacting {} shards and moved {} edges", sourceShards, totalEdgeCount);
-
-
         resultBuilder.withCopiedEdges( totalEdgeCount ).withSourceShards( sourceShards ).withTargetShard( targetShard );
 
         /**
@@ -351,8 +348,9 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
             Shard compactedShard = new Shard( targetShard.getShardIndex(), timeService.getCurrentTime(), true );
             compactedShard.setShardEnd(targetShard.getShardEnd());
 
-            logger.info( "Shard has been fully compacted.  Marking shard {} as compacted in Cassandra", compactedShard );
-
+            if(logger.isTraceEnabled()) {
+                logger.trace("Shard has been fully compacted.  Marking shard {} as compacted in Cassandra", compactedShard);
+            }
 
             final MutationBatch updateMark = edgeShardSerialization.writeShardMeta( scope, compactedShard, edgeMeta );
             try {
@@ -402,7 +400,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
         }
         catch ( RejectedExecutionException ree ) {
 
-            //ignore, if this happens we don't care, we're saturated, we can check later
+            // ignore, if this happens we don't care, we're saturated, we can check later
             logger.info( "Rejected audit for shard of scope {} edge, meta {} and group {}", scope, edgeMeta, group );
 
             return Futures.immediateFuture( AuditResult.NOT_CHECKED );
@@ -503,8 +501,10 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
                  */
                 try {
                     CompactionResult result = compact( scope, edgeMeta, group );
-                    logger.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group {} is {}",
-                            scope, edgeMeta, group, result );
+                    if(logger.isTraceEnabled()) {
+                        logger.trace("Compaction result for compaction of scope {} with edge meta data of {} and shard group {} is {}",
+                            scope, edgeMeta, group, result);
+                    }
                 }
                 finally {
                     shardCompactionTaskTracker.complete( scope, edgeMeta, group );
@@ -535,8 +535,6 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
                                      ShardEntryGroup group ) {
             final Long hash = doHash( scope, edgeMeta, group ).hash().asLong();
             final Boolean returned = runningTasks.putIfAbsent( hash, TRUE );
-            //logger.info("hash components are app: {}, edgeMeta: {}, group: {}", scope.getApplication(), edgeMeta, group);
-            //logger.info("checking hash value of: {}, already started: {}", hash, returned );
 
             /**
              * Someone already put the value

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueManagerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueManagerFactoryImpl.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueManagerFactoryImpl.java
index de9cac5..93b2fb2 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueManagerFactoryImpl.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueManagerFactoryImpl.java
@@ -1,21 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  *  contributor license agreements.  The ASF licenses this file to You
- *  * under the Apache License, Version 2.0 (the "License"); you may not
- *  * use this file except in compliance with the License.
- *  * You may obtain a copy of the License at
- *  *
- *  *     http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.  For additional information regarding
- *  * copyright in this work, please see the NOTICE file in the top level
- *  * directory of this distribution.
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.usergrid.persistence.queue.impl;
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManagerCache.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManagerCache.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManagerCache.java
new file mode 100644
index 0000000..555e495
--- /dev/null
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManagerCache.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.services.notifications;
+
+import com.google.common.cache.*;
+import com.google.inject.Singleton;
+import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
+import org.apache.usergrid.persistence.queue.QueueManager;
+import org.apache.usergrid.services.notifications.impl.ApplicationQueueManagerImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
+
+
+@Singleton
+public class ApplicationQueueManagerCache{
+
+    private static final Logger logger = LoggerFactory.getLogger( ApplicationQueueManagerCache.class );
+
+
+    private final Cache<UUID, ApplicationQueueManager> cache;
+
+    private static final String CACHE_TTL_PROP = "usergrid.push.queuemanager.cache.time-to-live";
+    private static final String CACHE_MAX_SIZE_PROP = "usergrid.push.queuemanager.cache.size";
+
+    public ApplicationQueueManagerCache(){
+
+        // set a smaller ttl
+        long ttl = 10;
+        int configuredMaxSize;
+
+        try{
+            ttl = Integer.parseInt(System.getProperty(CACHE_TTL_PROP));
+        } catch (NumberFormatException e){
+            // already defaulted to 1 above
+        }
+
+        try{
+            configuredMaxSize = Integer.parseInt(System.getProperty(CACHE_MAX_SIZE_PROP));
+        } catch (NumberFormatException e){
+            configuredMaxSize = 200;
+        }
+
+        this.cache = CacheBuilder.newBuilder()
+            .maximumSize(Math.max(1000,configuredMaxSize))
+            .expireAfterWrite(ttl, TimeUnit.MINUTES)
+            .removalListener(new RemovalListener<UUID, ApplicationQueueManager>() {
+                @Override
+                public void onRemoval(
+                    RemovalNotification<UUID, ApplicationQueueManager> queueManagerNotifiication) {
+                    try {
+                        if ( queueManagerNotifiication.getValue() != null) {
+                            queueManagerNotifiication.getValue().stop();
+                        }
+                    } catch (Exception ie) {
+                        logger.error("Failed to shutdown push queue manager from cache", ie.getMessage());
+                    }
+                }
+            }).build();
+
+    }
+
+    public void put(UUID key, ApplicationQueueManager value){
+
+        cache.put(key, value);
+    }
+
+    public ConcurrentMap<UUID, ApplicationQueueManager> asMap(){
+
+        return cache.asMap();
+    }
+
+    public ApplicationQueueManager get(UUID key){
+        return cache.getIfPresent(key);
+    }
+
+    public void invalidate(UUID key){
+        cache.invalidate(key);
+    }
+
+    public void invalidateAll(){
+        cache.invalidateAll();
+    }
+
+
+    public ApplicationQueueManager getApplicationQueueManager( final EntityManager entityManager,
+                                                               final QueueManager queueManager,
+                                                               final JobScheduler jobScheduler,
+                                                               final MetricsFactory metricsService,
+                                                               final Properties properties ) {
+
+
+        ApplicationQueueManager manager = cache.getIfPresent(entityManager.getApplicationId());
+
+        if(manager != null){
+            if(logger.isTraceEnabled()){
+                logger.trace("Returning push queue manager from cache for application: {}", entityManager.getApplicationId());
+            }
+            return manager;
+
+        }else {
+            if(logger.isTraceEnabled()) {
+                logger.trace("Push queue manager not found in cache, loading for application: {}", entityManager.getApplicationId());
+            }
+            manager = new ApplicationQueueManagerImpl(
+                jobScheduler,
+                entityManager,
+                queueManager,
+                metricsService,
+                properties
+            );
+
+            cache.put(entityManager.getApplicationId(), manager);
+
+            return manager;
+
+
+        }
+
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index 65425d7..907638e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -77,6 +77,7 @@ public class NotificationsService extends AbstractCollectionService {
     private ServiceManagerFactory smf;
     private EntityManagerFactory emf;
     private QueueManagerFactory queueManagerFactory;
+    private ApplicationQueueManagerCache applicationQueueManagerCache;
 
     public NotificationsService() {
         if (logger.isTraceEnabled()) {
@@ -99,7 +100,10 @@ public class NotificationsService extends AbstractCollectionService {
         QueueScope queueScope = new QueueScopeImpl( name, QueueScope.RegionImplementation.LOCAL);
         queueManagerFactory = getApplicationContext().getBean( Injector.class ).getInstance(QueueManagerFactory.class);
         QueueManager queueManager = queueManagerFactory.getQueueManager(queueScope);
-        notificationQueueManager = new ApplicationQueueManagerImpl(jobScheduler,em,queueManager,metricsService,props);
+        applicationQueueManagerCache = getApplicationContext().getBean(Injector.class).getInstance(ApplicationQueueManagerCache.class);
+        notificationQueueManager = applicationQueueManagerCache
+            .getApplicationQueueManager(em,queueManager, jobScheduler, metricsService ,props);
+
         gracePeriod = JobScheduler.SCHEDULER_GRACE_PERIOD;
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index 55d1491..478d5ed 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -57,6 +57,7 @@ public class QueueListener  {
     private ServiceManagerFactory smf;
 
     private EntityManagerFactory emf;
+    private ApplicationQueueManagerCache applicationQueueManagerCache;
 
 
     private Properties properties;
@@ -79,6 +80,8 @@ public class QueueListener  {
         this.emf = emf;
         this.metricsService = smf.getApplicationContext().getBean( Injector.class ).getInstance(MetricsFactory.class);
         this.properties = props;
+        this.applicationQueueManagerCache = smf.getApplicationContext().getBean(Injector.class).getInstance(ApplicationQueueManagerCache.class);
+
     }
 
     /**
@@ -86,8 +89,6 @@ public class QueueListener  {
      */
     public void start(){
         //TODO refactor this into a central component that will start/stop services
-//        boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run", "false"));
-
 
             if (logger.isDebugEnabled()) {
                 logger.debug("QueueListener: starting.");
@@ -166,9 +167,6 @@ public class QueueListener  {
         // run until there are no more active jobs
         final AtomicLong runCount = new AtomicLong(0);
 
-        //cache to retrieve push manager, cached per notifier, so many notifications will get same push manager
-        LoadingCache<UUID, ApplicationQueueManager> queueManagerMap = getQueueManagerCache(queueManager);
-
         while ( true ) {
 
                 Timer.Context timerContext = timer.time();
@@ -207,7 +205,16 @@ public class QueueListener  {
                                 //send each set of app ids together
                                 for (Map.Entry<UUID, List<QueueMessage>> entry : messageMap.entrySet()) {
                                     UUID applicationId = entry.getKey();
-                                    ApplicationQueueManager manager = queueManagerMap.get(applicationId);
+
+                                    ApplicationQueueManager manager = applicationQueueManagerCache
+                                        .getApplicationQueueManager(
+                                            emf.getEntityManager(applicationId),
+                                            queueManager,
+                                            new JobScheduler(smf.getServiceManager(applicationId), emf.getEntityManager(applicationId)),
+                                            metricsService,
+                                            properties
+                                        );
+
                                     if (logger.isTraceEnabled()) {
                                         logger.trace("send batch for app {} of {} messages", entry.getKey(), entry.getValue().size());
                                     }
@@ -238,7 +245,7 @@ public class QueueListener  {
                                 }
 
                                 if(runCount.incrementAndGet() % consecutiveCallsToRemoveDevices == 0){
-                                    for(ApplicationQueueManager applicationQueueManager : queueManagerMap.asMap().values()){
+                                    for(ApplicationQueueManager applicationQueueManager : applicationQueueManagerCache.asMap().values()){
                                         try {
                                             applicationQueueManager.asyncCheckForInactiveDevices();
                                         }catch (Exception inactiveDeviceException){
@@ -280,43 +287,6 @@ public class QueueListener  {
         }
     }
 
-    private LoadingCache<UUID, ApplicationQueueManager> getQueueManagerCache(final QueueManager queueManager) {
-        return CacheBuilder
-                    .newBuilder()
-                    .expireAfterAccess(10, TimeUnit.MINUTES)
-                    .removalListener(new RemovalListener<UUID, ApplicationQueueManager>() {
-                        @Override
-                        public void onRemoval(
-                                RemovalNotification<UUID, ApplicationQueueManager> queueManagerNotifiication) {
-                            try {
-                                queueManagerNotifiication.getValue().stop();
-                            } catch (Exception ie) {
-                                logger.error("Failed to shutdown from cache", ie);
-                            }
-                        }
-                    }).build(new CacheLoader<UUID, ApplicationQueueManager>() {
-                         @Override
-                         public ApplicationQueueManager load(final UUID applicationId) {
-                             try {
-                                 EntityManager entityManager = emf.getEntityManager(applicationId);
-                                 ServiceManager serviceManager = smf.getServiceManager(applicationId);
-
-                                 ApplicationQueueManagerImpl manager = new ApplicationQueueManagerImpl(
-                                         new JobScheduler(serviceManager, entityManager),
-                                         entityManager,
-                                         queueManager,
-                                         metricsService,
-                                         properties
-                                 );
-                                 return manager;
-                             } catch (Exception e) {
-                                 logger.error("Could not instantiate queue manager", e);
-                                 return null;
-                             }
-                         }
-                     });
-    }
-
     public void stop(){
         if (logger.isDebugEnabled()) {
             logger.debug("stop processes");

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d16f4c17/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 80e8cbe..eb5d794 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -141,7 +141,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                 logger.trace("notification {} start query", notification.getUuid());
             }
 
-            logger.info("Notification {} started processing", notification.getUuid());
+            if(logger.isTraceEnabled()) {
+                logger.trace("Notification {} started processing", notification.getUuid());
+            }
 
 
 
@@ -366,7 +368,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                         notification.setProcessingFinished(System.currentTimeMillis());
                         notification.setDeviceProcessedCount(deviceCount.get());
                         em.update(notification);
-                        logger.info("Notification {} finished processing {} device(s)", notification.getUuid(), deviceCount.get());
+                        if(logger.isTraceEnabled()) {
+                            logger.trace("Notification {} finished processing {} device(s)", notification.getUuid(), deviceCount.get());
+                        }
 
                     } catch (Exception e) {
                         logger.error("Unable to set processing finished timestamp for notification");


[37/54] [abbrv] usergrid git commit: Docs are for "2.x" and not "1.0"

Posted by mr...@apache.org.
Docs are for "2.x" and not "1.0"


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

Branch: refs/heads/apm
Commit: 279c020d3f97c74d78bb973b291cb9dca8805ed0
Parents: 9950af7
Author: Dave Johnson <sn...@apache.org>
Authored: Tue Apr 26 11:01:05 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Tue Apr 26 11:01:05 2016 -0400

----------------------------------------------------------------------
 content/docs/README.html                           |   8 ++++----
 .../file-storage-configuration.html                |   8 ++++----
 content/docs/assets-and-files/folders.html         |   8 ++++----
 .../assets-and-files/legacy-asset-support.html     |   8 ++++----
 .../docs/assets-and-files/retrieving-assets.html   |   8 ++++----
 .../docs/assets-and-files/uploading-assets.html    |   8 ++++----
 .../creating-and-incrementing-counters.html        |   8 ++++----
 .../counters-and-events/events-and-counters.html   |   8 ++++----
 .../counters-and-events/retrieving-counters.html   |   8 ++++----
 .../docs/data-queries/advanced-query-usage.html    |   8 ++++----
 content/docs/data-queries/operators-and-types.html |   8 ++++----
 content/docs/data-queries/query-parameters.html    |   8 ++++----
 content/docs/data-queries/querying-your-data.html  |   8 ++++----
 content/docs/data-storage/collections.html         |   8 ++++----
 content/docs/data-storage/data-store-dbms.html     |   8 ++++----
 content/docs/data-storage/entities.html            |   8 ++++----
 content/docs/data-storage/optimizing-access.html   |   8 ++++----
 .../entity-connections/connecting-entities.html    |   8 ++++----
 .../entity-connections/disconnecting-entities.html |   8 ++++----
 .../entity-connections/retrieving-entities.html    |   8 ++++----
 content/docs/genindex.html                         |   8 ++++----
 content/docs/geolocation/geolocation.html          |   8 ++++----
 content/docs/index.html                            |   8 ++++----
 content/docs/installation/deployment-guide.html    |   8 ++++----
 .../docs/installation/ug1-deploy-to-tomcat.html    |   8 ++++----
 .../installation/ug1-launcher-quick-start.html     |   8 ++++----
 .../docs/installation/ug2-deploy-to-tomcat.html    |   8 ++++----
 content/docs/introduction/async-vs-sync.html       |   8 ++++----
 content/docs/introduction/data-model.html          |   8 ++++----
 content/docs/introduction/overview.html            |   8 ++++----
 content/docs/introduction/usergrid-features.html   |   8 ++++----
 content/docs/jersey2skeleton/README.html           |   8 ++++----
 content/docs/objects.inv                           | Bin 686 -> 686 bytes
 content/docs/orgs-and-apps/admin-user.html         |   8 ++++----
 content/docs/orgs-and-apps/application.html        |   8 ++++----
 content/docs/orgs-and-apps/managing.html           |   8 ++++----
 content/docs/orgs-and-apps/organization.html       |   8 ++++----
 .../push-notifications/adding-push-support.html    |   8 ++++----
 .../creating-and-managing-notifications.html       |   8 ++++----
 .../push-notifications/creating-notifiers.html     |   8 ++++----
 .../docs/push-notifications/getting-started.html   |   8 ++++----
 .../managing-users-and-devices.html                |   8 ++++----
 content/docs/push-notifications/overview.html      |   8 ++++----
 content/docs/push-notifications/registering.html   |   8 ++++----
 content/docs/push-notifications/tbd.html           |   8 ++++----
 .../docs/push-notifications/troubleshooting.html   |   8 ++++----
 content/docs/push-notifications/tutorial.html      |   8 ++++----
 content/docs/push-notifications/users-devices.html |   8 ++++----
 content/docs/reference/contribute-code.html        |   8 ++++----
 content/docs/reference/presos-and-videos.html      |   8 ++++----
 content/docs/rest-endpoints/api-docs.html          |   8 ++++----
 content/docs/sdks/ios-new.html                     |   8 ++++----
 content/docs/sdks/sdk-outline.html                 |   8 ++++----
 content/docs/sdks/tbd.html                         |   8 ++++----
 content/docs/search.html                           |   8 ++++----
 content/docs/security-and-auth/app-security.html   |   8 ++++----
 .../authenticating-api-requests.html               |   8 ++++----
 ...thenticating-users-and-application-clients.html |   8 ++++----
 .../changing-token-time-live-ttl.html              |   8 ++++----
 content/docs/security-and-auth/facebook-sign.html  |   8 ++++----
 .../security-and-auth/revoking-tokens-logout.html  |   8 ++++----
 .../docs/security-and-auth/securing-your-app.html  |   8 ++++----
 .../user-authentication-types.html                 |   8 ++++----
 .../docs/security-and-auth/using-permissions.html  |   8 ++++----
 content/docs/security-and-auth/using-roles.html    |   8 ++++----
 content/docs/user-management/activity.html         |   8 ++++----
 content/docs/user-management/group.html            |   8 ++++----
 content/docs/user-management/groups.html           |   8 ++++----
 content/docs/user-management/messagee-example.html |   8 ++++----
 content/docs/user-management/user-connections.html |   8 ++++----
 content/docs/user-management/user-management.html  |   8 ++++----
 .../docs/user-management/working-user-data.html    |   8 ++++----
 .../using-usergrid/creating-a-new-application.html |   8 ++++----
 content/docs/using-usergrid/creating-account.html  |   8 ++++----
 .../docs/using-usergrid/using-a-sandbox-app.html   |   8 ++++----
 content/docs/using-usergrid/using-the-api.html     |   8 ++++----
 docs/conf.py                                       |   4 ++--
 77 files changed, 302 insertions(+), 302 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/README.html
----------------------------------------------------------------------
diff --git a/content/docs/README.html b/content/docs/README.html
index 78f090b..aab88cd 100644
--- a/content/docs/README.html
+++ b/content/docs/README.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Apache Usergrid Documentation &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Apache Usergrid Documentation &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="index.html"/> 
 
   
   <script src="_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -357,7 +357,7 @@ Git.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'./',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/assets-and-files/file-storage-configuration.html
----------------------------------------------------------------------
diff --git a/content/docs/assets-and-files/file-storage-configuration.html b/content/docs/assets-and-files/file-storage-configuration.html
index 464b11a..cc20aba 100644
--- a/content/docs/assets-and-files/file-storage-configuration.html
+++ b/content/docs/assets-and-files/file-storage-configuration.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>File storage configuration &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>File storage configuration &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -303,7 +303,7 @@ file has to be stored on the hard drive before being sended to Amazon.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/assets-and-files/folders.html
----------------------------------------------------------------------
diff --git a/content/docs/assets-and-files/folders.html b/content/docs/assets-and-files/folders.html
index 1dbab98..1ca8653 100644
--- a/content/docs/assets-and-files/folders.html
+++ b/content/docs/assets-and-files/folders.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Folders &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Folders &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Counters &amp; events" href="../counters-and-events/events-and-counters.html"/>
         <link rel="prev" title="Retrieving assets" href="retrieving-assets.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -372,7 +372,7 @@ this:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/assets-and-files/legacy-asset-support.html
----------------------------------------------------------------------
diff --git a/content/docs/assets-and-files/legacy-asset-support.html b/content/docs/assets-and-files/legacy-asset-support.html
index 806ead0..10b8c7e 100644
--- a/content/docs/assets-and-files/legacy-asset-support.html
+++ b/content/docs/assets-and-files/legacy-asset-support.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>&lt;no title&gt; &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>&lt;no title&gt; &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -261,7 +261,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/assets-and-files/retrieving-assets.html
----------------------------------------------------------------------
diff --git a/content/docs/assets-and-files/retrieving-assets.html b/content/docs/assets-and-files/retrieving-assets.html
index 718464d..1c10936 100644
--- a/content/docs/assets-and-files/retrieving-assets.html
+++ b/content/docs/assets-and-files/retrieving-assets.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Retrieving assets &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Retrieving assets &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Folders" href="folders.html"/>
         <link rel="prev" title="Uploading assets" href="uploading-assets.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -340,7 +340,7 @@ Entities</a>.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/assets-and-files/uploading-assets.html
----------------------------------------------------------------------
diff --git a/content/docs/assets-and-files/uploading-assets.html b/content/docs/assets-and-files/uploading-assets.html
index 1d84692..1118ebd 100644
--- a/content/docs/assets-and-files/uploading-assets.html
+++ b/content/docs/assets-and-files/uploading-assets.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Uploading assets &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Uploading assets &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Retrieving assets" href="retrieving-assets.html"/>
         <link rel="prev" title="Geolocating your Entities" href="../geolocation/geolocation.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -400,7 +400,7 @@ in &#8216;Uploading assets&#8217; as a <code class="docutils literal"><span clas
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/counters-and-events/creating-and-incrementing-counters.html
----------------------------------------------------------------------
diff --git a/content/docs/counters-and-events/creating-and-incrementing-counters.html b/content/docs/counters-and-events/creating-and-incrementing-counters.html
index cfe9727..2f7d0ae 100644
--- a/content/docs/counters-and-events/creating-and-incrementing-counters.html
+++ b/content/docs/counters-and-events/creating-and-incrementing-counters.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Creating &amp; incrementing counters &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Creating &amp; incrementing counters &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Retrieving counters" href="retrieving-counters.html"/>
         <link rel="prev" title="Counters &amp; events" href="events-and-counters.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -390,7 +390,7 @@ actions in your app at both a cumulative and granular level.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/counters-and-events/events-and-counters.html
----------------------------------------------------------------------
diff --git a/content/docs/counters-and-events/events-and-counters.html b/content/docs/counters-and-events/events-and-counters.html
index 5f79f10..a1663cc 100644
--- a/content/docs/counters-and-events/events-and-counters.html
+++ b/content/docs/counters-and-events/events-and-counters.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Counters &amp; events &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Counters &amp; events &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Creating &amp; incrementing counters" href="creating-and-incrementing-counters.html"/>
         <link rel="prev" title="Folders" href="../assets-and-files/folders.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -287,7 +287,7 @@ you might track with a user-defined counter are:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/counters-and-events/retrieving-counters.html
----------------------------------------------------------------------
diff --git a/content/docs/counters-and-events/retrieving-counters.html b/content/docs/counters-and-events/retrieving-counters.html
index 7510b7b..a5d5aab 100644
--- a/content/docs/counters-and-events/retrieving-counters.html
+++ b/content/docs/counters-and-events/retrieving-counters.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Retrieving counters &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Retrieving counters &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Organization &amp; application management" href="../orgs-and-apps/managing.html"/>
         <link rel="prev" title="Creating &amp; incrementing counters" href="creating-and-incrementing-counters.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -442,7 +442,7 @@ like this:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-queries/advanced-query-usage.html
----------------------------------------------------------------------
diff --git a/content/docs/data-queries/advanced-query-usage.html b/content/docs/data-queries/advanced-query-usage.html
index a901d82..c603613 100644
--- a/content/docs/data-queries/advanced-query-usage.html
+++ b/content/docs/data-queries/advanced-query-usage.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Advanced query usage &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Advanced query usage &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Connecting entities" href="../entity-connections/connecting-entities.html"/>
         <link rel="prev" title="Query operators &amp; data types" href="operators-and-types.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -305,7 +305,7 @@ var dataClient = new Usergrid.Client(options);
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-queries/operators-and-types.html
----------------------------------------------------------------------
diff --git a/content/docs/data-queries/operators-and-types.html b/content/docs/data-queries/operators-and-types.html
index c66f626..e9ca61c 100644
--- a/content/docs/data-queries/operators-and-types.html
+++ b/content/docs/data-queries/operators-and-types.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Query operators &amp; data types &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Query operators &amp; data types &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Advanced query usage" href="advanced-query-usage.html"/>
         <link rel="prev" title="Query parameters &amp; clauses" href="query-parameters.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -464,7 +464,7 @@ properties.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-queries/query-parameters.html
----------------------------------------------------------------------
diff --git a/content/docs/data-queries/query-parameters.html b/content/docs/data-queries/query-parameters.html
index cb812b8..e1e754f 100644
--- a/content/docs/data-queries/query-parameters.html
+++ b/content/docs/data-queries/query-parameters.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Query parameters &amp; clauses &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Query parameters &amp; clauses &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Query operators &amp; data types" href="operators-and-types.html"/>
         <link rel="prev" title="Querying your data" href="querying-your-data.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -496,7 +496,7 @@ results should begin:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-queries/querying-your-data.html
----------------------------------------------------------------------
diff --git a/content/docs/data-queries/querying-your-data.html b/content/docs/data-queries/querying-your-data.html
index 1c68fff..83afa63 100644
--- a/content/docs/data-queries/querying-your-data.html
+++ b/content/docs/data-queries/querying-your-data.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Querying your data &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Querying your data &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Query parameters &amp; clauses" href="query-parameters.html"/>
         <link rel="prev" title="Entities" href="../data-storage/entities.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -437,7 +437,7 @@ requested (username first, then name).</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-storage/collections.html
----------------------------------------------------------------------
diff --git a/content/docs/data-storage/collections.html b/content/docs/data-storage/collections.html
index e35c99b..be72bfb 100644
--- a/content/docs/data-storage/collections.html
+++ b/content/docs/data-storage/collections.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Collections &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Collections &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Entities" href="entities.html"/>
         <link rel="prev" title="Data Store Best Practices" href="optimizing-access.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -662,7 +662,7 @@ for details.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-storage/data-store-dbms.html
----------------------------------------------------------------------
diff --git a/content/docs/data-storage/data-store-dbms.html b/content/docs/data-storage/data-store-dbms.html
index ab7b7a7..7bd80e4 100644
--- a/content/docs/data-storage/data-store-dbms.html
+++ b/content/docs/data-storage/data-store-dbms.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>The Usergrid Data Store &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>The Usergrid Data Store &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Data Store Best Practices" href="optimizing-access.html"/>
         <link rel="prev" title="Using the API" href="../using-usergrid/using-the-api.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -407,7 +407,7 @@ column family.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-storage/entities.html
----------------------------------------------------------------------
diff --git a/content/docs/data-storage/entities.html b/content/docs/data-storage/entities.html
index 9ff0a77..efb1056 100644
--- a/content/docs/data-storage/entities.html
+++ b/content/docs/data-storage/entities.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Entities &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Entities &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Querying your data" href="../data-queries/querying-your-data.html"/>
         <link rel="prev" title="Collections" href="collections.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -1007,7 +1007,7 @@ for details.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/data-storage/optimizing-access.html
----------------------------------------------------------------------
diff --git a/content/docs/data-storage/optimizing-access.html b/content/docs/data-storage/optimizing-access.html
index 97955d5..33eadcd 100644
--- a/content/docs/data-storage/optimizing-access.html
+++ b/content/docs/data-storage/optimizing-access.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Data Store Best Practices &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Data Store Best Practices &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Collections" href="collections.html"/>
         <link rel="prev" title="The Usergrid Data Store" href="data-store-dbms.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -541,7 +541,7 @@ GET /products/&lt;reviewed_product_uuid&gt;/reviewedBy/users
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/entity-connections/connecting-entities.html
----------------------------------------------------------------------
diff --git a/content/docs/entity-connections/connecting-entities.html b/content/docs/entity-connections/connecting-entities.html
index ef308ca..48041a7 100644
--- a/content/docs/entity-connections/connecting-entities.html
+++ b/content/docs/entity-connections/connecting-entities.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Connecting entities &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Connecting entities &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Retrieving connections" href="retrieving-entities.html"/>
         <link rel="prev" title="Advanced query usage" href="../data-queries/advanced-query-usage.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -362,7 +362,7 @@ is specified by its UUID.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/entity-connections/disconnecting-entities.html
----------------------------------------------------------------------
diff --git a/content/docs/entity-connections/disconnecting-entities.html b/content/docs/entity-connections/disconnecting-entities.html
index 209c86a..85aabab 100644
--- a/content/docs/entity-connections/disconnecting-entities.html
+++ b/content/docs/entity-connections/disconnecting-entities.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Disconnecting entities &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Disconnecting entities &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Push notifications overview" href="../push-notifications/overview.html"/>
         <link rel="prev" title="Retrieving connections" href="retrieving-entities.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -379,7 +379,7 @@ is specified by its UUID.Parameter</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/entity-connections/retrieving-entities.html
----------------------------------------------------------------------
diff --git a/content/docs/entity-connections/retrieving-entities.html b/content/docs/entity-connections/retrieving-entities.html
index 00699ca..3af28af 100644
--- a/content/docs/entity-connections/retrieving-entities.html
+++ b/content/docs/entity-connections/retrieving-entities.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Retrieving connections &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Retrieving connections &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Disconnecting entities" href="disconnecting-entities.html"/>
         <link rel="prev" title="Connecting entities" href="connecting-entities.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -403,7 +403,7 @@ will be returned in the entities property of the response.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/genindex.html
----------------------------------------------------------------------
diff --git a/content/docs/genindex.html b/content/docs/genindex.html
index 03ecbcb..b8bfa4f 100644
--- a/content/docs/genindex.html
+++ b/content/docs/genindex.html
@@ -9,7 +9,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Index &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Index &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -31,7 +31,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="index.html"/> 
 
   
   <script src="_static/js/modernizr.min.js"></script>
@@ -58,7 +58,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -266,7 +266,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'./',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/geolocation/geolocation.html
----------------------------------------------------------------------
diff --git a/content/docs/geolocation/geolocation.html b/content/docs/geolocation/geolocation.html
index bb66dc2..8779bc4 100644
--- a/content/docs/geolocation/geolocation.html
+++ b/content/docs/geolocation/geolocation.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Geolocating your Entities &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Geolocating your Entities &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Uploading assets" href="../assets-and-files/uploading-assets.html"/>
         <link rel="prev" title="App Example - Messagee" href="../user-management/messagee-example.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -397,7 +397,7 @@ happened.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/index.html
----------------------------------------------------------------------
diff --git a/content/docs/index.html b/content/docs/index.html
index a77a322..6d2f2b4 100644
--- a/content/docs/index.html
+++ b/content/docs/index.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Apache Usergrid Documentation &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Apache Usergrid Documentation &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="#"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="#"/>
         <link rel="next" title="Getting Started" href="introduction/overview.html"/> 
 
   
@@ -58,7 +58,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -789,7 +789,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'./',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/installation/deployment-guide.html
----------------------------------------------------------------------
diff --git a/content/docs/installation/deployment-guide.html b/content/docs/installation/deployment-guide.html
index 847ee82..49bf2d6 100644
--- a/content/docs/installation/deployment-guide.html
+++ b/content/docs/installation/deployment-guide.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid 2.1.0 Deployment Guide &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid 2.1.0 Deployment Guide &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Presentations &amp; Videos" href="../reference/presos-and-videos.html"/>
         <link rel="prev" title="COMING SOON..." href="../sdks/tbd.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -804,7 +804,7 @@ instances running Cassandra and ElasticSearch.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/installation/ug1-deploy-to-tomcat.html
----------------------------------------------------------------------
diff --git a/content/docs/installation/ug1-deploy-to-tomcat.html b/content/docs/installation/ug1-deploy-to-tomcat.html
index f6358b9..916990f 100644
--- a/content/docs/installation/ug1-deploy-to-tomcat.html
+++ b/content/docs/installation/ug1-deploy-to-tomcat.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usegrid 1: Deploying to Tomcat &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usegrid 1: Deploying to Tomcat &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -465,7 +465,7 @@ usergrid.user.resetpw.url=https://localhost:8080/%s/%s/users/%s/resetpw
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/installation/ug1-launcher-quick-start.html
----------------------------------------------------------------------
diff --git a/content/docs/installation/ug1-launcher-quick-start.html b/content/docs/installation/ug1-launcher-quick-start.html
index cc25cbb..d9925e2 100644
--- a/content/docs/installation/ug1-launcher-quick-start.html
+++ b/content/docs/installation/ug1-launcher-quick-start.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usegrid 1: Launcher Quick-start &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usegrid 1: Launcher Quick-start &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -349,7 +349,7 @@ use it to create a collection with some data in it:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/installation/ug2-deploy-to-tomcat.html
----------------------------------------------------------------------
diff --git a/content/docs/installation/ug2-deploy-to-tomcat.html b/content/docs/installation/ug2-deploy-to-tomcat.html
index 6d49281..353abed 100644
--- a/content/docs/installation/ug2-deploy-to-tomcat.html
+++ b/content/docs/installation/ug2-deploy-to-tomcat.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid 2: Deploy to Tomcat &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid 2: Deploy to Tomcat &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -478,7 +478,7 @@ sake of ordered lists I put Cassandra first.</td></tr>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/introduction/async-vs-sync.html
----------------------------------------------------------------------
diff --git a/content/docs/introduction/async-vs-sync.html b/content/docs/introduction/async-vs-sync.html
index 55a6cbb..e9b9877 100644
--- a/content/docs/introduction/async-vs-sync.html
+++ b/content/docs/introduction/async-vs-sync.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Async vs. sync calls &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Async vs. sync calls &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Creating a Usergrid Account" href="../using-usergrid/creating-account.html"/>
         <link rel="prev" title="Usergrid Data model" href="data-model.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -325,7 +325,7 @@ execution completes.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/introduction/data-model.html
----------------------------------------------------------------------
diff --git a/content/docs/introduction/data-model.html b/content/docs/introduction/data-model.html
index 8a77b20..79a54c8 100644
--- a/content/docs/introduction/data-model.html
+++ b/content/docs/introduction/data-model.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid Data model &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid Data model &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Async vs. sync calls" href="async-vs-sync.html"/>
         <link rel="prev" title="Usergrid Features" href="usergrid-features.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -433,7 +433,7 @@ identifier.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/introduction/overview.html
----------------------------------------------------------------------
diff --git a/content/docs/introduction/overview.html b/content/docs/introduction/overview.html
index 60de706..aeb4c5d 100644
--- a/content/docs/introduction/overview.html
+++ b/content/docs/introduction/overview.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Getting Started &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Getting Started &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Usergrid Features" href="usergrid-features.html"/>
         <link rel="prev" title="Apache Usergrid Documentation" href="../index.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -314,7 +314,7 @@ project then this is a good place to start:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/introduction/usergrid-features.html
----------------------------------------------------------------------
diff --git a/content/docs/introduction/usergrid-features.html b/content/docs/introduction/usergrid-features.html
index ec05439..f28297a 100644
--- a/content/docs/introduction/usergrid-features.html
+++ b/content/docs/introduction/usergrid-features.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid Features &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid Features &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Usergrid Data model" href="data-model.html"/>
         <link rel="prev" title="Getting Started" href="overview.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -442,7 +442,7 @@ overview</a>.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/jersey2skeleton/README.html
----------------------------------------------------------------------
diff --git a/content/docs/jersey2skeleton/README.html b/content/docs/jersey2skeleton/README.html
index 283baf9..1fb0989 100644
--- a/content/docs/jersey2skeleton/README.html
+++ b/content/docs/jersey2skeleton/README.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>jersey2skeleton &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>jersey2skeleton &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -271,7 +271,7 @@ get the correct Swagger generated for the /management and
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/objects.inv
----------------------------------------------------------------------
diff --git a/content/docs/objects.inv b/content/docs/objects.inv
index 7f8bb29..c58efdd 100644
Binary files a/content/docs/objects.inv and b/content/docs/objects.inv differ

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/orgs-and-apps/admin-user.html
----------------------------------------------------------------------
diff --git a/content/docs/orgs-and-apps/admin-user.html b/content/docs/orgs-and-apps/admin-user.html
index 1a272b8..9baf6c6 100644
--- a/content/docs/orgs-and-apps/admin-user.html
+++ b/content/docs/orgs-and-apps/admin-user.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Admin user &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Admin user &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Methods" href="../rest-endpoints/api-docs.html"/>
         <link rel="prev" title="Application" href="application.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -834,7 +834,7 @@ email notification.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/orgs-and-apps/application.html
----------------------------------------------------------------------
diff --git a/content/docs/orgs-and-apps/application.html b/content/docs/orgs-and-apps/application.html
index 51843b6..fdded4b 100644
--- a/content/docs/orgs-and-apps/application.html
+++ b/content/docs/orgs-and-apps/application.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Application &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Application &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Admin user" href="admin-user.html"/>
         <link rel="prev" title="Organization" href="organization.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -480,7 +480,7 @@ for details.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/orgs-and-apps/managing.html
----------------------------------------------------------------------
diff --git a/content/docs/orgs-and-apps/managing.html b/content/docs/orgs-and-apps/managing.html
index 6ff7f00..18bb9b0 100644
--- a/content/docs/orgs-and-apps/managing.html
+++ b/content/docs/orgs-and-apps/managing.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Organization &amp; application management &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Organization &amp; application management &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Organization" href="organization.html"/>
         <link rel="prev" title="Retrieving counters" href="../counters-and-events/retrieving-counters.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -324,7 +324,7 @@ accounts of which the user is a member.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/orgs-and-apps/organization.html
----------------------------------------------------------------------
diff --git a/content/docs/orgs-and-apps/organization.html b/content/docs/orgs-and-apps/organization.html
index a1e1ac0..6cb5112 100644
--- a/content/docs/orgs-and-apps/organization.html
+++ b/content/docs/orgs-and-apps/organization.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Organization &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Organization &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Application" href="application.html"/>
         <link rel="prev" title="Organization &amp; application management" href="managing.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -1001,7 +1001,7 @@ will return a 400 Bad Request error.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/adding-push-support.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/adding-push-support.html b/content/docs/push-notifications/adding-push-support.html
index e861915..c1904ab 100644
--- a/content/docs/push-notifications/adding-push-support.html
+++ b/content/docs/push-notifications/adding-push-support.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Adding push notifications support &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Adding push notifications support &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Getting started with push notifications" href="getting-started.html"/>
         <link rel="prev" title="Push notifications overview" href="overview.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -549,7 +549,7 @@ Registering with a notification service.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/creating-and-managing-notifications.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/creating-and-managing-notifications.html b/content/docs/push-notifications/creating-and-managing-notifications.html
index d98441a..3ebd08c 100644
--- a/content/docs/push-notifications/creating-and-managing-notifications.html
+++ b/content/docs/push-notifications/creating-and-managing-notifications.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Creating and managing notifications &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Creating and managing notifications &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Troubleshooting" href="troubleshooting.html"/>
         <link rel="prev" title="Managing users and devices" href="managing-users-and-devices.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -711,7 +711,7 @@ combination thereof.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/creating-notifiers.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/creating-notifiers.html b/content/docs/push-notifications/creating-notifiers.html
index a508e3b..e96a35f 100644
--- a/content/docs/push-notifications/creating-notifiers.html
+++ b/content/docs/push-notifications/creating-notifiers.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Creating notifiers &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Creating notifiers &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Managing users and devices" href="managing-users-and-devices.html"/>
         <link rel="prev" title="Registering with a notification service" href="registering.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -393,7 +393,7 @@ Docs</a>.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/getting-started.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/getting-started.html b/content/docs/push-notifications/getting-started.html
index 469a7bf..57d6daa 100644
--- a/content/docs/push-notifications/getting-started.html
+++ b/content/docs/push-notifications/getting-started.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Getting started with push notifications &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Getting started with push notifications &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Tutorial: Push notifications sample app" href="tutorial.html"/>
         <link rel="prev" title="Adding push notifications support" href="adding-push-support.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -465,7 +465,7 @@ notifications from that sender.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/managing-users-and-devices.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/managing-users-and-devices.html b/content/docs/push-notifications/managing-users-and-devices.html
index 14f451c..c038da5 100644
--- a/content/docs/push-notifications/managing-users-and-devices.html
+++ b/content/docs/push-notifications/managing-users-and-devices.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Managing users and devices &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Managing users and devices &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Creating and managing notifications" href="creating-and-managing-notifications.html"/>
         <link rel="prev" title="Creating notifiers" href="creating-notifiers.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -656,7 +656,7 @@ notifications to groups of users (and their associated devices), see
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/overview.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/overview.html b/content/docs/push-notifications/overview.html
index fc86409..af3ac05 100644
--- a/content/docs/push-notifications/overview.html
+++ b/content/docs/push-notifications/overview.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Push notifications overview &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Push notifications overview &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Adding push notifications support" href="adding-push-support.html"/>
         <link rel="prev" title="Disconnecting entities" href="../entity-connections/disconnecting-entities.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -361,7 +361,7 @@ things.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/registering.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/registering.html b/content/docs/push-notifications/registering.html
index 334f7bb..85873a6 100644
--- a/content/docs/push-notifications/registering.html
+++ b/content/docs/push-notifications/registering.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Registering with a notification service &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Registering with a notification service &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Creating notifiers" href="creating-notifiers.html"/>
         <link rel="prev" title="Tutorial: Push notifications sample app" href="tutorial.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -452,7 +452,7 @@ notifiers</a>.)</li>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/tbd.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/tbd.html b/content/docs/push-notifications/tbd.html
index 90ce35b..89ba353 100644
--- a/content/docs/push-notifications/tbd.html
+++ b/content/docs/push-notifications/tbd.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>COMING IN USERGRID 2 &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>COMING IN USERGRID 2 &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -264,7 +264,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/troubleshooting.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/troubleshooting.html b/content/docs/push-notifications/troubleshooting.html
index 5642019..dc1eac5 100644
--- a/content/docs/push-notifications/troubleshooting.html
+++ b/content/docs/push-notifications/troubleshooting.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Troubleshooting &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Troubleshooting &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Security &amp; token authentication" href="../security-and-auth/app-security.html"/>
         <link rel="prev" title="Creating and managing notifications" href="creating-and-managing-notifications.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -434,7 +434,7 @@ number generated when you created your Google API project. See
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/tutorial.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/tutorial.html b/content/docs/push-notifications/tutorial.html
index d9364bd..5b5bfc2 100644
--- a/content/docs/push-notifications/tutorial.html
+++ b/content/docs/push-notifications/tutorial.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Tutorial: Push notifications sample app &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Tutorial: Push notifications sample app &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Registering with a notification service" href="registering.html"/>
         <link rel="prev" title="Getting started with push notifications" href="getting-started.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -634,7 +634,7 @@ your-app and notifier-name.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/push-notifications/users-devices.html
----------------------------------------------------------------------
diff --git a/content/docs/push-notifications/users-devices.html b/content/docs/push-notifications/users-devices.html
index 1ea3e74..6a28fae 100644
--- a/content/docs/push-notifications/users-devices.html
+++ b/content/docs/push-notifications/users-devices.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Users &amp; Devices &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Users &amp; Devices &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -521,7 +521,7 @@ token is:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/reference/contribute-code.html
----------------------------------------------------------------------
diff --git a/content/docs/reference/contribute-code.html b/content/docs/reference/contribute-code.html
index 78bc50f..83f1b4b 100644
--- a/content/docs/reference/contribute-code.html
+++ b/content/docs/reference/contribute-code.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>How to Contribute Code &amp; Docs &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>How to Contribute Code &amp; Docs &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="prev" title="Presentations &amp; Videos" href="presos-and-videos.html"/> 
 
   
@@ -58,7 +58,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -329,7 +329,7 @@ instructions</a></li>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/reference/presos-and-videos.html
----------------------------------------------------------------------
diff --git a/content/docs/reference/presos-and-videos.html b/content/docs/reference/presos-and-videos.html
index ee67ddd..74c708e 100644
--- a/content/docs/reference/presos-and-videos.html
+++ b/content/docs/reference/presos-and-videos.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Presentations &amp; Videos &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Presentations &amp; Videos &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="How to Contribute Code &amp; Docs" href="contribute-code.html"/>
         <link rel="prev" title="Usergrid 2.1.0 Deployment Guide" href="../installation/deployment-guide.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -319,7 +319,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/rest-endpoints/api-docs.html
----------------------------------------------------------------------
diff --git a/content/docs/rest-endpoints/api-docs.html b/content/docs/rest-endpoints/api-docs.html
index 889f464..0ab74e4 100644
--- a/content/docs/rest-endpoints/api-docs.html
+++ b/content/docs/rest-endpoints/api-docs.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Methods &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Methods &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="COMING SOON..." href="../sdks/tbd.html"/>
         <link rel="prev" title="Admin user" href="../orgs-and-apps/admin-user.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -4186,7 +4186,7 @@ Entities.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/sdks/ios-new.html
----------------------------------------------------------------------
diff --git a/content/docs/sdks/ios-new.html b/content/docs/sdks/ios-new.html
index 8b3d8d2..c8b5d30 100644
--- a/content/docs/sdks/ios-new.html
+++ b/content/docs/sdks/ios-new.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid iOS SDK &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid iOS SDK &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -1291,7 +1291,7 @@ NSString *query = @&quot;uuid = b3aad0a4-f322-11e2-a9c1-999e12039f87 or name = &
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/sdks/sdk-outline.html
----------------------------------------------------------------------
diff --git a/content/docs/sdks/sdk-outline.html b/content/docs/sdks/sdk-outline.html
index 32c377c..60802d8 100644
--- a/content/docs/sdks/sdk-outline.html
+++ b/content/docs/sdks/sdk-outline.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Usergrid SDK Documentation outline &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Usergrid SDK Documentation outline &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -484,7 +484,7 @@ Node.js.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/sdks/tbd.html
----------------------------------------------------------------------
diff --git a/content/docs/sdks/tbd.html b/content/docs/sdks/tbd.html
index aaaa9ad..00ff51c 100644
--- a/content/docs/sdks/tbd.html
+++ b/content/docs/sdks/tbd.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>COMING SOON... &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>COMING SOON... &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Usergrid 2.1.0 Deployment Guide" href="../installation/deployment-guide.html"/>
         <link rel="prev" title="Methods" href="../rest-endpoints/api-docs.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -275,7 +275,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/search.html
----------------------------------------------------------------------
diff --git a/content/docs/search.html b/content/docs/search.html
index 113ad25..4491d15 100644
--- a/content/docs/search.html
+++ b/content/docs/search.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Search &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Search &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="index.html"/> 
 
   
   <script src="_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -269,7 +269,7 @@
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'./',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true


[07/54] [abbrv] usergrid git commit: Updated UsergridEntity constructor so you can pass more than just Maps with JsonNode values.

Posted by mr...@apache.org.
Updated UsergridEntity constructor so you can pass more than just Maps with JsonNode values.


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

Branch: refs/heads/apm
Commit: 5aacc346b933b3044d7d50f25274fe0f8d10d8e2
Parents: 588ce48
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu Apr 14 13:14:03 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu Apr 14 13:14:03 2016 -0500

----------------------------------------------------------------------
 .../org/apache/usergrid/java/client/model/UsergridEntity.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/5aacc346/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
index f1dc622..689f818 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/model/UsergridEntity.java
@@ -65,7 +65,7 @@ public class UsergridEntity {
         }
     }
 
-    public UsergridEntity(@NotNull final String type, @Nullable final String name, @NotNull final Map<String, JsonNode> properties) {
+    public UsergridEntity(@NotNull final String type, @Nullable final String name, @NotNull final Map<String, ?> properties) {
         this(type,name);
         this.updatePropertiesWithMap(properties);
     }
@@ -81,7 +81,7 @@ public class UsergridEntity {
         } catch( IllegalArgumentException e ) { System.out.print("Usergrid Error: Unable to update properties from entity - " + fromEntity.toString()); }
     }
 
-    public void updatePropertiesWithMap(@NotNull final Map<String,JsonNode> properties) {
+    public void updatePropertiesWithMap(@NotNull final Map<String,?> properties) {
         try {
             this.updatePropertiesWithJsonNode(entityUpdateMapper.valueToTree(properties));
         } catch( IllegalArgumentException e ) { System.out.print("Usergrid Error: Unable to update properties from map - " + properties.toString()); }


[43/54] [abbrv] usergrid git commit: Merge branch 'release-2.1.1'

Posted by mr...@apache.org.
Merge branch 'release-2.1.1'

* release-2.1.1: (23 commits)
  Add more info to the log statement when we can't load an application.
  Update logging statements to be trace level.
  Clear an app's push manager queue cache when notifiers are added ( current notifiers are stored as a hash map within the class instance).
  Re-work caching of push notification queue managers such that producing and consuming leverage the same cache.
  Ensure the hector cluster is created with credentials from the properties file.
  Added fixes around caching and changed the endpoint to selective indexing to be /_index instead of /_indexes
  Tweak heap status to return used heap, and changed endpoint to status/heap.
  Add status/memory endpoint to get heap usage, max heap, and free heap.
  Increase limit of device fetching per user to 50.
  Increase AWS client timeouts.
  Back to Schedulers.io()
  Update distinct to properly use device ID.
  Update distinct code.
  Fix scheduler.
  Temporarily disable notification counters and back to Schedulers.io()
  Fix NPE.
  Added a test for counters that isn't correctly configured to work with other tests yet, and added the counters to the backend of notifications for further examination.
  Add a separate executor pool for async processing instead of unbounded Schedulers.io()
  Invalidate ShiroCache when admin user added to org.
  Ensure that applicationId cache does not cache nulls.
  ...


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

Branch: refs/heads/apm
Commit: e4beaead1026f280ea65b363c40f48e22be65a2b
Parents: 279c020 f4c8a01
Author: George Reyes <gr...@apache.org>
Authored: Mon May 2 12:44:49 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Mon May 2 12:44:49 2016 -0700

----------------------------------------------------------------------
 .../main/resources/usergrid-default.properties  |  10 +-
 .../corepersistence/ApplicationIdCacheImpl.java |   9 +-
 .../corepersistence/CpEntityManager.java        |   4 +-
 .../index/IndexSchemaCacheFig.java              |   2 +-
 .../index/IndexSchemaCacheImpl.java             |   3 +-
 .../corepersistence/index/IndexServiceImpl.java |   1 +
 .../org/apache/usergrid/utils/StringUtils.java  |   8 +
 .../main/resources/usergrid-core-context.xml    |   6 +
 .../shard/impl/NodeShardAllocationImpl.java     |   7 +-
 .../shard/impl/ShardGroupCompactionImpl.java    |  18 +--
 .../usergrid/persistence/queue/QueueFig.java    |   4 +-
 .../queue/impl/QueueManagerFactoryImpl.java     |  27 ++--
 .../org/apache/usergrid/rest/RootResource.java  |  25 +++
 .../rest/applications/CollectionResource.java   |   8 +-
 .../apache/usergrid/rest/NotificationsIT.java   |  11 ++
 .../collection/CollectionsResourceIT.java       | 147 +++++++++++++++---
 .../events/ApplicationRequestCounterIT.java     |  48 ++++++
 .../cassandra/ManagementServiceImpl.java        |  93 ++++++------
 .../ApplicationQueueManagerCache.java           | 143 ++++++++++++++++++
 .../notifications/NotificationsService.java     |  11 +-
 .../services/notifications/QueueListener.java   |  58 ++-----
 .../services/notifications/TaskManager.java     | 117 +++++++-------
 .../impl/ApplicationQueueManagerImpl.java       | 151 +++++++++++++------
 .../services/notifiers/NotifiersService.java    |   6 +
 .../gcm/NotificationsServiceIT.java             |  77 ++++++++++
 25 files changed, 741 insertions(+), 253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/e4beaead/stack/core/src/main/resources/usergrid-core-context.xml
----------------------------------------------------------------------


[14/54] [abbrv] usergrid git commit: Do not add "none" to list of required fields!

Posted by mr...@apache.org.
Do not add "none" to list of required fields!


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

Branch: refs/heads/apm
Commit: d8371e1a64d7f8004233f171eb9ddb79b7166f70
Parents: f505e59
Author: Dave Johnson <sn...@apache.org>
Authored: Mon Apr 18 08:26:37 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon Apr 18 08:26:37 2016 -0400

----------------------------------------------------------------------
 .../usergrid/corepersistence/index/IndexServiceImpl.java |  3 +++
 .../java/org/apache/usergrid/rest/NotificationsIT.java   | 11 +++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/d8371e1a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
index ad997c8..9509626 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
@@ -226,6 +226,9 @@ public class IndexServiceImpl implements IndexService {
                 return Optional.absent();
             }
 
+            // never add "none" because it has special meaning, "none" disables indexing for a type
+            fieldsToKeep.remove("none");
+
             defaultProperties.addAll( fieldsToKeep );
         }
         else {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d8371e1a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
index 61dc419..1655846 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
@@ -78,6 +78,17 @@ public class NotificationsIT extends org.apache.usergrid.rest.test.resource.Abst
 
     @Test
     public void testPaging() throws Exception {
+
+        // this test should work even with indexing turned off for notificaitons collection
+        ArrayList<String> indexingArray = new ArrayList<>(  );
+        indexingArray.add( "none" );
+        Entity payload = new Entity();
+        payload.put( "fields", indexingArray);
+
+        String unIndexedCollectionName = "notifications";
+        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload );
+        refreshIndex();
+
         // create notifier
         Entity notifier = new Entity().chainPut("name", "mynotifier").chainPut("provider", "noop");
 


[15/54] [abbrv] usergrid git commit: Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1

Posted by mr...@apache.org.
Merge branch 'release-2.1.1' of https://git-wip-us.apache.org/repos/asf/usergrid into release-2.1.1

# Conflicts:
#	stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java


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

Branch: refs/heads/apm
Commit: 666c49e09e09a88137d6215447f46088907bb01c
Parents: d8371e1 b8f502f
Author: Dave Johnson <sn...@apache.org>
Authored: Mon Apr 18 08:43:14 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon Apr 18 08:43:14 2016 -0400

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  55 ++--
 .../corepersistence/CpRelationManager.java      | 103 ++++++-
 .../pipeline/builder/IdBuilder.java             |   6 +
 .../pipeline/read/FilterFactory.java            |   8 +-
 .../pipeline/read/traverse/IdFilter.java        |  52 ++++
 .../results/IdQueryExecutor.java                |  66 +++++
 .../service/ApplicationServiceImpl.java         |  37 ++-
 .../service/CollectionSearch.java               |   9 +
 .../service/CollectionService.java              |   5 +
 .../service/CollectionServiceImpl.java          |  23 ++
 .../persistence/MultiQueryIterator.java         |   2 +-
 .../persistence/NotificationGraphIterator.java  | 163 +++++++++++
 .../persistence/PagingResultsIterator.java      |  25 +-
 .../apache/usergrid/persistence/PathQuery.java  |  47 +++-
 .../apache/usergrid/persistence/Results.java    |  20 ++
 .../persistence/entities/Notification.java      |  70 ++++-
 .../index/impl/EsEntityIndexImpl.java           |  16 +-
 .../index/impl/FailureMonitorImpl.java          |   2 +-
 .../IllegalArgumentExceptionMapper.java         |   4 +-
 .../collection/CollectionsResourceIT.java       |   6 +-
 .../notifications/NotificationDeviceFilter.java |  45 +++
 .../notifications/NotificationsService.java     |  32 ++-
 .../impl/ApplicationQueueManagerImpl.java       | 273 +++++++++++--------
 .../gcm/NotificationsServiceIT.java             |   2 +-
 24 files changed, 875 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/666c49e0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------


[13/54] [abbrv] usergrid git commit: Added the decrement call to delete so that entity counters are decremented. Added test proving that entity counters are decremented.

Posted by mr...@apache.org.
Added the decrement call to delete so that entity counters are decremented.
Added test proving that entity counters are decremented.


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

Branch: refs/heads/apm
Commit: f76aeaf56e4b12516415db52da388eabc3ba20de
Parents: f064c49
Author: George Reyes <gr...@apache.org>
Authored: Fri Apr 15 14:40:27 2016 -0700
Committer: George Reyes <gr...@apache.org>
Committed: Fri Apr 15 14:40:27 2016 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  4 +-
 .../events/ApplicationRequestCounterIT.java     | 48 ++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f76aeaf5/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index b2330f3..93f9b64 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -649,15 +649,15 @@ public class CpEntityManager implements EntityManager {
      */
     @Override
     public void delete( EntityRef entityRef ) throws Exception {
-        //TODO: since we want the user to mark it and we sweep it later. It should be marked by the graph manager here.
         //Step 1 & 2 Currently to block so we ensure that marking is done immediately
         //If this returns null then nothing was marked null so the entity doesn't exist
         markEntity( entityRef ).toBlocking().lastOrDefault( null );
 
-        //TODO: figure out how to return async call to service tier? Do I not need to?
         //Step 3
         deleteAsync( entityRef );
 
+        decrementEntityCollection( Schema.defaultCollectionName( entityRef.getType() ));
+
     }
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f76aeaf5/stack/rest/src/test/java/org/apache/usergrid/rest/applications/events/ApplicationRequestCounterIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/events/ApplicationRequestCounterIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/events/ApplicationRequestCounterIT.java
index a1c07c5..cf07dff 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/events/ApplicationRequestCounterIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/events/ApplicationRequestCounterIT.java
@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.Collection;
+import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 
 import static org.junit.Assert.assertEquals;
@@ -62,4 +63,51 @@ public class ApplicationRequestCounterIT extends AbstractRestIT {
         assertEquals( 2, ( ( LinkedHashMap ) ( ( ArrayList)counters.get( "values" )).get( 0 )).get( "value" ));
 
     }
+
+    @Test
+    public void testDecrementingEntityCounters() throws Exception {
+
+        //Create test collection with test entity that is full text indexed.
+        int numberOfEntitiesToCreate = 10;
+
+        Entity[] entities = new Entity[numberOfEntitiesToCreate];
+        Entity testEntity = new Entity();
+        for(int i = 0; i < numberOfEntitiesToCreate; i++){
+            testEntity.put( "one","value"+i );
+            testEntity.put( "two","valuetwo"+i );
+            entities[i]= this.app().collection( "testCollection" ).post( testEntity );
+        }
+
+        //get default application
+       // ApiResponse defaultApp = org().app( clientSetup.getAppName() ).get();
+
+        QueryParameters queryParameters = new QueryParameters();
+        queryParameters.addParam( "resolution", "all" ).addParam( "counter", "application.collection.testcollections" );
+        Collection countersResponse = org().app( clientSetup.getAppName() ).collection( "counters" ).get( queryParameters ,true );
+
+        assertNotNull( countersResponse );
+        ArrayList counterValues = ( ArrayList ) countersResponse.getResponse().getProperties().get( "counters" );
+        LinkedHashMap counters = ( LinkedHashMap ) counterValues.get( 0 );
+        assertEquals( "application.collection.testcollections", counters.get( "name" ) );
+
+        //Since it was accessed twice above.
+        assertEquals( 10, ( ( LinkedHashMap ) ( ( ArrayList)counters.get( "values" )).get( 0 )).get( "value" ));
+
+        for(int i = 0; i < numberOfEntitiesToCreate; i++){
+            this.app().collection( "testCollection" ).entity( entities[i] ).delete( );
+        }
+        
+        queryParameters.addParam( "resolution", "all" ).addParam( "counter", "application.collection.testcollections" );
+        countersResponse = org().app( clientSetup.getAppName() ).collection( "counters" ).get( queryParameters ,true );
+
+        assertNotNull( countersResponse );
+        counterValues = ( ArrayList ) countersResponse.getResponse().getProperties().get( "counters" );
+        counters = ( LinkedHashMap ) counterValues.get( 0 );
+        assertEquals( "application.collection.testcollections", counters.get( "name" ) );
+
+        //Since it was accessed twice above.
+        assertEquals( 0, ( ( LinkedHashMap ) ( ( ArrayList)counters.get( "values" )).get( 0 )).get( "value" ));
+
+
+    }
 }


[04/54] [abbrv] usergrid git commit: Initial commit for new JavaSDK.

Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
new file mode 100644
index 0000000..396c8f6
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClient.java
@@ -0,0 +1,420 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import org.apache.usergrid.java.client.UsergridEnums.*;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.auth.UsergridAuth;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.model.*;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public class UsergridClient {
+
+    @NotNull public static String DEFAULT_BASE_URL = "https://api.usergrid.com";
+
+    @NotNull private UsergridClientConfig config;
+    @Nullable private UsergridUser currentUser = null;
+    @Nullable private UsergridAuth tempAuth = null;
+
+    @NotNull private final UsergridRequestManager requestManager;
+
+    public UsergridClient(@NotNull final UsergridClientConfig config) {
+        this.config = config;
+        this.requestManager = new UsergridRequestManager(this);
+    }
+
+    public UsergridClient(@NotNull final String orgId, @NotNull final String appId) {
+        this(new UsergridClientConfig(orgId, appId));
+    }
+
+    public UsergridClient(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl) {
+        this(new UsergridClientConfig(orgId, appId, baseUrl));
+    }
+
+    public UsergridClient(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl, @NotNull final UsergridAuthMode authMode) {
+        this(new UsergridClientConfig(orgId, appId, baseUrl, authMode));
+    }
+
+    @NotNull public UsergridClientConfig getConfig() { return this.config; }
+    public void setConfig(@NotNull final UsergridClientConfig config) { this.config = config; }
+
+    @NotNull public String getAppId() { return this.config.appId; }
+    public void setAppId(@NotNull final String appId) { this.config.appId = appId; }
+
+    @NotNull public String getOrgId() { return this.config.orgId; }
+    public void setOrgId(@NotNull final String orgId) { this.config.orgId = orgId; }
+
+    @NotNull public String getBaseUrl() { return this.config.baseUrl; }
+    public void setBaseUrl(@NotNull final String baseUrl) { this.config.baseUrl = baseUrl; }
+
+    @NotNull public String clientAppUrl() { return getBaseUrl() + "/" + getOrgId() + "/" + getAppId(); }
+
+    @NotNull public UsergridAuthMode getAuthMode() { return this.config.authMode; }
+    public void setAuthMode(@NotNull final UsergridAuthMode authMode) { this.config.authMode = authMode; }
+
+    @Nullable public UsergridUser getCurrentUser() { return this.currentUser; }
+    public void setCurrentUser(@Nullable final UsergridUser currentUser) { this.currentUser = currentUser; }
+
+    @Nullable public UsergridUserAuth getUserAuth() { return (this.currentUser != null) ? this.currentUser.getUserAuth() : null; }
+
+    @Nullable public UsergridAppAuth getAppAuth() { return this.config.appAuth; }
+    public void setAppAuth(@Nullable final UsergridAppAuth appAuth) { this.config.appAuth = appAuth; }
+
+    @Nullable
+    public UsergridAuth authForRequests() {
+        UsergridAuth authForRequests = null;
+        if (tempAuth != null) {
+            if (tempAuth.isValidToken()) {
+                authForRequests = tempAuth;
+            }
+            tempAuth = null;
+        } else {
+            switch (config.authMode) {
+                case USER: {
+                    if (this.currentUser != null && this.currentUser.getUserAuth() != null && this.currentUser.getUserAuth().isValidToken()) {
+                        authForRequests = this.currentUser.getUserAuth();
+                    }
+                    break;
+                }
+                case APP: {
+                    if (this.config.appAuth != null && this.config.appAuth.isValidToken()) {
+                        authForRequests = this.config.appAuth;
+                    }
+                    break;
+                }
+            }
+        }
+        return authForRequests;
+    }
+
+    @NotNull
+    public UsergridClient usingAuth(@Nullable final UsergridAuth auth) {
+        this.tempAuth = auth;
+        return this;
+    }
+
+    @NotNull
+    public UsergridClient usingToken(@NotNull final String accessToken) {
+        this.tempAuth = new UsergridAuth(accessToken);
+        return this;
+    }
+
+    @NotNull
+    public UsergridResponse authenticateApp() {
+        if( this.config.appAuth == null ) {
+            return UsergridResponse.fromError(this,  "Invalid UsergridAppAuth.", "UsergridClient's appAuth is null.");
+        }
+        return this.authenticateApp(this.config.appAuth);
+    }
+
+    @NotNull
+    public UsergridResponse authenticateApp(@NotNull final UsergridAppAuth auth) {
+        this.config.appAuth = auth;
+        return this.requestManager.authenticateApp(auth);
+    }
+
+    @NotNull
+    public UsergridResponse authenticateUser(@NotNull final UsergridUserAuth userAuth) {
+        return this.authenticateUser(userAuth,true);
+    }
+
+    @NotNull
+    public UsergridResponse authenticateUser(@NotNull final UsergridUserAuth userAuth, final boolean setAsCurrentUser) {
+        UsergridResponse response = this.requestManager.authenticateUser(userAuth);
+        if( response.ok() && setAsCurrentUser ) {
+            this.setCurrentUser(response.user());
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse resetPassword(@NotNull final UsergridUser user, @NotNull final String oldPassword, @NotNull final String newPassword) {
+        String usernameOrEmail = user.usernameOrEmail();
+        if( usernameOrEmail == null ) {
+            return UsergridResponse.fromError(this,  "Error resetting password.", "The UsergridUser object must contain a valid username or email to reset the password.");
+        }
+        Map<String, Object> data = new HashMap<>();
+        data.put("newpassword", newPassword);
+        data.put("oldpassword", oldPassword);
+        String[] pathSegments = { "users", usernameOrEmail, "password"};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, data, this.authForRequests() ,pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse logoutCurrentUser()  {
+        UsergridUser currentUser = this.currentUser;
+        if( currentUser != null ) {
+            String uuidOrUsername = currentUser.uuidOrUsername();
+            UsergridUserAuth userAuth = currentUser.getUserAuth();
+            if( uuidOrUsername != null && userAuth != null ) {
+                String accessToken = userAuth.getAccessToken();
+                if( accessToken != null ) {
+                    return logoutUser(uuidOrUsername, accessToken);
+                }
+            }
+        }
+        return UsergridResponse.fromError(this,"UsergridClient's currentUser is not valid.", "UsergridClient's currentUser is null or has no uuid or username.");
+    }
+
+    @NotNull
+    public UsergridResponse logoutUserAllTokens(@NotNull final String uuidOrUsername) {
+        return logoutUser(uuidOrUsername, null);
+    }
+
+    @NotNull
+    public UsergridResponse logoutUser(@NotNull final String uuidOrUsername, @Nullable final String token){
+        String[] pathSegments = {"users", uuidOrUsername, ""};
+        int len = pathSegments.length;
+        Map<String, Object> param = new HashMap<>();
+        if(token != null){
+            pathSegments[len-1] = "revoketoken";
+            param.put("token",token);
+        }
+        else{
+            pathSegments[len-1] = "revoketokens";
+        }
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), param, null, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse sendRequest(@NotNull final UsergridRequest request) {
+        return this.requestManager.performRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse GET(@NotNull final String type, @NotNull final String uuidOrName) {
+        String[] pathSegments = {type, uuidOrName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse GET(@NotNull final String type) {
+        String[] pathSegments = {type};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse GET(@NotNull final UsergridQuery query) {
+        String collectionName = query.getCollection();
+        if( collectionName == null ) {
+            return UsergridResponse.fromError(this,  "Query collection name missing.", "Query collection name is missing.");
+        }
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), query, this.authForRequests() , collectionName);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+        String[] pathSegments = { type, uuidOrName };
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+        String uuidOrName = null;
+        Object uuid = jsonBody.get(UsergridEntityProperties.UUID.toString());
+        if( uuid != null ) {
+            uuidOrName = uuid.toString();
+        } else {
+            Object name = jsonBody.get(UsergridEntityProperties.NAME.toString());
+            if( name != null ) {
+                uuidOrName = name.toString();
+            }
+        }
+        if( uuidOrName == null ) {
+            return UsergridResponse.fromError(this,  "jsonBody not valid..", "The `jsonBody` must contain a valid value for either `uuid` or `name`.");
+        }
+        String[] pathSegments = { type, uuidOrName };
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse PUT(@NotNull final UsergridEntity entity) {
+        String entityUuidOrName = entity.uuidOrName();
+        if( entityUuidOrName == null ) {
+            return UsergridResponse.fromError(this,  "No UUID or name found.", "The entity object must have a `uuid` or `name` assigned.");
+        }
+        String[] pathSegments = { entity.getType(), entityUuidOrName };
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, entity, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, Object> jsonBody) {
+        String collectionName = query.getCollection();
+        if( collectionName == null ) {
+            return UsergridResponse.fromError(this,  "Query collection name missing.", "Query collection name is missing.");
+        }
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.PUT, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, null, query, this.authForRequests(),collectionName);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse POST(final @NotNull UsergridEntity entity) {
+        String[] pathSegments = {entity.getType()};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, entity, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse POST(@NotNull final List<UsergridEntity> entities) {
+        if( entities.isEmpty() ) {
+            return UsergridResponse.fromError(this,  "Unable to POST entities.", "entities array is empty.");
+        }
+        String[] pathSegments = {entities.get(0).getType()};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, entities, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse POST(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+        String[] pathSegments = {type, uuidOrName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBody, this.authForRequests() , type);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, Object>> jsonBodies) {
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), null, jsonBodies, this.authForRequests() , type);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse DELETE(@NotNull final UsergridEntity entity) {
+        String entityUuidOrName = entity.uuidOrName();
+        if( entityUuidOrName == null ) {
+            return UsergridResponse.fromError(this,  "No UUID or name found.", "The entity object must have a `uuid` or `name` assigned.");
+        }
+        String[] pathSegments = {entity.getType(), entityUuidOrName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse DELETE(@NotNull final String type, @NotNull final String uuidOrName) {
+        String[] pathSegments = {type, uuidOrName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse DELETE(@NotNull final UsergridQuery query) {
+        String collectionName = query.getCollection();
+        if( collectionName == null ) {
+            return UsergridResponse.fromError(this,  "Query collection name missing.", "Query collection name is missing.");
+        }
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), query, this.authForRequests() , collectionName);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse connect(@NotNull final UsergridEntity entity, @NotNull final String relationship, @NotNull final UsergridEntity to) {
+        String entityUuidOrName = entity.uuidOrName();
+        String toUuidOrName = to.uuidOrName();
+        if( entityUuidOrName == null || toUuidOrName == null ) {
+            return UsergridResponse.fromError(this, "Invalid Entity Connection Attempt.", "One or both entities that are attempting to be connected do not contain a valid UUID or Name property.");
+        }
+        return this.connect(entity.getType(), entityUuidOrName, relationship, to.getType(), toUuidOrName);
+    }
+
+    @NotNull
+    public UsergridResponse connect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String toType, @NotNull final String toName) {
+        String[] pathSegments = {entityType, entityId, relationship, toType, toName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse connect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String toId) {
+        String[] pathSegments = { entityType, entityId, relationship, toId};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse disconnect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String fromUuid) {
+        String[] pathSegments = {entityType, entityId, relationship, fromUuid};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse disconnect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String fromType, @NotNull final String fromName) {
+        String[] pathSegments = {entityType, entityId, relationship, fromType, fromName};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse disconnect(@NotNull final UsergridEntity entity, @NotNull final String relationship, @NotNull final UsergridEntity from) {
+        String entityUuidOrName = entity.uuidOrName();
+        String fromUuidOrName = from.uuidOrName();
+        if( entityUuidOrName == null || fromUuidOrName == null ) {
+            return UsergridResponse.fromError(this, "Invalid Entity Disconnect Attempt.", "One or both entities that are attempting to be disconnected do not contain a valid UUID or Name property.");
+        }
+        return this.disconnect(entity.getType(), entityUuidOrName, relationship, from.getType(), fromUuidOrName);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final UsergridEntity entity, @NotNull final String relationship) {
+        return this.getConnections(direction,entity,relationship,null);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final UsergridEntity entity, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        String entityUuidOrName = entity.uuidOrName();
+        if( entityUuidOrName == null ) {
+            return UsergridResponse.fromError(this, "Invalid Entity Get Connections Attempt.", "The entity must have a `uuid` or `name` assigned.");
+        }
+        return this.getConnections(direction,entity.getType(),entityUuidOrName,relationship,query);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final String type, @NotNull final String uuidOrName, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        String[] pathSegments = {type, uuidOrName, direction.connectionValue(), relationship};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), query, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+
+    @NotNull
+    public UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final String uuid, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        String[] pathSegments = {uuid, direction.connectionValue(), relationship};
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.GET, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.clientAppUrl(), query, this.authForRequests() , pathSegments);
+        return this.sendRequest(request);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
new file mode 100644
index 0000000..b27d914
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridClientConfig.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import org.apache.usergrid.java.client.UsergridEnums.UsergridAuthMode;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class UsergridClientConfig {
+
+    // The organization identifier.
+    @NotNull public String orgId;
+
+    // The application identifier.
+    @NotNull public String appId;
+
+    // The base URL that all calls will be made with.
+    @NotNull public String baseUrl = UsergridClient.DEFAULT_BASE_URL;
+
+    // The `UsergridAuthMode` value used to determine what type of token will be sent, if any.
+    @NotNull public UsergridAuthMode authMode = UsergridAuthMode.USER;
+
+    @Nullable public UsergridAppAuth appAuth = null;
+
+    public UsergridClientConfig(@NotNull final String orgId, @NotNull final String appId) {
+        this.orgId = orgId;
+        this.appId = appId;
+    }
+
+    public UsergridClientConfig(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl) {
+        this.orgId = orgId;
+        this.appId = appId;
+        this.baseUrl = baseUrl;
+    }
+
+    public UsergridClientConfig(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl, @NotNull final UsergridAuthMode authMode) {
+        this.orgId = orgId;
+        this.appId = appId;
+        this.baseUrl = baseUrl;
+        this.authMode = authMode;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridEnums.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridEnums.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridEnums.java
new file mode 100644
index 0000000..4e2a8b0
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridEnums.java
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@SuppressWarnings("unused")
+public class UsergridEnums {
+    public enum UsergridAuthMode {
+        NONE,
+        USER,
+        APP
+    }
+
+    public enum UsergridDirection {
+        IN("connecting"),
+        OUT("connections");
+
+        @NotNull private final String connectionValue;
+
+        UsergridDirection(@NotNull final String connectionValue) {
+            this.connectionValue = connectionValue;
+        }
+
+        @NotNull
+        public String connectionValue() {
+            return this.connectionValue;
+        }
+    }
+
+    public enum UsergridHttpMethod {
+        GET,
+        PUT,
+        POST,
+        DELETE;
+
+        @Nullable
+        public static UsergridHttpMethod fromString(@NotNull final String stringValue) {
+            try {
+                return UsergridHttpMethod.valueOf(stringValue.toUpperCase());
+            } catch(Exception e) {
+                return null;
+            }
+        }
+
+        @Override @NotNull
+        public String toString() {
+            return super.toString().toUpperCase();
+        }
+    }
+
+    public enum UsergridQueryOperator {
+        EQUAL("="),
+        GREATER_THAN(">"),
+        GREATER_THAN_EQUAL_TO(">="),
+        LESS_THAN("<"),
+        LESS_THAN_EQUAL_TO("<=");
+
+        @NotNull private final String operatorValue;
+
+        UsergridQueryOperator(@NotNull final String operatorValue) {
+            this.operatorValue = operatorValue;
+        }
+
+        @NotNull
+        public String operatorValue() {
+            return this.operatorValue;
+        }
+    }
+
+    public enum UsergridQuerySortOrder {
+        ASC,
+        DESC;
+
+        @Nullable
+        public static UsergridQuerySortOrder fromString(@NotNull final String stringValue) {
+            try {
+                return UsergridQuerySortOrder.valueOf(stringValue.toUpperCase());
+            } catch(Exception e) {
+                return null;
+            }
+        }
+
+        @Override @NotNull
+        public String toString() {
+            return super.toString().toLowerCase();
+        }
+    }
+
+    public enum UsergridEntityProperties {
+        TYPE,
+        UUID,
+        NAME,
+        CREATED,
+        MODIFIED,
+        LOCATION;
+
+        @Nullable
+        public static UsergridEntityProperties fromString(@NotNull final String stringValue) {
+            try {
+                return UsergridEntityProperties.valueOf(stringValue.toUpperCase());
+            } catch(Exception e) {
+                return null;
+            }
+        }
+
+        @Override @NotNull
+        public String toString() {
+            return super.toString().toLowerCase();
+        }
+
+        public boolean isMutableForEntity(@NotNull final UsergridEntity entity) {
+            switch(this) {
+                case LOCATION: {
+                    return true;
+                }
+                case NAME: {
+                    return entity.isUser();
+                }
+                case TYPE:
+                case UUID:
+                case CREATED:
+                case MODIFIED:
+                default: {
+                    return false;
+                }
+            }
+        }
+    }
+
+    public enum UsergridUserProperties {
+        NAME,
+        USERNAME,
+        PASSWORD,
+        EMAIL,
+        ACTIVATED,
+        DISABLED,
+        PICTURE;
+
+        @Nullable
+        public static UsergridUserProperties fromString(@NotNull final String stringValue) {
+            try {
+                return UsergridUserProperties.valueOf(stringValue.toUpperCase());
+            } catch(Exception e) {
+                return null;
+            }
+        }
+
+        @Override @NotNull
+        public String toString() {
+            return super.toString().toLowerCase();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
new file mode 100644
index 0000000..77ee148
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequest.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import okhttp3.HttpUrl;
+import okhttp3.MediaType;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import org.apache.usergrid.java.client.UsergridEnums.UsergridHttpMethod;
+import org.apache.usergrid.java.client.auth.UsergridAuth;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.utils.JsonUtils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public class UsergridRequest {
+    @NotNull public static final MediaType APPLICATION_JSON_MEDIA_TYPE = MediaType.parse("application/json; charset=utf-8");
+
+    @NotNull private UsergridHttpMethod method;
+    @NotNull private String baseUrl;
+    @NotNull private MediaType contentType;
+
+    @Nullable private UsergridQuery query;
+    @Nullable private Map<String, Object> headers;
+    @Nullable private Map<String, Object> parameters;
+    @Nullable private Object data;
+    @Nullable private UsergridAuth auth;
+    @Nullable private String[] pathSegments;
+
+    @NotNull
+    public UsergridHttpMethod getMethod() { return method; }
+    public void setMethod(@NotNull final UsergridHttpMethod method) { this.method = method; }
+
+    @NotNull
+    public String getBaseUrl() { return baseUrl; }
+    public void setBaseUrl(@NotNull final String baseUrl) { this.baseUrl = baseUrl; }
+
+    @NotNull
+    public MediaType getContentType() { return contentType; }
+    public void setContentType(@NotNull final MediaType contentType) { this.contentType = contentType; }
+
+    @Nullable
+    public UsergridQuery getQuery() { return query; }
+    public void setQuery(@Nullable final UsergridQuery query) { this.query = query; }
+
+    @Nullable
+    public Map<String,Object> getHeaders() { return headers; }
+    public void setHeaders(@Nullable final Map<String,Object> headers) { this.headers = headers; }
+
+    @Nullable
+    public Map<String,Object> getParameters() { return parameters; }
+    public void setParameters(@Nullable final Map<String,Object> parameters) { this.parameters = parameters; }
+
+    @Nullable
+    public Object getData() { return data; }
+    public void setData(@Nullable final Object data) { this.data = data; }
+
+    @Nullable
+    public UsergridAuth getAuth() { return auth; }
+    public void setAuth(@Nullable final UsergridAuth auth) { this.auth = auth; }
+
+    @Nullable
+    public String[] getPathSegments() { return pathSegments; }
+    public void setPathSegments(@Nullable final String[] pathSegments) { this.pathSegments = pathSegments; }
+
+    public UsergridRequest(@NotNull final UsergridHttpMethod method,
+                           @NotNull final MediaType contentType,
+                           @NotNull final String url,
+                           @Nullable final UsergridQuery query,
+                           @Nullable final UsergridAuth auth,
+                           @Nullable final String... pathSegments) {
+        this.method = method;
+        this.contentType = contentType;
+        this.baseUrl = url;
+        this.query = query;
+        this.auth = auth;
+        this.pathSegments = pathSegments;
+    }
+
+    public UsergridRequest(@NotNull final UsergridHttpMethod method,
+                           @NotNull final MediaType contentType,
+                           @NotNull final String url,
+                           @Nullable final UsergridAuth auth,
+                           @Nullable final String... pathSegments) {
+        this.method = method;
+        this.contentType = contentType;
+        this.baseUrl = url;
+        this.auth = auth;
+        this.pathSegments = pathSegments;
+    }
+
+    public UsergridRequest(@NotNull final UsergridHttpMethod method,
+                           @NotNull final MediaType contentType,
+                           @NotNull final String url,
+                           @Nullable final Map<String, Object> params,
+                           @Nullable final Object data,
+                           @Nullable final UsergridAuth auth,
+                           @Nullable final String... pathSegments) {
+        this.method = method;
+        this.contentType = contentType;
+        this.baseUrl = url;
+        this.parameters = params;
+        this.data = data;
+        this.headers = null;
+        this.query = null;
+        this.auth = auth;
+        this.pathSegments = pathSegments;
+    }
+
+    public UsergridRequest(@NotNull final UsergridHttpMethod method,
+                           @NotNull final MediaType contentType,
+                           @NotNull final String url,
+                           @Nullable final Map<String, Object> params,
+                           @Nullable final Object data,
+                           @Nullable final Map<String, Object> headers,
+                           @Nullable final UsergridQuery query,
+                           @Nullable final UsergridAuth auth,
+                           @Nullable final String... pathSegments) {
+        this.method = method;
+        this.contentType = contentType;
+        this.baseUrl = url;
+        this.parameters = params;
+        this.data = data;
+        this.headers = headers;
+        this.query = query;
+        this.pathSegments = pathSegments;
+    }
+
+    @NotNull
+    public Request buildRequest() {
+        Request.Builder requestBuilder = new Request.Builder();
+        requestBuilder.url(this.constructUrl());
+        this.addHeaders(requestBuilder);
+        requestBuilder.method(this.method.toString(),this.constructRequestBody());
+        return requestBuilder.build();
+    }
+
+    @NotNull
+    private HttpUrl constructUrl() {
+        String url = this.baseUrl;
+        if( this.query != null ) {
+            url += this.query.build();
+        }
+        HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder();
+        if( this.pathSegments != null ) {
+            for( String path : this.pathSegments ) {
+                urlBuilder.addPathSegment(path);
+            }
+        }
+        if( this.parameters != null ) {
+            for (Map.Entry<String, Object> param : this.parameters.entrySet()) {
+                urlBuilder.addQueryParameter(param.getKey(),param.getValue().toString());
+            }
+        }
+        return urlBuilder.build();
+    }
+
+    private void addHeaders(@NotNull final Request.Builder requestBuilder) {
+        requestBuilder.addHeader("User-Agent", UsergridRequestManager.USERGRID_USER_AGENT);
+        if (this.auth != null ) {
+            String accessToken = this.auth.getAccessToken();
+            if( accessToken != null ) {
+                requestBuilder.addHeader("Authorization", "Bearer " + accessToken);
+            }
+        }
+        if( this.headers != null ) {
+            for( Map.Entry<String,Object> header : this.headers.entrySet() ) {
+                requestBuilder.addHeader(header.getKey(),header.getValue().toString());
+            }
+        }
+    }
+
+    @Nullable
+    private RequestBody constructRequestBody() {
+        RequestBody requestBody = null;
+        if (method == UsergridHttpMethod.POST || method == UsergridHttpMethod.PUT) {
+            String jsonString = "";
+            if( this.data != null ) {
+                jsonString = JsonUtils.toJsonString(this.data);
+            }
+            requestBody = RequestBody.create(this.contentType,jsonString);
+        }
+        return requestBody;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
new file mode 100644
index 0000000..b3e3597
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/UsergridRequestManager.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import org.apache.usergrid.java.client.UsergridEnums.UsergridHttpMethod;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.auth.UsergridAuth;
+import org.apache.usergrid.java.client.model.UsergridUser;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.IOException;
+import java.util.Map;
+
+import static org.apache.usergrid.java.client.utils.ObjectUtils.isEmpty;
+
+public class UsergridRequestManager {
+
+    @NotNull public static final String USERGRID_USER_AGENT = "usergrid-java/v" + Usergrid.UsergridSDKVersion;
+
+    @NotNull private final UsergridClient usergridClient;
+    @NotNull private final OkHttpClient httpClient;
+
+    public UsergridRequestManager(@NotNull final UsergridClient usergridClient) {
+        this.usergridClient = usergridClient;
+        this.httpClient = new OkHttpClient();
+    }
+
+    @NotNull
+    public UsergridResponse performRequest(@NotNull final UsergridRequest usergridRequest) {
+        Request request = usergridRequest.buildRequest();
+        UsergridResponse usergridResponse;
+        try {
+            Response response = this.httpClient.newCall(request).execute();
+            usergridResponse = UsergridResponse.fromResponse(this.usergridClient,usergridRequest,response);
+        } catch( IOException exception ) {
+            usergridResponse = UsergridResponse.fromException(this.usergridClient,exception);
+        }
+        return usergridResponse;
+    }
+
+    @NotNull
+    private UsergridResponse authenticate(@NotNull final UsergridAuth auth) {
+        Map<String, String> credentials = auth.credentialsMap();
+        UsergridRequest request = new UsergridRequest(UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, this.usergridClient.clientAppUrl(), null, credentials, this.usergridClient.authForRequests(), "token");
+        UsergridResponse response = performRequest(request);
+        if (!isEmpty(response.getAccessToken()) && !isEmpty(response.getExpires())) {
+            auth.setAccessToken(response.getAccessToken());
+            auth.setExpiry(System.currentTimeMillis() + response.getExpires() - 5000);
+        }
+        return response;
+    }
+
+    @NotNull
+    public UsergridResponse authenticateApp(@NotNull final UsergridAppAuth appAuth) {
+        return this.authenticate(appAuth);
+    }
+
+    @NotNull
+    public UsergridResponse authenticateUser(@NotNull final UsergridUserAuth userAuth) {
+        UsergridResponse response = this.authenticate(userAuth);
+        UsergridUser responseUser = response.user();
+        if ( response.ok() && responseUser != null) {
+            responseUser.setUserAuth(userAuth);
+        }
+        return response;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
new file mode 100644
index 0000000..3ad7251
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAppAuth.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.auth;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+
+@SuppressWarnings("unused")
+public class UsergridAppAuth extends UsergridAuth {
+
+    @NotNull private String clientId;
+    @NotNull private String clientSecret;
+
+    @NotNull public String getClientId() { return clientId; }
+    public void setClientId(@NotNull final String clientId) { this.clientId = clientId; }
+
+    @NotNull private String getClientSecret() { return clientSecret; }
+    public void setClientSecret(@NotNull final String clientSecret) { this.clientSecret = clientSecret; }
+
+    @NotNull
+    @Override
+    public HashMap<String, String> credentialsMap() {
+        HashMap<String,String> credentials = super.credentialsMap();
+        credentials.put("grant_type", "client_credentials");
+        credentials.put("client_id", this.clientId);
+        credentials.put("client_secret", this.clientSecret);
+        return credentials;
+    }
+
+    public UsergridAppAuth(@NotNull final String clientId, @NotNull final String clientSecret) {
+        super();
+        this.clientId = clientId;
+        this.clientSecret = clientSecret;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
new file mode 100644
index 0000000..81d9187
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridAuth.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.auth;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+
+@SuppressWarnings("unused")
+public class UsergridAuth {
+
+    @Nullable private String accessToken = null;
+    @Nullable private Long expiry = null;
+    private boolean usingToken = false;
+
+    public UsergridAuth() { }
+
+    public UsergridAuth(@Nullable final String accessToken) {
+        this.usingToken = true;
+        setAccessToken(accessToken);
+    }
+
+    public UsergridAuth(@Nullable final String accessToken, @Nullable final Long expiry) {
+        this.usingToken = true;
+        setAccessToken(accessToken);
+        setExpiry(expiry);
+    }
+
+    public void destroy() {
+        setAccessToken(null);
+        setExpiry(null);
+    }
+
+    @Nullable public String getAccessToken() { return accessToken; }
+    public void setAccessToken(@Nullable final String accessToken) {
+        this.accessToken = accessToken;
+    }
+
+    @Nullable public Long getExpiry() { return expiry; }
+    public void setExpiry(@Nullable final Long tokenExpiry) { this.expiry = tokenExpiry; }
+
+    public boolean isValidToken() { return (hasToken() && !isExpired()); }
+
+    public boolean hasToken() { return accessToken != null; }
+
+    public boolean isExpired() {
+        if (expiry != null) {
+            Long currentTime = System.currentTimeMillis() / 1000;
+            return ((expiry / 1000) < currentTime);
+        } else {
+            return !this.usingToken;
+        }
+    }
+
+    @NotNull
+    public HashMap<String,String> credentialsMap() {
+        return new HashMap<>();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
new file mode 100644
index 0000000..961be70
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/auth/UsergridUserAuth.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.auth;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashMap;
+
+@SuppressWarnings("unused")
+public class UsergridUserAuth extends UsergridAuth {
+
+    @NotNull private String username;
+    @NotNull private String password;
+
+    @NotNull public String getUsername() { return username; }
+    public void setUsername(@NotNull final String username) { this.username = username; }
+
+    @NotNull private String getPassword() { return password; }
+    public void setPassword(@NotNull final String password) { this.password = password; }
+
+    @NotNull
+    @Override
+    public HashMap<String, String> credentialsMap() {
+        HashMap<String,String> credentials = super.credentialsMap();
+        credentials.put("grant_type", "password");
+        credentials.put("username", this.username);
+        credentials.put("password", this.password);
+        return credentials;
+    }
+
+    public UsergridUserAuth(@NotNull final String username, @NotNull final String password) {
+        super();
+        this.username = username;
+        this.password = password;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Activity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Activity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Activity.java
deleted file mode 100644
index faff3c3..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Activity.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.UUID;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
-
-/**
- * An entity type for representing activity stream actions. These are similar to
- * the more generic message entity type except provide the necessary properties
- * for supporting activity stream implementations.
- *
- * @see http://activitystrea.ms/specs/json/1.0/
- */
-public class Activity extends Entity {
-
-    public static final String ENTITY_TYPE = "activity";
-
-    public static final String PROP_ACTOR = "actor";
-
-    public static final String VERB_ADD = "add";
-    public static final String VERB_CANCEL = "cancel";
-    public static final String VERB_CHECKIN = "checkin";
-    public static final String VERB_DELETE = "delete";
-    public static final String VERB_FAVORITE = "favorite";
-    public static final String VERB_FOLLOW = "follow";
-    public static final String VERB_GIVE = "give";
-    public static final String VERB_IGNORE = "ignore";
-    public static final String VERB_INVITE = "invite";
-    public static final String VERB_JOIN = "join";
-    public static final String VERB_LEAVE = "leave";
-    public static final String VERB_LIKE = "like";
-    public static final String VERB_MAKE_FRIEND = "make-friend";
-    public static final String VERB_PLAY = "play";
-    public static final String VERB_POST = "post";
-    public static final String VERB_RECEIVE = "receive";
-    public static final String VERB_REMOVE = "remove";
-    public static final String VERB_REMOVE_FRIEND = "remove-friend";
-    public static final String VERB_REQUEST_FRIEND = "request-friend";
-    public static final String VERB_RSVP_MAYBE = "rsvp-maybe";
-    public static final String VERB_RSVP_NO = "rsvp-no";
-    public static final String VERB_RSVP_YES = "rsvp-yes";
-    public static final String VERB_SAVE = "save";
-    public static final String VERB_SHARE = "share";
-    public static final String VERB_STOP_FOLLOWING = "stop-following";
-    public static final String VERB_TAG = "tag";
-    public static final String VERB_UNFAVORITE = "unfavorite";
-    public static final String VERB_UNLIKE = "unlike";
-    public static final String VERB_UNSAVE = "unsave";
-    public static final String VERB_UPDATE = "update";
-
-    public static final String OBJECT_TYPE_ARTICLE = "article";
-    public static final String OBJECT_TYPE_AUDIO = "audio";
-    public static final String OBJECT_TYPE_BADGE = "badge";
-    public static final String OBJECT_TYPE_BOOKMARK = "bookmark";
-    public static final String OBJECT_TYPE_COLLECTION = "collection";
-    public static final String OBJECT_TYPE_COMMENT = "comment";
-    public static final String OBJECT_TYPE_EVENT = "event";
-    public static final String OBJECT_TYPE_FILE = "file";
-    public static final String OBJECT_TYPE_GROUP = "group";
-    public static final String OBJECT_TYPE_IMAGE = "image";
-    public static final String OBJECT_TYPE_NOTE = "note";
-    public static final String OBJECT_TYPE_PERSON = "person";
-    public static final String OBJECT_TYPE_PLACE = "place";
-    public static final String OBJECT_TYPE_PRODUCT = "product";
-    public static final String OBJECT_TYPE_QUESTION = "question";
-    public static final String OBJECT_TYPE_REVIEW = "review";
-    public static final String OBJECT_TYPE_SERVICE = "service";
-    public static final String OBJECT_TYPE_VIDEO = "video";
-
-    protected ActivityObject actor;
-
-    protected String content;
-
-    protected ActivityObject generator;
-
-    protected MediaLink icon;
-
-    protected String category;
-
-    protected String verb;
-
-    protected Long published;
-
-    protected ActivityObject object;
-
-    // protected
-    // String objectType;
-
-    // protected
-    // String objectEntityType;
-
-    // protected
-    // String objectName;
-
-    protected String title;
-
-    protected Set<String> connections;
-
-    public Activity() {
-        setType("activity");
-    }
-
-    public Activity(UUID id) {
-        this();
-        setUuid(id);
-    }
-
-    public static Activity newActivity(String verb, String title,
-            String content, String category, Entity user, Entity object,
-            String objectType, String objectName, String objectContent){
-
-        Activity activity = new Activity();
-        activity.setVerb(verb);
-        activity.setCategory(category);
-        activity.setContent(content);
-        activity.setTitle(title);
-
-        ActivityObject actor = new ActivityObject();
-        actor.setObjectType("person");
-
-        if (user != null) {
-            actor.setDisplayName(getStringProperty(user.properties, "name"));
-            actor.setEntityType(user.getType());
-            actor.setUuid(user.getUuid());
-        }
-
-        activity.setActor(actor);
-
-        ActivityObject obj = new ActivityObject();
-        obj.setDisplayName(objectName);
-        obj.setObjectType(objectType);
-        if (object != null) {
-            obj.setEntityType(object.getType());
-            obj.setUuid(object.getUuid());
-        }
-        if (objectContent != null) {
-            obj.setContent(objectContent);
-        } else {
-            obj.setContent(content);
-        }
-        activity.setObject(obj);
-
-        return activity;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public ActivityObject getActor() {
-        return actor;
-    }
-
-    public void setActor(ActivityObject actor) {
-        this.actor = actor;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public ActivityObject getGenerator() {
-        return generator;
-    }
-
-    public void setGenerator(ActivityObject generator) {
-        this.generator = generator;
-    }
-
-    /*
-     * @JsonSerialize(include = Inclusion.NON_NULL) public String getActorName()
-     * { return actorName; }
-     *
-     * public void setActorName(String actorName) { this.actorName = actorName;
-     * }
-     */
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public String getCategory() {
-        return category;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public String getVerb() {
-        return verb;
-    }
-
-    public void setVerb(String verb) {
-        this.verb = verb;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public Long getPublished() {
-        return published;
-    }
-
-    public void setPublished(Long published) {
-        this.published = published;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public ActivityObject getObject() {
-        return object;
-    }
-
-    public void setObject(ActivityObject object) {
-        this.object = object;
-    }
-
-    /*
-     * @JsonSerialize(include = Inclusion.NON_NULL) public String
-     * getObjectType() { return objectType; }
-     *
-     * public void setObjectType(String objectType) { this.objectType =
-     * objectType; }
-     *
-     * @JsonSerialize(include = Inclusion.NON_NULL) public String
-     * getObjectEntityType() { return objectEntityType; }
-     *
-     * public void setObjectEntityType(String objectEntityType) {
-     * this.objectEntityType = objectEntityType; }
-     *
-     * @JsonSerialize(include = Inclusion.NON_NULL) public String
-     * getObjectName() { return objectName; }
-     *
-     * public void setObjectName(String objectName) { this.objectName =
-     * objectName; }
-     */
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public MediaLink getIcon() {
-        return icon;
-    }
-
-    public void setIcon(MediaLink icon) {
-        this.icon = icon;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    @JsonSerialize(include = Inclusion.NON_NULL)
-    public Set<String> getConnections() {
-        return connections;
-    }
-
-    public void setConnections(Set<String> connections) {
-        this.connections = connections;
-    }
-
-    @XmlRootElement
-    static public class MediaLink {
-
-        int duration;
-
-        int height;
-
-        String url;
-
-        int width;
-
-        protected Map<String, Object> dynamic_properties = new TreeMap<String, Object>(
-                String.CASE_INSENSITIVE_ORDER);
-
-        public MediaLink() {
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public int getDuration() {
-            return duration;
-        }
-
-        public void setDuration(int duration) {
-            this.duration = duration;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public int getHeight() {
-            return height;
-        }
-
-        public void setHeight(int height) {
-            this.height = height;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getUrl() {
-            return url;
-        }
-
-        public void setUrl(String url) {
-            this.url = url;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public int getWidth() {
-            return width;
-        }
-
-        public void setWidth(int width) {
-            this.width = width;
-        }
-
-        @JsonAnySetter
-        public void setDynamicProperty(String key, Object value) {
-            dynamic_properties.put(key, value);
-        }
-
-        @JsonAnyGetter
-        public Map<String, Object> getDynamicProperties() {
-            return dynamic_properties;
-        }
-
-        @Override
-        public String toString() {
-            return "MediaLink [duration=" + duration + ", height=" + height
-                    + ", url=" + url + ", width=" + width
-                    + ", dynamic_properties=" + dynamic_properties + "]";
-        }
-
-    }
-
-    @XmlRootElement
-    static public class ActivityObject {
-
-        ActivityObject[] attachments;
-
-        ActivityObject author;
-
-        String content;
-
-        String displayName;
-
-        String[] downstreamDuplicates;
-
-        String id;
-
-        MediaLink image;
-
-        String objectType;
-
-        Date published;
-
-        String summary;
-
-        String updated;
-
-        String upstreamDuplicates;
-
-        String url;
-
-        UUID uuid;
-
-        String entityType;
-
-        protected Map<String, Object> dynamic_properties = new TreeMap<String, Object>(
-                String.CASE_INSENSITIVE_ORDER);
-
-        public ActivityObject() {
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public ActivityObject[] getAttachments() {
-            return attachments;
-        }
-
-        public void setAttachments(ActivityObject[] attachments) {
-            this.attachments = attachments;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public ActivityObject getAuthor() {
-            return author;
-        }
-
-        public void setAuthor(ActivityObject author) {
-            this.author = author;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getContent() {
-            return content;
-        }
-
-        public void setContent(String content) {
-            this.content = content;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getDisplayName() {
-            return displayName;
-        }
-
-        public void setDisplayName(String displayName) {
-            this.displayName = displayName;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String[] getDownstreamDuplicates() {
-            return downstreamDuplicates;
-        }
-
-        public void setDownstreamDuplicates(String[] downstreamDuplicates) {
-            this.downstreamDuplicates = downstreamDuplicates;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getId() {
-            return id;
-        }
-
-        public void setId(String id) {
-            this.id = id;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public MediaLink getImage() {
-            return image;
-        }
-
-        public void setImage(MediaLink image) {
-            this.image = image;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getObjectType() {
-            return objectType;
-        }
-
-        public void setObjectType(String objectType) {
-            this.objectType = objectType;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public Date getPublished() {
-            return published;
-        }
-
-        public void setPublished(Date published) {
-            this.published = published;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getSummary() {
-            return summary;
-        }
-
-        public void setSummary(String summary) {
-            this.summary = summary;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getUpdated() {
-            return updated;
-        }
-
-        public void setUpdated(String updated) {
-            this.updated = updated;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getUpstreamDuplicates() {
-            return upstreamDuplicates;
-        }
-
-        public void setUpstreamDuplicates(String upstreamDuplicates) {
-            this.upstreamDuplicates = upstreamDuplicates;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getUrl() {
-            return url;
-        }
-
-        public void setUrl(String url) {
-            this.url = url;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public UUID getUuid() {
-            return uuid;
-        }
-
-        public void setUuid(UUID uuid) {
-            this.uuid = uuid;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getEntityType() {
-            return entityType;
-        }
-
-        public void setEntityType(String entityType) {
-            this.entityType = entityType;
-        }
-
-        @JsonAnySetter
-        public void setDynamicProperty(String key, Object value) {
-            dynamic_properties.put(key, value);
-        }
-
-        @JsonAnyGetter
-        public Map<String, Object> getDynamicProperties() {
-            return dynamic_properties;
-        }
-
-        @Override
-        public String toString() {
-            return "ActivityObject [attachments="
-                    + Arrays.toString(attachments) + ", author=" + author
-                    + ", content=" + content + ", displayName=" + displayName
-                    + ", downstreamDuplicates="
-                    + Arrays.toString(downstreamDuplicates) + ", id=" + id
-                    + ", image=" + image + ", objectType=" + objectType
-                    + ", published=" + published + ", summary=" + summary
-                    + ", updated=" + updated + ", upstreamDuplicates="
-                    + upstreamDuplicates + ", url=" + url + ", uuid=" + uuid
-                    + ", entityType=" + entityType + ", dynamic_properties="
-                    + dynamic_properties + "]";
-        }
-
-    }
-
-    @XmlRootElement
-    static public class ActivityCollection {
-
-        int totalItems;
-
-        ActivityObject[] items;
-
-        String url;
-
-        protected Map<String, Object> dynamic_properties = new TreeMap<String, Object>(
-                String.CASE_INSENSITIVE_ORDER);
-
-        public ActivityCollection() {
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public int getTotalItems() {
-            return totalItems;
-        }
-
-        public void setTotalItems(int totalItems) {
-            this.totalItems = totalItems;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public ActivityObject[] getItems() {
-            return items;
-        }
-
-        public void setItems(ActivityObject[] items) {
-            this.items = items;
-        }
-
-        @JsonSerialize(include = Inclusion.NON_NULL)
-        public String getUrl() {
-            return url;
-        }
-
-        public void setUrl(String url) {
-            this.url = url;
-        }
-
-        @JsonAnySetter
-        public void setDynamicProperty(String key, Object value) {
-            dynamic_properties.put(key, value);
-        }
-
-        @JsonAnyGetter
-        public Map<String, Object> getDynamicProperties() {
-            return dynamic_properties;
-        }
-
-        @Override
-        public String toString() {
-            return "ActivityCollection [totalItems=" + totalItems + ", items="
-                    + Arrays.toString(items) + ", url=" + url
-                    + ", dynamic_properties=" + dynamic_properties + "]";
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Device.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Device.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Device.java
deleted file mode 100644
index 8db415c..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Device.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-import static com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion.NON_NULL;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setStringProperty;
-
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-public class Device extends Entity {
-
-	public final static String ENTITY_TYPE = "device";
-
-	public final static String PROPERTY_NAME = "name";
-
-	public Device() {
-		super();
-		setType(ENTITY_TYPE);
-	}
-
-	public Device(Entity entity) {
-		super();
-		properties = entity.properties;
-		setType(ENTITY_TYPE);
-	}
-
-	@Override
-	@JsonIgnore
-	public String getNativeType() {
-		return ENTITY_TYPE;
-	}
-
-	@Override
-	@JsonIgnore
-	public List<String> getPropertyNames() {
-		List<String> properties = super.getPropertyNames();
-		properties.add(PROPERTY_NAME);
-		return properties;
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getName() {
-		return getStringProperty(properties, PROPERTY_NAME);
-	}
-
-	public void setName(String name) {
-		setStringProperty(properties, PROPERTY_NAME, name);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Entity.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Entity.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Entity.java
deleted file mode 100644
index 2a8c544..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Entity.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getUUIDProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.*;
-import static org.apache.usergrid.java.client.utils.MapUtils.newMapWithoutKeys;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-public class Entity {
-
-    public final static String PROPERTY_UUID = "uuid";
-    public final static String PROPERTY_TYPE = "type";
-
-    protected Map<String, JsonNode> properties = new HashMap<String, JsonNode>();
-
-    public static Map<String, Class<? extends Entity>> CLASS_FOR_ENTITY_TYPE = new HashMap<String, Class<? extends Entity>>();
-    static {
-        CLASS_FOR_ENTITY_TYPE.put(User.ENTITY_TYPE, User.class);
-    }
-
-    public Entity() {
-    }
-
-    public Entity(String type) {
-        setType(type);
-    }
-
-    @JsonIgnore
-    public String getNativeType() {
-        return getType();
-    }
-
-    @JsonIgnore
-    public List<String> getPropertyNames() {
-        List<String> properties = new ArrayList<String>();
-        properties.add(PROPERTY_TYPE);
-        properties.add(PROPERTY_UUID);
-        return properties;
-    }
-
-    public String getType() {
-        return getStringProperty(properties, PROPERTY_TYPE);
-    }
-
-    public void setType(String type) {
-        setStringProperty(properties, PROPERTY_TYPE, type);
-    }
-
-    public UUID getUuid() {
-        return getUUIDProperty(properties, PROPERTY_UUID);
-    }
-
-    public void setUuid(UUID uuid) {
-        setUUIDProperty(properties, PROPERTY_UUID, uuid);
-    }
-
-    @JsonAnyGetter
-    public Map<String, JsonNode> getProperties() {
-        return newMapWithoutKeys(properties, getPropertyNames());
-    }
-
-    @JsonAnySetter
-    public void setProperty(String name, JsonNode value) {
-        if (value == null) {
-            properties.remove(name);
-        } else {
-            properties.put(name, value);
-        }
-    }
-
-
-    /**
-     * Set the property
-     *
-     * @param name
-     * @param value
-     */
-    public void setProperty(String name, String value) {
-        setStringProperty(properties, name, value);
-    }
-
-    /**
-     * Set the property
-     *
-     * @param name
-     * @param value
-     */
-    public void setProperty(String name, boolean value) {
-        setBooleanProperty(properties, name, value);
-    }
-
-    /**
-     * Set the property
-     *
-     * @param name
-     * @param value
-     */
-    public void setProperty(String name, long value) {
-        setLongProperty(properties, name, value);
-    }
-
-    /**
-     * Set the property
-     *
-     * @param name
-     * @param value
-     */
-    public void setProperty(String name, int value) {
-        setProperty(name, (long) value);
-    }
-
-    /**
-     * Set the property
-     *
-     * @param name
-     * @param value
-     */
-    public void setProperty(String name, float value) {
-        setFloatProperty(properties, name, value);
-    }
-
-    @Override
-    public String toString() {
-        return toJsonString(this);
-    }
-
-    public <T extends Entity> T toType(Class<T> t) {
-        return toType(this, t);
-    }
-
-    public static <T extends Entity> T toType(Entity entity, Class<T> t) {
-        if (entity == null) {
-            return null;
-        }
-        T newEntity = null;
-        if (entity.getClass().isAssignableFrom(t)) {
-            try {
-                newEntity = (t.newInstance());
-                if ((newEntity.getNativeType() != null)
-                        && newEntity.getNativeType().equals(entity.getType())) {
-                    newEntity.properties = entity.properties;
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        return newEntity;
-    }
-
-    public static <T extends Entity> List<T> toType(List<Entity> entities,
-            Class<T> t) {
-        List<T> l = new ArrayList<T>(entities != null ? entities.size() : 0);
-        if (entities != null) {
-            for (Entity entity : entities) {
-                T newEntity = entity.toType(t);
-                if (newEntity != null) {
-                    l.add(newEntity);
-                }
-            }
-        }
-        return l;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Group.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Group.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Group.java
deleted file mode 100644
index 0e80532..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Group.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-import static com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion.NON_NULL;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setStringProperty;
-
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-public class Group extends Entity {
-
-	public final static String ENTITY_TYPE = "group";
-
-	public final static String PROPERTY_PATH = "path";
-	public final static String PROPERTY_TITLE = "title";
-
-	public Group() {
-		super();
-		setType(ENTITY_TYPE);
-	}
-
-	public Group(Entity entity) {
-		super();
-		properties = entity.properties;
-		setType(ENTITY_TYPE);
-	}
-
-	@Override
-	@JsonIgnore
-	public String getNativeType() {
-		return ENTITY_TYPE;
-	}
-
-	@Override
-	@JsonIgnore
-	public List<String> getPropertyNames() {
-		List<String> properties = super.getPropertyNames();
-		properties.add(PROPERTY_PATH);
-		properties.add(PROPERTY_TITLE);
-		return properties;
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getPath() {
-		return getStringProperty(properties, PROPERTY_PATH);
-	}
-
-	public void setPath(String path) {
-		setStringProperty(properties, PROPERTY_PATH, path);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getTitle() {
-		return getStringProperty(properties, PROPERTY_TITLE);
-	}
-
-	public void setTitle(String title) {
-		setStringProperty(properties, PROPERTY_TITLE, title);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Message.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Message.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Message.java
deleted file mode 100644
index 8af64f9..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/entities/Message.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.entities;
-
-import static com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion.NON_NULL;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getBooleanProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getLongProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.getUUIDProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setBooleanProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setLongProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setStringProperty;
-import static org.apache.usergrid.java.client.utils.JsonUtils.setUUIDProperty;
-
-import java.util.List;
-import java.util.UUID;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
-
-public class Message extends Entity {
-
-	public static final String ENTITY_TYPE = "message";
-
-	public static final String PROPERTY_CORRELATION_ID = "correlation_id";
-	public static final String PROPERTY_DESTINATION = "destination";
-	public static final String PROPERTY_REPLY_TO = "reply_to";
-	public static final String PROPERTY_TIMESTAMP = "timestamp";
-	public static final String PROPERTY_TYPE = "type";
-	public static final String PROPERTY_CATEGORY = "category";
-	public static final String PROPERTY_INDEXED = "indexed";
-	public static final String PROPERTY_PERSISTENT = "persistent";
-
-	public Message() {
-		super();
-		setType(ENTITY_TYPE);
-	}
-
-	public Message(Entity entity) {
-		super();
-		properties = entity.properties;
-		setType(ENTITY_TYPE);
-	}
-
-	@Override
-	@JsonIgnore
-	public String getNativeType() {
-		return ENTITY_TYPE;
-	}
-
-	@Override
-	@JsonIgnore
-	public List<String> getPropertyNames() {
-		List<String> properties = super.getPropertyNames();
-		properties.add(PROPERTY_CORRELATION_ID);
-		properties.add(PROPERTY_DESTINATION);
-		properties.add(PROPERTY_REPLY_TO);
-		properties.add(PROPERTY_TIMESTAMP);
-		properties.add(PROPERTY_CATEGORY);
-		properties.add(PROPERTY_INDEXED);
-		properties.add(PROPERTY_PERSISTENT);
-		return properties;
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	@JsonProperty(PROPERTY_CORRELATION_ID)
-	public UUID getCorrelationId() {
-		return getUUIDProperty(properties, PROPERTY_CORRELATION_ID);
-	}
-
-	@JsonProperty(PROPERTY_CORRELATION_ID)
-	public void setCorrelationId(UUID uuid) {
-		setUUIDProperty(properties, PROPERTY_CORRELATION_ID, uuid);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getDestination() {
-		return getStringProperty(properties, PROPERTY_DESTINATION);
-	}
-
-	public void setDestination(String destination) {
-		setStringProperty(properties, PROPERTY_DESTINATION, destination);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	@JsonProperty(PROPERTY_REPLY_TO)
-	public String getReplyTo() {
-		return getStringProperty(properties, PROPERTY_DESTINATION);
-	}
-
-	@JsonProperty(PROPERTY_REPLY_TO)
-	public void setReplyTo(String replyTo) {
-		setStringProperty(properties, PROPERTY_DESTINATION, replyTo);
-	}
-
-	@JsonSerialize(include = Inclusion.NON_NULL)
-	public Long getTimestamp() {
-		return getLongProperty(properties, PROPERTY_TIMESTAMP);
-	}
-
-	public void setTimestamp(Long timestamp) {
-		setLongProperty(properties, PROPERTY_TIMESTAMP, timestamp);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public String getCategory() {
-		return getStringProperty(properties, PROPERTY_CATEGORY);
-	}
-
-	public void setCategory(String category) {
-		setStringProperty(properties, PROPERTY_CATEGORY, category);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public Boolean isIndexed() {
-		return getBooleanProperty(properties, PROPERTY_INDEXED);
-	}
-
-	public void setIndexed(Boolean indexed) {
-		setBooleanProperty(properties, PROPERTY_INDEXED, indexed);
-	}
-
-	@JsonSerialize(include = NON_NULL)
-	public Boolean isPersistent() {
-		return getBooleanProperty(properties, PROPERTY_INDEXED);
-	}
-
-	public void setPersistent(Boolean persistent) {
-		setBooleanProperty(properties, PROPERTY_INDEXED, persistent);
-	}
-
-}


[05/54] [abbrv] usergrid git commit: Initial commit for new JavaSDK.

Posted by mr...@apache.org.
Initial commit for new JavaSDK.


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

Branch: refs/heads/apm
Commit: 2e127e627bf170e7ea0a7cb1be5bffb69a9b0cb8
Parents: e0931be
Author: Robert Walsh <rj...@gmail.com>
Authored: Thu Apr 14 12:47:02 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Thu Apr 14 12:47:02 2016 -0500

----------------------------------------------------------------------
 sdks/java/.bash_profile                         |    1 +
 sdks/java/pom.xml                               |   71 +-
 .../org/apache/usergrid/java/client/Client.java | 1292 ------------------
 .../apache/usergrid/java/client/Usergrid.java   |  285 ++++
 .../usergrid/java/client/UsergridClient.java    |  420 ++++++
 .../java/client/UsergridClientConfig.java       |   57 +
 .../usergrid/java/client/UsergridEnums.java     |  170 +++
 .../usergrid/java/client/UsergridRequest.java   |  202 +++
 .../java/client/UsergridRequestManager.java     |   86 ++
 .../java/client/auth/UsergridAppAuth.java       |   50 +
 .../usergrid/java/client/auth/UsergridAuth.java |   74 +
 .../java/client/auth/UsergridUserAuth.java      |   50 +
 .../usergrid/java/client/entities/Activity.java |  625 ---------
 .../usergrid/java/client/entities/Device.java   |   68 -
 .../usergrid/java/client/entities/Entity.java   |  191 ---
 .../usergrid/java/client/entities/Group.java    |   79 --
 .../usergrid/java/client/entities/Message.java  |  148 --
 .../usergrid/java/client/entities/User.java     |  158 ---
 .../java/client/exception/ClientException.java  |   41 -
 .../client/exception/UsergridException.java     |   48 +
 .../java/client/model/UsergridDevice.java       |   60 +
 .../java/client/model/UsergridEntity.java       |  484 +++++++
 .../java/client/model/UsergridUser.java         |  197 +++
 .../java/client/query/UsergridQuery.java        |  434 ++++++
 .../java/client/response/AggregateCounter.java  |   52 -
 .../client/response/AggregateCounterSet.java    |  111 --
 .../java/client/response/ApiResponse.java       |  421 ------
 .../client/response/ClientCredentialsInfo.java  |   58 -
 .../java/client/response/QueueInfo.java         |   44 -
 .../java/client/response/UsergridResponse.java  |  222 +++
 .../client/response/UsergridResponseError.java  |   98 ++
 .../usergrid/java/client/utils/JsonUtils.java   |  244 ++--
 .../usergrid/java/client/utils/MapUtils.java    |   27 +-
 .../usergrid/java/client/utils/ObjectUtils.java |   28 +-
 .../usergrid/java/client/utils/UrlUtils.java    |  124 --
 .../utils/UsergridEntityDeserializer.java       |   41 +
 .../client/ClientAuthFallBackTestCase.java      |   72 +
 .../usergrid/client/ClientAuthTestCase.java     |   85 ++
 .../client/ClientConnectionsTestCase.java       |  171 +++
 .../usergrid/client/ClientRestTestCase.java     |   90 ++
 .../apache/usergrid/client/EntityTestCase.java  |  676 +++++++++
 .../apache/usergrid/client/QueryTestCase.java   |  194 +++
 .../usergrid/client/SDKTestConfiguration.java   |   38 +
 .../apache/usergrid/client/SDKTestUtils.java    |  108 ++
 .../client/UsergridClientAuthTestCase.java      |   73 +
 .../usergrid/client/UsergridInitTestCase.java   |   48 +
 .../client/UsergridResponseErrorTestCase.java   |   62 +
 .../client/UsergridResponseTestCase.java        |   85 ++
 .../usergrid/client/UsergridTestCase.java       |   30 +
 49 files changed, 4874 insertions(+), 3619 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/.bash_profile
----------------------------------------------------------------------
diff --git a/sdks/java/.bash_profile b/sdks/java/.bash_profile
new file mode 100644
index 0000000..7a3d262
--- /dev/null
+++ b/sdks/java/.bash_profile
@@ -0,0 +1 @@
+export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/pom.xml
----------------------------------------------------------------------
diff --git a/sdks/java/pom.xml b/sdks/java/pom.xml
index 34eda24..31bb429 100644
--- a/sdks/java/pom.xml
+++ b/sdks/java/pom.xml
@@ -1,21 +1,21 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <bundle.symbolicName>org.apache.usergrid</bundle.symbolicName>
         <bundle.namespace>org.apache.usergrid</bundle.namespace>
-        <org.springframework.version>3.1.2.RELEASE</org.springframework.version>
-        <jackson-version>2.3.1</jackson-version>
+        <jackson-version>2.7.3</jackson-version>
+        <junit.version>4.11</junit.version>
     </properties>
 
     <modelVersion>4.0.0</modelVersion>
-
     <groupId>org.apache.usergrid</groupId>
     <artifactId>usergrid-java-client</artifactId>
-    <version>0.0.10-SNAPSHOT</version>
+    <version>2.1.0-SNAPSHOT</version>
     <packaging>jar</packaging>
-    <description>A Java client for usergrid</description>
+    <description>A Java client for Usergrid</description>
     <url>http://usergrid.apache.org</url>
+
     <licenses>
         <license>
             <name>The Apache Software License, Version 2.0</name>
@@ -37,6 +37,18 @@
             <id>sganyo</id>
             <name>Scott Ganyo</name>
         </developer>
+        <developer>
+            <id>jwest</id>
+            <name>Jeffrey West</name>
+        </developer>
+        <developer>
+            <id>adastagiri</id>
+            <name>Ayesha Dastagiri</name>
+        </developer>
+        <developer>
+            <id>rwalsh</id>
+            <name>Robert Walsh</name>
+        </developer>
     </developers>
 
     <build>
@@ -54,60 +66,53 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.3</version>
                 <configuration>
                     <source>1.7</source>
                     <target>1.7</target>
-                    <optimize>true</optimize>
-                    <showDeprecation>true</showDeprecation>
-                    <debug>true</debug>
-                    <encoding>UTF-8</encoding>
-                    <showWarnings>true</showWarnings>
                 </configuration>
             </plugin>
-
         </plugins>
     </build>
 
     <dependencies>
-        <!-- <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> 
-        <version>2.2.1</version> <scope>provided</scope> </dependency> -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-core</artifactId>
             <version>${jackson-version}</version>
         </dependency>
+
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
             <version>${jackson-version}</version>
         </dependency>
+
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
             <version>${jackson-version}</version>
         </dependency>
+
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-web</artifactId>
-            <version>${org.springframework.version}</version>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.2.0</version>
         </dependency>
+
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <version>1.6.4</version>
+            <groupId>com.intellij</groupId>
+            <artifactId>annotations</artifactId>
+            <version>9.0.4</version>
         </dependency>
     </dependencies>
-    <repositories>
-        <repository>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-            <id>springsource-milestone</id>
-            <name>Spring Framework Milestone Repository</name>
-            <url>http://maven.springframework.org/milestone</url>
-        </repository>
-    </repositories>
     <name>Apache Usergrid Java SDK</name>
     <organization>
         <name>The Apache Software Foundation</name>
@@ -117,4 +122,4 @@
         <system>JIRA</system>
         <url>https://issues.apache.org/jira/browse/USERGRID</url>
     </issueManagement>
-</project>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/Client.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/Client.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/Client.java
deleted file mode 100644
index f72bb94..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/Client.java
+++ /dev/null
@@ -1,1292 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client;
-
-import static org.springframework.util.StringUtils.arrayToDelimitedString;
-import static org.springframework.util.StringUtils.tokenizeToStringArray;
-import static org.apache.usergrid.java.client.utils.JsonUtils.parse;
-import static org.apache.usergrid.java.client.utils.ObjectUtils.isEmpty;
-import static org.apache.usergrid.java.client.utils.UrlUtils.addQueryParams;
-import static org.apache.usergrid.java.client.utils.UrlUtils.encodeParams;
-import static org.apache.usergrid.java.client.utils.UrlUtils.path;
-
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-import org.apache.usergrid.java.client.entities.Activity;
-import org.apache.usergrid.java.client.entities.Device;
-import org.apache.usergrid.java.client.entities.Entity;
-import org.apache.usergrid.java.client.entities.Group;
-import org.apache.usergrid.java.client.entities.User;
-import org.apache.usergrid.java.client.response.ApiResponse;
-
-/**
- * The Client class for accessing the Usergrid API. Start by instantiating this
- * class though the appropriate constructor.
- *
- */
-public class Client {
-
-    private static final Logger log = LoggerFactory.getLogger(Client.class);
-
-    public static boolean FORCE_PUBLIC_API = false;
-
-    // Public API
-    public static String PUBLIC_API_URL = "http://api.usergrid.com";
-
-    // Local API of standalone server
-    public static String LOCAL_STANDALONE_API_URL = "http://localhost:8080";
-
-    // Local API of Tomcat server in Eclipse
-    public static String LOCAL_TOMCAT_API_URL = "http://localhost:8080/ROOT";
-
-    // Local API
-    public static String LOCAL_API_URL = LOCAL_STANDALONE_API_URL;
-
-    private String apiUrl = PUBLIC_API_URL;
-
-    private String organizationId;
-    private String applicationId;
-    private String clientId;
-    private String clientSecret;
-
-    private User loggedInUser = null;
-
-    private String accessToken = null;
-
-    private String currentOrganization = null;
-
-    static RestTemplate restTemplate = new RestTemplate();
-
-    /**
-     * Default constructor for instantiating a client.
-     */
-    public Client() {
-        init();
-    }
-
-    /**
-     * Instantiate client for a specific app
-     *
-     * @param applicationId
-     *            the application id or name
-     */
-    public Client(String organizationId, String applicationId) {
-        init();
-        this.organizationId = organizationId;
-        this.applicationId = applicationId;
-    }
-
-    public void init() {
-
-    }
-
-    /**
-     * @return the Usergrid API url (default: http://api.usergrid.com)
-     */
-    public String getApiUrl() {
-        return apiUrl;
-    }
-
-    /**
-     * @param apiUrl
-     *            the Usergrid API url (default: http://api.usergrid.com)
-     */
-    public void setApiUrl(String apiUrl) {
-        this.apiUrl = apiUrl;
-    }
-
-    /**
-     * @param apiUrl
-     *            the Usergrid API url (default: http://api.usergrid.com)
-     * @return Client object for method call chaining
-     */
-    public Client withApiUrl(String apiUrl) {
-        this.apiUrl = apiUrl;
-        return this;
-    }
-
-
-    /**
-     * the organizationId to set
-     * @param organizationId
-     * @return
-     */
-    public Client withOrganizationId(String organizationId){
-        this.organizationId = organizationId;
-        return this;
-    }
-
-
-
-    /**
-     * @return the organizationId
-     */
-    public String getOrganizationId() {
-        return organizationId;
-    }
-
-    /**
-     * @param organizationId the organizationId to set
-     */
-    public void setOrganizationId(String organizationId) {
-        this.organizationId = organizationId;
-    }
-
-    /**
-     * @return the application id or name
-     */
-    public String getApplicationId() {
-        return applicationId;
-    }
-
-    /**
-     * @param applicationId
-     *            the application id or name
-     */
-    public void setApplicationId(String applicationId) {
-        this.applicationId = applicationId;
-    }
-
-
-    /**
-     * @param applicationId
-     *            the application id or name
-     * @return Client object for method call chaining
-     */
-    public Client withApplicationId(String applicationId) {
-        this.applicationId = applicationId;
-        return this;
-    }
-
-    /**
-     * @return the client key id for making calls as the application-owner. Not
-     *         safe for most mobile use.
-     */
-    public String getClientId() {
-        return clientId;
-    }
-
-    /**
-     * @param clientId
-     *            the client key id for making calls as the application-owner.
-     *            Not safe for most mobile use.
-     */
-    public void setClientId(String clientId) {
-        this.clientId = clientId;
-    }
-
-    /**
-     * @param clientId
-     *            the client key id for making calls as the application-owner.
-     *            Not safe for most mobile use.
-     * @return Client object for method call chaining
-     */
-    public Client withClientId(String clientId) {
-        this.clientId = clientId;
-        return this;
-    }
-
-    /**
-     * @return the client key id for making calls as the application-owner. Not
-     *         safe for most mobile use.
-     */
-    public String getClientSecret() {
-        return clientSecret;
-    }
-
-    /**
-     * @param clientSecret
-     *            the client key id for making calls as the application-owner.
-     *            Not safe for most mobile use.
-     */
-    public void setClientSecret(String clientSecret) {
-        this.clientSecret = clientSecret;
-    }
-
-    /**
-     * @param clientSecret
-     *            the client key id for making calls as the application-owner.
-     *            Not safe for most mobile use.
-     * @return Client object for method call chaining
-     */
-    public Client withClientSecret(String clientSecret) {
-        this.clientSecret = clientSecret;
-        return this;
-    }
-
-    /**
-     * @return the logged-in user after a successful authorizeAppUser request
-     */
-    public User getLoggedInUser() {
-        return loggedInUser;
-    }
-
-    /**
-     * @param loggedInUser
-     *            the logged-in user, usually not set by host application
-     */
-    public void setLoggedInUser(User loggedInUser) {
-        this.loggedInUser = loggedInUser;
-    }
-
-    /**
-     * @return the OAuth2 access token after a successful authorize request
-     */
-    public String getAccessToken() {
-        return accessToken;
-    }
-
-    /**
-     * @param accessToken
-     *            an OAuth2 access token. Usually not set by host application
-     */
-    public void setAccessToken(String accessToken) {
-        this.accessToken = accessToken;
-    }
-
-    /**
-     * @return the currentOrganization
-     */
-    public String getCurrentOrganization() {
-        return currentOrganization;
-    }
-
-    /**
-     * @param currentOrganization
-     */
-    public void setCurrentOrganization(String currentOrganization) {
-        this.currentOrganization = currentOrganization;
-    }
-
-    /**
-     * Low-level HTTP request method. Synchronous, blocks till response or
-     * timeout.
-     *
-     * @param method
-     *            HttpMethod method
-     * @param cls
-     *            class for the return type
-     * @param params
-     *            parameters to encode as querystring or body parameters
-     * @param data
-     *            JSON data to put in body
-     * @param segments
-     *            REST url path segments (i.e. /segment1/segment2/segment3)
-     * @return results marshalled into class specified in cls parameter
-     */
-    public <T> T httpRequest(HttpMethod method, Class<T> cls,
-            Map<String, Object> params, Object data, String... segments) {
-        HttpHeaders requestHeaders = new HttpHeaders();
-        requestHeaders.setAccept(Collections
-                .singletonList(MediaType.APPLICATION_JSON));
-        if (accessToken != null) {
-            String auth = "Bearer " + accessToken;
-            requestHeaders.set("Authorization", auth);
-            log.info("Authorization: " + auth);
-        }
-        String url = path(apiUrl, segments);
-
-        MediaType contentType = MediaType.APPLICATION_JSON;
-        if (method.equals(HttpMethod.POST) && isEmpty(data) && !isEmpty(params)) {
-            data = encodeParams(params);
-            contentType = MediaType.APPLICATION_FORM_URLENCODED;
-        } else {
-            url = addQueryParams(url, params);
-        }
-        requestHeaders.setContentType(contentType);
-        HttpEntity<?> requestEntity = null;
-
-        if (method.equals(HttpMethod.POST) || method.equals(HttpMethod.PUT)) {
-            if (isEmpty(data)) {
-                data = JsonNodeFactory.instance.objectNode();
-            }
-            requestEntity = new HttpEntity<Object>(data, requestHeaders);
-        } else {
-            requestEntity = new HttpEntity<Object>(requestHeaders);
-        }
-        log.info("Client.httpRequest(): url: " + url);
-        ResponseEntity<T> responseEntity = restTemplate.exchange(url, method,
-                requestEntity, cls);
-        log.info("Client.httpRequest(): reponse body: "
-                + responseEntity.getBody().toString());
-        return responseEntity.getBody();
-    }
-
-    /**
-     * High-level Usergrid API request.
-     *
-     * @param method
-     * @param params
-     * @param data
-     * @param segments
-     * @return
-     */
-    public ApiResponse apiRequest(HttpMethod method,
-            Map<String, Object> params, Object data, String... segments) {
-        ApiResponse response = null;
-        try {
-            response = httpRequest(method, ApiResponse.class, params, data,
-                    segments);
-            log.info("Client.apiRequest(): Response: " + response);
-        } catch (HttpClientErrorException e) {
-            log.error("Client.apiRequest(): HTTP error: "
-                    + e.getLocalizedMessage());
-            response = parse(e.getResponseBodyAsString(), ApiResponse.class);
-            if ((response != null) && !isEmpty(response.getError())) {
-                log.error("Client.apiRequest(): Response error: "
-                        + response.getError());
-                if (!isEmpty(response.getException())) {
-                    log.error("Client.apiRequest(): Response exception: "
-                            + response.getException());
-                }
-            }
-        }
-        return response;
-    }
-
-    protected void assertValidApplicationId() {
-        if (isEmpty(applicationId)) {
-            throw new IllegalArgumentException("No application id specified");
-        }
-    }
-
-    /**
-     * Log the user in and get a valid access token.
-     *
-     * @param email
-     * @param password
-     * @return non-null ApiResponse if request succeeds, check getError() for
-     *         "invalid_grant" to see if access is denied.
-     */
-    public ApiResponse authorizeAppUser(String email, String password) {
-        validateNonEmptyParam(email, "email");
-        validateNonEmptyParam(password,"password");
-        assertValidApplicationId();
-        loggedInUser = null;
-        accessToken = null;
-        currentOrganization = null;
-        Map<String, Object> formData = new HashMap<String, Object>();
-        formData.put("grant_type", "password");
-        formData.put("username", email);
-        formData.put("password", password);
-        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
-                organizationId, applicationId, "token");
-        if (response == null) {
-            return response;
-        }
-        if (!isEmpty(response.getAccessToken()) && (response.getUser() != null)) {
-            loggedInUser = response.getUser();
-            accessToken = response.getAccessToken();
-            currentOrganization = null;
-            log.info("Client.authorizeAppUser(): Access token: " + accessToken);
-        } else {
-            log.info("Client.authorizeAppUser(): Response: " + response);
-        }
-        return response;
-    }
-
-    /**
-     * Change the password for the currently logged in user. You must supply the
-     * old password and the new password.
-     *
-     * @param username
-     * @param oldPassword
-     * @param newPassword
-     * @return
-     */
-    public ApiResponse changePassword(String username, String oldPassword,
-            String newPassword) {
-
-        Map<String, Object> data = new HashMap<String, Object>();
-        data.put("newpassword", newPassword);
-        data.put("oldpassword", oldPassword);
-
-        return apiRequest(HttpMethod.POST, null, data, organizationId,  applicationId, "users",
-                username, "password");
-
-    }
-
-    /**
-     * Log the user in with their numeric pin-code and get a valid access token.
-     *
-     * @param email
-     * @param pin
-     * @return non-null ApiResponse if request succeeds, check getError() for
-     *         "invalid_grant" to see if access is denied.
-     */
-    public ApiResponse authorizeAppUserViaPin(String email, String pin) {
-        validateNonEmptyParam(email, "email");
-        validateNonEmptyParam(pin, "pin");
-        assertValidApplicationId();
-        loggedInUser = null;
-        accessToken = null;
-        currentOrganization = null;
-        Map<String, Object> formData = new HashMap<String, Object>();
-        formData.put("grant_type", "pin");
-        formData.put("username", email);
-        formData.put("pin", pin);
-        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
-                organizationId,  applicationId, "token");
-        if (response == null) {
-            return response;
-        }
-        if (!isEmpty(response.getAccessToken()) && (response.getUser() != null)) {
-            loggedInUser = response.getUser();
-            accessToken = response.getAccessToken();
-            currentOrganization = null;
-            log.info("Client.authorizeAppUser(): Access token: " + accessToken);
-        } else {
-            log.info("Client.authorizeAppUser(): Response: " + response);
-        }
-        return response;
-    }
-
-    /**
-     * Log the user in with their Facebook access token retrived via Facebook
-     * OAuth.
-     *
-     * @param email
-     * @param pin
-     * @return non-null ApiResponse if request succeeds, check getError() for
-     *         "invalid_grant" to see if access is denied.
-     */
-    public ApiResponse authorizeAppUserViaFacebook(String fb_access_token) {
-        validateNonEmptyParam(fb_access_token, "Facebook token");
-        assertValidApplicationId();
-        loggedInUser = null;
-        accessToken = null;
-        currentOrganization = null;
-        Map<String, Object> formData = new HashMap<String, Object>();
-        formData.put("fb_access_token", fb_access_token);
-        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
-                organizationId,  applicationId, "auth", "facebook");
-        if (response == null) {
-            return response;
-        }
-        if (!isEmpty(response.getAccessToken()) && (response.getUser() != null)) {
-            loggedInUser = response.getUser();
-            accessToken = response.getAccessToken();
-            currentOrganization = null;
-            log.info("Client.authorizeAppUserViaFacebook(): Access token: "
-                    + accessToken);
-        } else {
-            log.info("Client.authorizeAppUserViaFacebook(): Response: "
-                    + response);
-        }
-        return response;
-    }
-
-    /**
-     * Log the app in with it's client id and client secret key. Not recommended
-     * for production apps.
-     *
-     * @param email
-     * @param pin
-     * @return non-null ApiResponse if request succeeds, check getError() for
-     *         "invalid_grant" to see if access is denied.
-     */
-    public ApiResponse authorizeAppClient(String clientId, String clientSecret) {
-        validateNonEmptyParam(clientId, "client identifier");
-        validateNonEmptyParam(clientSecret, "client secret");
-        assertValidApplicationId();
-        loggedInUser = null;
-        accessToken = null;
-        currentOrganization = null;
-        Map<String, Object> formData = new HashMap<String, Object>();
-        formData.put("grant_type", "client_credentials");
-        formData.put("client_id", clientId);
-        formData.put("client_secret", clientSecret);
-        ApiResponse response = apiRequest(HttpMethod.POST, formData, null,
-                organizationId, applicationId, "token");
-        if (response == null) {
-            return response;
-        }
-        if (!isEmpty(response.getAccessToken())) {
-            loggedInUser = null;
-            accessToken = response.getAccessToken();
-            currentOrganization = null;
-            log.info("Client.authorizeAppClient(): Access token: "
-                    + accessToken);
-        } else {
-            log.info("Client.authorizeAppClient(): Response: " + response);
-        }
-        return response;
-    }
-
-    private void validateNonEmptyParam(Object param, String paramName) {
-        if ( isEmpty(param) ) {
-            throw new IllegalArgumentException(paramName + " cannot be null or empty");
-        }
-    }
-
-    /**
-     * Registers a device using the device's unique device ID.
-     *
-     * @param context
-     * @param properties
-     * @return a Device object if success
-     */
-    public Device registerDevice(UUID deviceId, Map<String, Object> properties) {
-        assertValidApplicationId();
-        if (properties == null) {
-            properties = new HashMap<String, Object>();
-        }
-        properties.put("refreshed", System.currentTimeMillis());
-        ApiResponse response = apiRequest(HttpMethod.PUT, null, properties,
-                organizationId, applicationId, "devices", deviceId.toString());
-        return response.getFirstEntity(Device.class);
-    }
-
-    /**
-     * Registers a device using the device's unique device ID.
-     *
-     * @param context
-     * @param properties
-     * @return a Device object if success
-     */
-    public Device registerDeviceForPush(UUID deviceId,
-                                        String notifier,
-                                        String token,
-                                        Map<String, Object> properties) {
-      if (properties == null) {
-          properties = new HashMap<String, Object>();
-      }
-      String notifierKey = notifier + ".notifier.id";
-      properties.put(notifierKey, token);
-      return registerDevice(deviceId, properties);
-    }
-
-    /**
-     * Create a new entity on the server.
-     *
-     * @param entity
-     * @return an ApiResponse with the new entity in it.
-     */
-    public ApiResponse createEntity(Entity entity) {
-        assertValidApplicationId();
-        if (isEmpty(entity.getType())) {
-            throw new IllegalArgumentException("Missing entity type");
-        }
-        ApiResponse response = apiRequest(HttpMethod.POST, null, entity,
-                organizationId, applicationId, entity.getType());
-        return response;
-    }
-
-    /**
-     * Create a new entity on the server from a set of properties. Properties
-     * must include a "type" property.
-     *
-     * @param properties
-     * @return an ApiResponse with the new entity in it.
-     */
-    public ApiResponse createEntity(Map<String, Object> properties) {
-        assertValidApplicationId();
-        if (isEmpty(properties.get("type"))) {
-            throw new IllegalArgumentException("Missing entity type");
-        }
-        ApiResponse response = apiRequest(HttpMethod.POST, null, properties,
-                organizationId, applicationId, properties.get("type").toString());
-        return response;
-    }
-
-    /**
-     * Creates a user.
-     *
-     * @param username
-     *            required
-     * @param name
-     * @param email
-     * @param password
-     * @return
-     */
-    public ApiResponse createUser(String username, String name, String email,
-            String password) {
-        Map<String, Object> properties = new HashMap<String, Object>();
-        properties.put("type", "user");
-        if (username != null) {
-            properties.put("username", username);
-        }
-        if (name != null) {
-            properties.put("name", name);
-        }
-        if (email != null) {
-            properties.put("email", email);
-        }
-        if (password != null) {
-            properties.put("password", password);
-        }
-        return createEntity(properties);
-    }
-
-    /**
-     * Get the groups for the user.
-     *
-     * @param userId
-     * @return a map with the group path as the key and the Group entity as the
-     *         value
-     */
-    public Map<String, Group> getGroupsForUser(String userId) {
-        ApiResponse response = apiRequest(HttpMethod.GET, null, null,
-                organizationId, applicationId, "users", userId, "groups");
-        Map<String, Group> groupMap = new HashMap<String, Group>();
-        if (response != null) {
-            List<Group> groups = response.getEntities(Group.class);
-            for (Group group : groups) {
-                groupMap.put(group.getPath(), group);
-            }
-        }
-        return groupMap;
-    }
-
-    /**
-     * Get a user's activity feed. Returned as a query to ease paging.
-     *
-     * @param userId
-     * @return
-     */
-    public Query queryActivityFeedForUser(String userId) {
-        Query q = queryEntitiesRequest(HttpMethod.GET, null, null,
-                organizationId, applicationId, "users", userId, "feed");
-        return q;
-    }
-
-    /**
-     * Posts an activity to a user. Activity must already be created.
-     *
-     * @param userId
-     * @param activity
-     * @return
-     */
-    public ApiResponse postUserActivity(String userId, Activity activity) {
-        return apiRequest(HttpMethod.POST, null, activity,  organizationId, applicationId, "users",
-                userId, "activities");
-    }
-
-    /**
-     * Creates and posts an activity to a user.
-     *
-     * @param verb
-     * @param title
-     * @param content
-     * @param category
-     * @param user
-     * @param object
-     * @param objectType
-     * @param objectName
-     * @param objectContent
-     * @return
-     */
-    public ApiResponse postUserActivity(String verb, String title,
-            String content, String category, User user, Entity object,
-            String objectType, String objectName, String objectContent) {
-        Activity activity = Activity.newActivity(verb, title, content,
-                category, user, object, objectType, objectName, objectContent);
-        return postUserActivity(user.getUuid().toString(), activity);
-    }
-
-    /**
-     * Posts an activity to a group. Activity must already be created.
-     *
-     * @param userId
-     * @param activity
-     * @return
-     */
-    public ApiResponse postGroupActivity(String groupId, Activity activity) {
-        return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "groups",
-                groupId, "activities");
-    }
-
-    /**
-     * Creates and posts an activity to a group.
-     *
-     * @param groupId
-     * @param verb
-     * @param title
-     * @param content
-     * @param category
-     * @param user
-     * @param object
-     * @param objectType
-     * @param objectName
-     * @param objectContent
-     * @return
-     */
-    public ApiResponse postGroupActivity(String groupId, String verb, String title,
-            String content, String category, User user, Entity object,
-            String objectType, String objectName, String objectContent) {
-        Activity activity = Activity.newActivity(verb, title, content,
-                category, user, object, objectType, objectName, objectContent);
-        return postGroupActivity(groupId, activity);
-    }
-
-    /**
-     * Post an activity to the stream.
-     *
-     * @param activity
-     * @return
-     */
-    public ApiResponse postActivity(Activity activity) {
-        return createEntity(activity);
-    }
-
-    /**
-     * Creates and posts an activity to a group.
-     *
-     * @param verb
-     * @param title
-     * @param content
-     * @param category
-     * @param user
-     * @param object
-     * @param objectType
-     * @param objectName
-     * @param objectContent
-     * @return
-     */
-    public ApiResponse postActivity(String verb, String title,
-            String content, String category, User user, Entity object,
-            String objectType, String objectName, String objectContent) {
-        Activity activity = Activity.newActivity(verb, title, content,
-                category, user, object, objectType, objectName, objectContent);
-        return createEntity(activity);
-    }
-
-    /**
-     * Get a group's activity feed. Returned as a query to ease paging.
-     *
-     * @param userId
-     * @return
-     */
-    public Query queryActivity() {
-        Query q = queryEntitiesRequest(HttpMethod.GET, null, null,
-               organizationId, applicationId, "activities");
-        return q;
-    }
-
-
-
-    /**
-     * Get a group's activity feed. Returned as a query to ease paging.
-     *
-     * @param userId
-     * @return
-     */
-    public Query queryActivityFeedForGroup(String groupId) {
-        Query q = queryEntitiesRequest(HttpMethod.GET, null, null,
-                organizationId,  applicationId, "groups", groupId, "feed");
-        return q;
-    }
-
-    /**
-     * Perform a query request and return a query object. The Query object
-     * provides a simple way of dealing with result sets that need to be
-     * iterated or paged through.
-     *
-     * @param method
-     * @param params
-     * @param data
-     * @param segments
-     * @return
-     */
-    public Query queryEntitiesRequest(HttpMethod method,
-            Map<String, Object> params, Object data, String... segments) {
-        ApiResponse response = apiRequest(method, params, data, segments);
-        return new EntityQuery(response, method, params, data, segments);
-    }
-
-    /**
-     * Perform a query of the users collection.
-     *
-     * @return
-     */
-    public Query queryUsers() {
-        Query q = queryEntitiesRequest(HttpMethod.GET, null, null,
-                organizationId,  applicationId, "users");
-        return q;
-    }
-
-    /**
-     * Perform a query of the users collection using the provided query command.
-     * For example: "name contains 'ed'".
-     *
-     * @param ql
-     * @return
-     */
-    public Query queryUsers(String ql) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("ql", ql);
-        Query q = queryEntitiesRequest(HttpMethod.GET, params, null,organizationId,
-                applicationId, "users");
-        return q;
-    }
-
-    /**
-     * Perform a query of the users collection within the specified distance of
-     * the specified location and optionally using the provided query command.
-     * For example: "name contains 'ed'".
-     *
-     * @param distance
-     * @param location
-     * @param ql
-     * @return
-     */
-    public Query queryUsersWithinLocation(float distance, float lattitude,
-            float longitude, String ql) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("ql",
-                this.makeLocationQL(distance, lattitude, longitude, ql));
-        Query q = queryEntitiesRequest(HttpMethod.GET, params, null, organizationId,
-                applicationId, "users");
-        return q;
-    }
-
-    /**
-     * Queries the users for the specified group.
-     *
-     * @param groupId
-     * @return
-     */
-    public Query queryUsersForGroup(String groupId) {
-        Query q = queryEntitiesRequest(HttpMethod.GET, null, null, organizationId,
-                applicationId, "groups", groupId, "users");
-        return q;
-    }
-
-    /**
-     * Adds a user to the specified groups.
-     *
-     * @param userId
-     * @param groupId
-     * @return
-     */
-    public ApiResponse addUserToGroup(String userId, String groupId) {
-        return apiRequest(HttpMethod.POST, null, null, organizationId,  applicationId, "groups",
-                groupId, "users", userId);
-    }
-
-    /**
-     * Creates a group with the specified group path. Group paths can be slash
-     * ("/") delimited like file paths for hierarchical group relationships.
-     *
-     * @param groupPath
-     * @return
-     */
-    public ApiResponse createGroup(String groupPath) {
-        return createGroup(groupPath, null);
-    }
-
-    /**
-     * Creates a group with the specified group path and group title. Group
-     * paths can be slash ("/") delimited like file paths for hierarchical group
-     * relationships.
-     *
-     * @param groupPath
-     * @param groupTitle
-     * @return
-     */
-    public ApiResponse createGroup(String groupPath, String groupTitle) {
-     return createGroup(groupPath, groupTitle, null);
-    }
-
-    /**
-     * Create a group with a path, title and name
-     * @param groupPath
-     * @param groupTitle
-     * @param groupName
-     * @return
-     */
-    public ApiResponse createGroup(String groupPath, String groupTitle, String groupName){
-        Map<String, Object> data = new HashMap<String, Object>();
-        data.put("type", "group");
-        data.put("path", groupPath);
-
-        if (groupTitle != null) {
-            data.put("title", groupTitle);
-        }
-
-        if(groupName != null){
-            data.put("name", groupName);
-        }
-
-        return apiRequest(HttpMethod.POST, null, data,  organizationId, applicationId, "groups");
-    }
-
-    /**
-     * Perform a query of the users collection using the provided query command.
-     * For example: "name contains 'ed'".
-     *
-     * @param ql
-     * @return
-     */
-    public Query queryGroups(String ql) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("ql", ql);
-        Query q = queryEntitiesRequest(HttpMethod.GET, params, null, organizationId,
-                applicationId, "groups");
-        return q;
-    }
-
-
-
-    /**
-     * Connect two entities together.
-     *
-     * @param connectingEntityType
-     * @param connectingEntityId
-     * @param connectionType
-     * @param connectedEntityId
-     * @return
-     */
-    public ApiResponse connectEntities(String connectingEntityType,
-            String connectingEntityId, String connectionType,
-            String connectedEntityId) {
-        return apiRequest(HttpMethod.POST, null, null,  organizationId, applicationId,
-                connectingEntityType, connectingEntityId, connectionType,
-                connectedEntityId);
-    }
-
-    /**
-     * Disconnect two entities.
-     *
-     * @param connectingEntityType
-     * @param connectingEntityId
-     * @param connectionType
-     * @param connectedEntityId
-     * @return
-     */
-    public ApiResponse disconnectEntities(String connectingEntityType,
-            String connectingEntityId, String connectionType,
-            String connectedEntityId) {
-        return apiRequest(HttpMethod.DELETE, null, null,  organizationId, applicationId,
-                connectingEntityType, connectingEntityId, connectionType,
-                connectedEntityId);
-    }
-
-    /**
-     * Query the connected entities.
-     *
-     * @param connectingEntityType
-     * @param connectingEntityId
-     * @param connectionType
-     * @param ql
-     * @return
-     */
-    public Query queryEntityConnections(String connectingEntityType,
-            String connectingEntityId, String connectionType, String ql) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("ql", ql);
-        Query q = queryEntitiesRequest(HttpMethod.GET, params, null,
-                organizationId, applicationId, connectingEntityType, connectingEntityId,
-                connectionType);
-        return q;
-    }
-
-    protected String makeLocationQL(float distance, double lattitude,
-            double longitude, String ql) {
-        String within = String.format("within %d of %d , %d", distance,
-                lattitude, longitude);
-        ql = ql == null ? within : within + " and " + ql;
-        return ql;
-    }
-
-    /**
-     * Query the connected entities within distance of a specific point.
-     *
-     * @param connectingEntityType
-     * @param connectingEntityId
-     * @param connectionType
-     * @param distance
-     * @param latitude
-     * @param longitude
-     * @return
-     */
-    public Query queryEntityConnectionsWithinLocation(
-            String connectingEntityType, String connectingEntityId,
-            String connectionType, float distance, float lattitude,
-            float longitude, String ql) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        params.put("ql", makeLocationQL(distance, lattitude, longitude, ql));
-        Query q = queryEntitiesRequest(HttpMethod.GET, params, null, organizationId,
-                applicationId, connectingEntityType, connectingEntityId,
-                connectionType);
-        return q;
-    }
-
-    public interface Query {
-
-        public ApiResponse getResponse();
-
-        public boolean more();
-
-        public Query next();
-
-    }
-
-    /**
-     * Query object
-     *
-     */
-    private class EntityQuery implements Query {
-        final HttpMethod method;
-        final Map<String, Object> params;
-        final Object data;
-        final String[] segments;
-        final ApiResponse response;
-
-        private EntityQuery(ApiResponse response, HttpMethod method,
-                Map<String, Object> params, Object data, String[] segments) {
-            this.response = response;
-            this.method = method;
-            this.params = params;
-            this.data = data;
-            this.segments = segments;
-        }
-
-        private EntityQuery(ApiResponse response, EntityQuery q) {
-            this.response = response;
-            method = q.method;
-            params = q.params;
-            data = q.data;
-            segments = q.segments;
-        }
-
-        /**
-         * @return the api response of the last request
-         */
-        public ApiResponse getResponse() {
-            return response;
-        }
-
-        /**
-         * @return true if the server indicates more results are available
-         */
-        public boolean more() {
-            if ((response != null) && (response.getCursor() != null)
-                    && (response.getCursor().length() > 0)) {
-                return true;
-            }
-            return false;
-        }
-
-        /**
-         * Performs a request for the next set of results
-         *
-         * @return query that contains results and where to get more from.
-         */
-        public Query next() {
-            if (more()) {
-                Map<String, Object> nextParams = null;
-                if (params != null) {
-                    nextParams = new HashMap<String, Object>(params);
-                } else {
-                    nextParams = new HashMap<String, Object>();
-                }
-                nextParams.put("cursor", response.getCursor());
-                ApiResponse nextResponse = apiRequest(method, nextParams, data,
-                        segments);
-                return new EntityQuery(nextResponse, this);
-            }
-            return null;
-        }
-
-    }
-
-    private String normalizeQueuePath(String path) {
-        return arrayToDelimitedString(
-                tokenizeToStringArray(path, "/", true, true), "/");
-    }
-
-    public ApiResponse postMessage(String path, Map<String, Object> message) {
-        return apiRequest(HttpMethod.POST, null, message, organizationId,  applicationId,
-                "queues", normalizeQueuePath(path));
-    }
-
-    public ApiResponse postMessage(String path,
-            List<Map<String, Object>> messages) {
-        return apiRequest(HttpMethod.POST, null, messages,  organizationId, applicationId,
-                "queues", normalizeQueuePath(path));
-    }
-
-    public enum QueuePosition {
-        START("start"), END("end"), LAST("last"), CONSUMER("consumer");
-
-        private final String shortName;
-
-        QueuePosition(String shortName) {
-            this.shortName = shortName;
-        }
-
-        static Map<String, QueuePosition> nameMap = new ConcurrentHashMap<String, QueuePosition>();
-
-        static {
-            for (QueuePosition op : EnumSet.allOf(QueuePosition.class)) {
-                if (op.shortName != null) {
-                    nameMap.put(op.shortName, op);
-                }
-            }
-        }
-
-        public static QueuePosition find(String s) {
-            if (s == null) {
-                return null;
-            }
-            return nameMap.get(s);
-        }
-
-        @Override
-        public String toString() {
-            return shortName;
-        }
-    }
-
-    public ApiResponse getMessages(String path, String consumer, UUID last,
-            Long time, Integer prev, Integer next, Integer limit,
-            QueuePosition pos, Boolean update, Boolean sync) {
-        Map<String, Object> params = new HashMap<String, Object>();
-        if (consumer != null) {
-            params.put("consumer", consumer);
-        }
-        if (last != null) {
-            params.put("last", last);
-        }
-        if (time != null) {
-            params.put("time", time);
-        }
-        if (prev != null) {
-            params.put("prev", prev);
-        }
-        if (next != null) {
-            params.put("next", next);
-        }
-        if (limit != null) {
-            params.put("limit", limit);
-        }
-        if (pos != null) {
-            params.put("pos", pos.toString());
-        }
-        if (update != null) {
-            params.put("update", update);
-        }
-        if (sync != null) {
-            params.put("synchronized", sync);
-        }
-        return apiRequest(HttpMethod.GET, params, null,  organizationId, applicationId,
-                "queues", normalizeQueuePath(path));
-    }
-
-    public ApiResponse addSubscriber(String publisherQueue,
-            String subscriberQueue) {
-        return apiRequest(HttpMethod.POST, null, null, organizationId,  applicationId, "queues",
-                normalizeQueuePath(publisherQueue), "subscribers",
-                normalizeQueuePath(subscriberQueue));
-    }
-
-    public ApiResponse removeSubscriber(String publisherQueue,
-            String subscriberQueue) {
-        return apiRequest(HttpMethod.DELETE, null, null, organizationId,  applicationId,
-                "queues", normalizeQueuePath(publisherQueue), "subscribers",
-                normalizeQueuePath(subscriberQueue));
-    }
-
-    private class QueueQuery implements Query {
-        final HttpMethod method;
-        final Map<String, Object> params;
-        final Object data;
-        final String queuePath;
-        final ApiResponse response;
-
-        private QueueQuery(ApiResponse response, HttpMethod method,
-                Map<String, Object> params, Object data, String queuePath) {
-            this.response = response;
-            this.method = method;
-            this.params = params;
-            this.data = data;
-            this.queuePath = normalizeQueuePath(queuePath);
-        }
-
-        private QueueQuery(ApiResponse response, QueueQuery q) {
-            this.response = response;
-            method = q.method;
-            params = q.params;
-            data = q.data;
-            queuePath = q.queuePath;
-        }
-
-        /**
-         * @return the api response of the last request
-         */
-        public ApiResponse getResponse() {
-            return response;
-        }
-
-        /**
-         * @return true if the server indicates more results are available
-         */
-        public boolean more() {
-            if ((response != null) && (response.getCursor() != null)
-                    && (response.getCursor().length() > 0)) {
-                return true;
-            }
-            return false;
-        }
-
-        /**
-         * Performs a request for the next set of results
-         *
-         * @return query that contains results and where to get more from.
-         */
-        public Query next() {
-            if (more()) {
-                Map<String, Object> nextParams = null;
-                if (params != null) {
-                    nextParams = new HashMap<String, Object>(params);
-                } else {
-                    nextParams = new HashMap<String, Object>();
-                }
-                nextParams.put("start", response.getCursor());
-                ApiResponse nextResponse = apiRequest(method, nextParams, data,
-                        queuePath);
-                return new QueueQuery(nextResponse, this);
-            }
-            return null;
-        }
-
-    }
-
-    public Query queryQueuesRequest(HttpMethod method,
-            Map<String, Object> params, Object data, String queuePath) {
-        ApiResponse response = apiRequest(method, params, data, queuePath);
-        return new QueueQuery(response, method, params, data, queuePath);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
new file mode 100644
index 0000000..69be358
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/Usergrid.java
@@ -0,0 +1,285 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client;
+
+import org.apache.usergrid.java.client.UsergridEnums.UsergridAuthMode;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.auth.UsergridAuth;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.model.*;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.apache.usergrid.java.client.UsergridEnums.UsergridDirection;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public final class Usergrid {
+    @NotNull public static final String UsergridSDKVersion = "2.1.0";
+
+    private static UsergridClient sharedClient;
+    private Usergrid() { /** Private constructor because we only have static methods. **/ }
+
+    public static boolean isInitialized() {
+        return (Usergrid.sharedClient != null);
+    }
+    public static void reset() { Usergrid.sharedClient = null; }
+
+    @NotNull
+    public static UsergridClient getInstance() throws NullPointerException {
+        if (!Usergrid.isInitialized()) {
+            throw new NullPointerException("Shared client has not been initialized!");
+        }
+        return Usergrid.sharedClient;
+    }
+
+    @NotNull
+    public static UsergridClient initSharedInstance(@NotNull final UsergridClientConfig config) {
+        if (Usergrid.isInitialized()) {
+            System.out.print("The Usergrid shared instance was already initialized. All subsequent initialization attempts (including this) will be ignored.");
+        } else {
+            Usergrid.sharedClient = new UsergridClient(config);
+        }
+        return Usergrid.sharedClient;
+    }
+
+    @NotNull
+    public static UsergridClient initSharedInstance(@NotNull final String orgId, @NotNull final String appId) {
+        return Usergrid.initSharedInstance(new UsergridClientConfig(orgId, appId));
+    }
+
+    @NotNull
+    public static UsergridClient initSharedInstance(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl) {
+        return Usergrid.initSharedInstance(new UsergridClientConfig(orgId, appId, baseUrl));
+    }
+
+    @NotNull
+    public static UsergridClient initSharedInstance(@NotNull final String orgId, @NotNull final String appId, @NotNull final String baseUrl, @NotNull final UsergridAuthMode authMode) {
+        return Usergrid.initSharedInstance(new UsergridClientConfig(orgId, appId, baseUrl, authMode));
+    }
+
+    @NotNull public static UsergridClientConfig getConfig() { return Usergrid.getInstance().getConfig(); }
+    public static void setConfig(@NotNull UsergridClientConfig config) { Usergrid.getInstance().setConfig(config); }
+
+    @NotNull public static String getAppId() { return Usergrid.getInstance().getAppId(); }
+    public static void setAppId(@NotNull String appId) { Usergrid.getInstance().setAppId(appId); }
+
+    @NotNull public static String getOrgId() { return Usergrid.getInstance().getOrgId(); }
+    public static void setOrgId(@NotNull String orgId) { Usergrid.getInstance().setOrgId(orgId); }
+
+    @NotNull public static String getBaseUrl() { return Usergrid.getInstance().getBaseUrl(); }
+    public static void setBaseUrl(@NotNull String baseUrl) { Usergrid.getInstance().setBaseUrl(baseUrl); }
+
+    @NotNull public static String clientAppUrl() { return Usergrid.getInstance().clientAppUrl(); }
+
+    @NotNull public static UsergridAuthMode getAuthMode() { return Usergrid.getInstance().getAuthMode(); }
+    public static void setAuthMode(@NotNull final UsergridAuthMode authMode) { Usergrid.getInstance().setAuthMode(authMode); }
+
+    @Nullable public static UsergridAppAuth getAppAuth() { return Usergrid.getInstance().getAppAuth(); }
+    public static void setAppAuth(@Nullable final UsergridAppAuth appAuth) { Usergrid.getInstance().setAppAuth(appAuth); }
+
+    @Nullable public static UsergridUser getCurrentUser() { return Usergrid.getInstance().getCurrentUser(); }
+    public static void setCurrentUser(@Nullable final UsergridUser currentUser) { Usergrid.getInstance().setCurrentUser(currentUser); }
+
+    @Nullable
+    public static UsergridAuth authForRequests() {
+        return Usergrid.getInstance().authForRequests();
+    }
+
+    @NotNull
+    public static UsergridClient usingAuth(@NotNull final UsergridAuth auth) {
+        return Usergrid.getInstance().usingAuth(auth);
+    }
+
+    @NotNull
+    public static UsergridClient usingToken(@NotNull final String accessToken) {
+        return Usergrid.getInstance().usingToken(accessToken);
+    }
+
+    @NotNull
+    public static UsergridResponse resetPassword(@NotNull final UsergridUser user, @NotNull final String oldPassword, @NotNull final String newPassword) {
+        return Usergrid.getInstance().resetPassword(user, oldPassword, newPassword);
+    }
+
+    @NotNull
+    public static UsergridResponse authenticateApp() {
+        return Usergrid.getInstance().authenticateApp();
+    }
+
+    @NotNull
+    public static UsergridResponse authenticateApp(@NotNull final UsergridAppAuth appAuth) {
+        return Usergrid.getInstance().authenticateApp(appAuth);
+    }
+
+    @NotNull
+    public static UsergridResponse authenticateUser(@NotNull final UsergridUserAuth userAuth) {
+        return Usergrid.getInstance().authenticateUser(userAuth);
+    }
+
+    @NotNull
+    public static UsergridResponse authenticateUser(@NotNull final UsergridUserAuth userAuth, final boolean setAsCurrentUser) {
+        return Usergrid.getInstance().authenticateUser(userAuth,setAsCurrentUser);
+    }
+
+    @NotNull
+    public static UsergridResponse logoutCurrentUser() {
+        return Usergrid.getInstance().logoutCurrentUser();
+    }
+
+    @NotNull
+    public static UsergridResponse logoutUserAllTokens(@NotNull final String uuidOrUsername) {
+        return Usergrid.getInstance().logoutUserAllTokens(uuidOrUsername);
+    }
+
+    @NotNull
+    public static UsergridResponse logoutUser(@NotNull final String uuidOrUsername, @Nullable final String token) {
+        return Usergrid.getInstance().logoutUser(uuidOrUsername,token);
+    }
+
+    @NotNull
+    public static UsergridResponse sendRequest(@NotNull final UsergridRequest request) {
+        return Usergrid.getInstance().sendRequest(request);
+    }
+
+    @NotNull
+    public static UsergridResponse GET(@NotNull final String type, @NotNull final String uuidOrName) {
+        return Usergrid.getInstance().GET(type, uuidOrName);
+    }
+
+    @NotNull
+    public static UsergridResponse GET(@NotNull final String type) {
+        return Usergrid.getInstance().GET(type);
+    }
+
+    @NotNull
+    public static UsergridResponse GET(@NotNull final UsergridQuery query) {
+        return Usergrid.getInstance().GET(query);
+    }
+
+    @NotNull
+    public static UsergridResponse PUT(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+        return Usergrid.getInstance().PUT(type, uuidOrName, jsonBody);
+    }
+
+    @NotNull
+    public static UsergridResponse PUT(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+        return Usergrid.getInstance().PUT(type, jsonBody);
+    }
+
+    @NotNull
+    public static UsergridResponse PUT(@NotNull final UsergridEntity entity) {
+        return Usergrid.getInstance().PUT(entity);
+    }
+
+    @NotNull
+    public static UsergridResponse PUT(@NotNull final UsergridQuery query, @NotNull final Map<String, Object> jsonBody) {
+        return Usergrid.getInstance().PUT(query, jsonBody);
+    }
+
+    @NotNull
+    public static UsergridResponse POST(@NotNull final String type, @NotNull final String uuidOrName, @NotNull final Map<String, Object> jsonBody) {
+        return Usergrid.getInstance().POST(type, uuidOrName, jsonBody);
+    }
+
+    @NotNull
+    public static UsergridResponse POST(@NotNull final String type, @NotNull final Map<String, Object> jsonBody) {
+        return Usergrid.getInstance().POST(type, jsonBody);
+    }
+
+    @NotNull
+    public static UsergridResponse POST(@NotNull final String type, @NotNull final List<Map<String, Object>> jsonBodies) {
+        return Usergrid.getInstance().POST(type, jsonBodies);
+    }
+
+    @NotNull
+    public static UsergridResponse POST(@NotNull final UsergridEntity entity) throws NullPointerException {
+        return Usergrid.getInstance().POST(entity);
+    }
+
+    @NotNull
+    public static UsergridResponse POST(@NotNull final List<UsergridEntity> entities) {
+        return Usergrid.getInstance().POST(entities);
+    }
+
+    @NotNull
+    public static UsergridResponse DELETE(@NotNull final String type, @NotNull final String uuidOrName) {
+        return Usergrid.getInstance().DELETE(type, uuidOrName);
+    }
+
+    @NotNull
+    public static UsergridResponse DELETE(@NotNull final UsergridEntity entity) {
+        return Usergrid.getInstance().DELETE(entity);
+    }
+
+    @NotNull
+    public static UsergridResponse DELETE(@NotNull final UsergridQuery query) {
+        return Usergrid.getInstance().DELETE(query);
+    }
+
+    @NotNull
+    public static UsergridResponse connect(@NotNull final UsergridEntity entity, @NotNull final String relationship, @NotNull final UsergridEntity to) {
+        return Usergrid.getInstance().connect(entity, relationship, to);
+    }
+
+    @NotNull
+    public static UsergridResponse connect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String fromUuid) {
+        return Usergrid.getInstance().connect(entityType,entityId,relationship,fromUuid);
+    }
+
+    @NotNull
+    public static UsergridResponse connect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String toType, @NotNull final String toName) {
+        return Usergrid.getInstance().connect(entityType,entityId,relationship,toType,toName);
+    }
+
+    @NotNull
+    public static UsergridResponse disconnect(@NotNull final UsergridEntity entity, @NotNull final String relationship, @NotNull final UsergridEntity from) {
+        return Usergrid.getInstance().disconnect(entity, relationship, from);
+    }
+
+    @NotNull
+    public static UsergridResponse disconnect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String fromUuid) {
+        return Usergrid.getInstance().disconnect(entityType, entityId, relationship, fromUuid);
+    }
+
+    @NotNull
+    public static UsergridResponse disconnect(@NotNull final String entityType, @NotNull final String entityId, @NotNull final String relationship, @NotNull final String fromType, @NotNull final String fromName) {
+        return Usergrid.getInstance().disconnect(entityType, entityId, relationship, fromType, fromName);
+    }
+
+    @NotNull
+    public static UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final UsergridEntity entity, @NotNull final String relationship) {
+        return Usergrid.getInstance().getConnections(direction, entity, relationship);
+    }
+
+    @NotNull
+    public static UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final UsergridEntity entity, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        return Usergrid.getInstance().getConnections(direction, entity, relationship, query);
+    }
+
+    @NotNull
+    public static UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final String type, @NotNull final String uuidOrName, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        return Usergrid.getInstance().getConnections(direction,type,uuidOrName,relationship,query);
+    }
+
+    @NotNull
+    public static UsergridResponse getConnections(@NotNull final UsergridDirection direction, @NotNull final String uuid, @NotNull final String relationship, @Nullable final UsergridQuery query) {
+        return Usergrid.getInstance().getConnections(direction, uuid, relationship, query);
+    }
+}
\ No newline at end of file


[28/54] [abbrv] usergrid git commit: Update distinct to properly use device ID.

Posted by mr...@apache.org.
Update distinct to properly use device ID.


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

Branch: refs/heads/apm
Commit: e76e65db9d1e106e4bcf3cc7f7a40606308b92e6
Parents: 7df40ac
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 18:52:07 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 18:52:07 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/impl/ApplicationQueueManagerImpl.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/e76e65db/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index d50bd81..fa8c8a2 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -314,7 +314,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                 .distinct( queueMessage -> {
 
                     if(queueMessage.isPresent()) {
-                        return queueMessage.get().getNotificationId();
+                        return queueMessage.get().getDeviceId();
                     }
 
                     return UUIDUtils.newTimeUUID(); // this should be distinct, default handling for the Optional.empty() case


[23/54] [abbrv] usergrid git commit: Fix NPE.

Posted by mr...@apache.org.
Fix NPE.


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

Branch: refs/heads/apm
Commit: 158b5de37fbfa1c6585dadb14b9d8508ecc06026
Parents: c5b06db
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 16:17:53 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 16:17:53 2016 -0700

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationsService.java   | 5 ++++-
 .../notifications/impl/ApplicationQueueManagerImpl.java         | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/158b5de3/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index f4fdb65..65425d7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -136,7 +136,10 @@ public class NotificationsService extends AbstractCollectionService {
             // perform some input validates on useGraph payload property vs. ql= path query
             final List<ServiceParameter> parameters = context.getRequest().getOriginalParameters();
             for (ServiceParameter parameter : parameters){
-                if( parameter instanceof ServiceParameter.QueryParameter && context.getProperties().get("useGraph").equals(true)){
+                if( parameter instanceof ServiceParameter.QueryParameter
+                    && context.getProperties().get("useGraph") != null
+                      && context.getProperties().get("useGraph").equals(true)){
+
                     throw new IllegalArgumentException("Query ql parameter cannot be used with useGraph:true property value");
                 }
             }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/158b5de3/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 1bb92b7..5254fd6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -52,6 +52,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
     private final String queueName;
     private final Meter queueMeter;
     private final Meter sendMeter;
+    private int concurrencyFactor;
 
     private final static String PUSH_PROCESSING_MAXTHREADS_PROP = "usergrid.push.async.processing.threads";
     private final static String PUSH_PROCESSING_QUEUESIZE_PROP = "usergrid.push.async.processing.queue.size";
@@ -84,12 +85,14 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
             maxAsyncThreads = Integer.valueOf(System.getProperty(PUSH_PROCESSING_MAXTHREADS_PROP, "200"));
             workerQueueSize = Integer.valueOf(System.getProperty(PUSH_PROCESSING_QUEUESIZE_PROP, "2000"));
+            this.concurrencyFactor = Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50"));
 
         } catch (Exception e){
 
             // if junk is passed into the property, just default the values
             maxAsyncThreads = 200;
             workerQueueSize = 2000;
+            this.concurrencyFactor = 50;
 
         }
 
@@ -330,7 +333,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                         }).subscribeOn(Schedulers.from(asyncExecutor));
 
-                }, Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50")))
+                }, concurrencyFactor)
                 .doOnError(throwable -> {
 
                     logger.error("Error while processing devices for notification : {}", notification.getUuid());


[51/54] [abbrv] usergrid git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/usergrid

Posted by mr...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/usergrid


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

Branch: refs/heads/apm
Commit: 337c94c58368cb949ed1c6aa2613386111d0a8b4
Parents: 3737356 886e837
Author: Dave Johnson <sn...@apache.org>
Authored: Mon May 23 10:05:34 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon May 23 10:05:34 2016 -0400

----------------------------------------------------------------------
 UsergridSDK.podspec                             |   18 +
 content/docs/README.html                        |    8 +-
 .../file-storage-configuration.html             |    8 +-
 content/docs/assets-and-files/folders.html      |    8 +-
 .../assets-and-files/legacy-asset-support.html  |    8 +-
 .../assets-and-files/retrieving-assets.html     |    8 +-
 .../docs/assets-and-files/uploading-assets.html |    8 +-
 .../creating-and-incrementing-counters.html     |    8 +-
 .../events-and-counters.html                    |    8 +-
 .../retrieving-counters.html                    |    8 +-
 .../docs/data-queries/advanced-query-usage.html |    8 +-
 .../docs/data-queries/operators-and-types.html  |    8 +-
 content/docs/data-queries/query-parameters.html |    8 +-
 .../docs/data-queries/querying-your-data.html   |    8 +-
 content/docs/data-storage/collections.html      |    8 +-
 content/docs/data-storage/data-store-dbms.html  |    8 +-
 content/docs/data-storage/entities.html         |    8 +-
 .../docs/data-storage/optimizing-access.html    |    8 +-
 .../entity-connections/connecting-entities.html |    8 +-
 .../disconnecting-entities.html                 |    8 +-
 .../entity-connections/retrieving-entities.html |    8 +-
 content/docs/genindex.html                      |    8 +-
 content/docs/geolocation/geolocation.html       |    8 +-
 content/docs/index.html                         |    8 +-
 content/docs/installation/deployment-guide.html |    8 +-
 .../docs/installation/ug1-deploy-to-tomcat.html |    8 +-
 .../installation/ug1-launcher-quick-start.html  |    8 +-
 .../docs/installation/ug2-deploy-to-tomcat.html |    8 +-
 content/docs/introduction/async-vs-sync.html    |    8 +-
 content/docs/introduction/data-model.html       |    8 +-
 content/docs/introduction/overview.html         |    8 +-
 .../docs/introduction/usergrid-features.html    |    8 +-
 content/docs/jersey2skeleton/README.html        |    8 +-
 content/docs/objects.inv                        |  Bin 686 -> 686 bytes
 content/docs/orgs-and-apps/admin-user.html      |    8 +-
 content/docs/orgs-and-apps/application.html     |    8 +-
 content/docs/orgs-and-apps/managing.html        |    8 +-
 content/docs/orgs-and-apps/organization.html    |    8 +-
 .../push-notifications/adding-push-support.html |    8 +-
 .../creating-and-managing-notifications.html    |    8 +-
 .../push-notifications/creating-notifiers.html  |    8 +-
 .../push-notifications/getting-started.html     |    8 +-
 .../managing-users-and-devices.html             |    8 +-
 content/docs/push-notifications/overview.html   |    8 +-
 .../docs/push-notifications/registering.html    |    8 +-
 content/docs/push-notifications/tbd.html        |    8 +-
 .../push-notifications/troubleshooting.html     |    8 +-
 content/docs/push-notifications/tutorial.html   |    8 +-
 .../docs/push-notifications/users-devices.html  |    8 +-
 content/docs/reference/contribute-code.html     |    8 +-
 content/docs/reference/presos-and-videos.html   |    8 +-
 content/docs/rest-endpoints/api-docs.html       |    8 +-
 content/docs/sdks/ios-new.html                  |    8 +-
 content/docs/sdks/sdk-outline.html              |    8 +-
 content/docs/sdks/tbd.html                      |    8 +-
 content/docs/search.html                        |    8 +-
 .../docs/security-and-auth/app-security.html    |    8 +-
 .../authenticating-api-requests.html            |    8 +-
 ...nticating-users-and-application-clients.html |    8 +-
 .../changing-token-time-live-ttl.html           |    8 +-
 .../docs/security-and-auth/facebook-sign.html   |    8 +-
 .../revoking-tokens-logout.html                 |    8 +-
 .../security-and-auth/securing-your-app.html    |    8 +-
 .../user-authentication-types.html              |    8 +-
 .../security-and-auth/using-permissions.html    |    8 +-
 content/docs/security-and-auth/using-roles.html |    8 +-
 content/docs/user-management/activity.html      |    8 +-
 content/docs/user-management/group.html         |    8 +-
 content/docs/user-management/groups.html        |    8 +-
 .../docs/user-management/messagee-example.html  |    8 +-
 .../docs/user-management/user-connections.html  |    8 +-
 .../docs/user-management/user-management.html   |    8 +-
 .../docs/user-management/working-user-data.html |    8 +-
 .../creating-a-new-application.html             |    8 +-
 .../docs/using-usergrid/creating-account.html   |    8 +-
 .../using-usergrid/using-a-sandbox-app.html     |    8 +-
 content/docs/using-usergrid/using-the-api.html  |    8 +-
 docs/conf.py                                    |    4 +-
 sdks/java/README.md                             |  598 +++++-
 sdks/java/pom.xml                               |   73 +-
 .../org/apache/usergrid/java/client/Client.java | 1292 -------------
 .../apache/usergrid/java/client/Usergrid.java   |  285 +++
 .../usergrid/java/client/UsergridClient.java    |  427 +++++
 .../java/client/UsergridClientConfig.java       |   60 +
 .../usergrid/java/client/UsergridEnums.java     |  170 ++
 .../usergrid/java/client/UsergridRequest.java   |  205 +++
 .../java/client/UsergridRequestManager.java     |   86 +
 .../java/client/auth/UsergridAppAuth.java       |   55 +
 .../usergrid/java/client/auth/UsergridAuth.java |   75 +
 .../java/client/auth/UsergridUserAuth.java      |   56 +
 .../usergrid/java/client/entities/Activity.java |  625 -------
 .../usergrid/java/client/entities/Device.java   |   68 -
 .../usergrid/java/client/entities/Entity.java   |  191 --
 .../usergrid/java/client/entities/Group.java    |   79 -
 .../usergrid/java/client/entities/Message.java  |  148 --
 .../usergrid/java/client/entities/User.java     |  158 --
 .../java/client/exception/ClientException.java  |   41 -
 .../client/exception/UsergridException.java     |   50 +
 .../java/client/model/UsergridDevice.java       |   60 +
 .../java/client/model/UsergridEntity.java       |  487 +++++
 .../java/client/model/UsergridUser.java         |  198 ++
 .../java/client/query/UsergridQuery.java        |  434 +++++
 .../java/client/response/AggregateCounter.java  |   52 -
 .../client/response/AggregateCounterSet.java    |  111 --
 .../java/client/response/ApiResponse.java       |  421 -----
 .../client/response/ClientCredentialsInfo.java  |   58 -
 .../java/client/response/QueueInfo.java         |   44 -
 .../java/client/response/UsergridResponse.java  |  230 +++
 .../client/response/UsergridResponseError.java  |   98 +
 .../usergrid/java/client/utils/JsonUtils.java   |  262 ++-
 .../usergrid/java/client/utils/MapUtils.java    |   27 +-
 .../usergrid/java/client/utils/ObjectUtils.java |   28 +-
 .../usergrid/java/client/utils/UrlUtils.java    |  124 --
 .../utils/UsergridEntityDeserializer.java       |   41 +
 .../client/ClientAuthFallBackTestCase.java      |   72 +
 .../usergrid/client/ClientAuthTestCase.java     |   85 +
 .../client/ClientConnectionsTestCase.java       |  171 ++
 .../usergrid/client/ClientRestTestCase.java     |   90 +
 .../apache/usergrid/client/EntityTestCase.java  |  676 +++++++
 .../apache/usergrid/client/QueryTestCase.java   |  194 ++
 .../usergrid/client/SDKTestConfiguration.java   |   38 +
 .../apache/usergrid/client/SDKTestUtils.java    |  108 ++
 .../client/UsergridClientAuthTestCase.java      |   73 +
 .../usergrid/client/UsergridInitTestCase.java   |   48 +
 .../client/UsergridResponseErrorTestCase.java   |   62 +
 .../client/UsergridResponseTestCase.java        |   85 +
 .../usergrid/client/UsergridTestCase.java       |   30 +
 sdks/java/usergrid-java-client-2.1.0.jar        |  Bin 0 -> 1992232 bytes
 sdks/swift/README.md                            |    2 +-
 .../Source/Base.lproj/Main.storyboard           |   26 +-
 .../ActivityFeed/Source/FormTextField.swift     |    2 +-
 .../Source/MessageViewController.swift          |   26 +-
 .../Samples/Push/Source/UsergridManager.swift   |    2 +-
 sdks/swift/Source/Usergrid.swift                |   32 +-
 sdks/swift/Source/UsergridAsset.swift           |   18 +-
 sdks/swift/Source/UsergridAuth.swift            |    6 +-
 sdks/swift/Source/UsergridClient.swift          |   89 +-
 sdks/swift/Source/UsergridClientConfig.swift    |   14 +-
 sdks/swift/Source/UsergridDevice.swift          |   41 +-
 sdks/swift/Source/UsergridEntity.swift          |  104 +-
 sdks/swift/Source/UsergridEnums.swift           |   22 +-
 sdks/swift/Source/UsergridExtensions.swift      |   82 +-
 sdks/swift/Source/UsergridFileMetaData.swift    |    4 +-
 sdks/swift/Source/UsergridQuery.swift           |    3 +-
 sdks/swift/Source/UsergridRequest.swift         |    2 +-
 sdks/swift/Source/UsergridRequestManager.swift  |   72 +-
 sdks/swift/Source/UsergridResponse.swift        |    6 +-
 sdks/swift/Source/UsergridUser.swift            |   62 +-
 sdks/swift/Tests/ASSET_Tests.swift              |  218 ++-
 sdks/swift/Tests/AUTH_Tests.swift               |   92 +-
 sdks/swift/Tests/CONNECTION_Tests.swift         |   42 +-
 sdks/swift/Tests/ClientCreationTests.swift      |   44 +-
 sdks/swift/Tests/GET_Tests.swift                |   38 +-
 sdks/swift/Tests/PUT_Tests.swift                |   38 +-
 sdks/swift/Tests/TestAssets/UsergridGuy.jpg     |  Bin 0 -> 12981 bytes
 sdks/swift/Tests/User_Tests.swift               |  310 +++-
 sdks/swift/UsergridSDK.podspec                  |   18 -
 .../swift/UsergridSDK.xcodeproj/project.pbxproj |    4 +-
 sdks/swift/docs/Classes.html                    |   16 +-
 sdks/swift/docs/Classes/Usergrid.html           |  290 ++-
 sdks/swift/docs/Classes/UsergridAppAuth.html    |   30 +-
 sdks/swift/docs/Classes/UsergridAsset.html      |   44 +-
 .../Classes/UsergridAssetUploadRequest.html     |   20 +-
 sdks/swift/docs/Classes/UsergridAuth.html       |   34 +-
 sdks/swift/docs/Classes/UsergridClient.html     |  275 ++-
 .../docs/Classes/UsergridClientConfig.html      |   54 +-
 sdks/swift/docs/Classes/UsergridDevice.html     |  205 ++-
 sdks/swift/docs/Classes/UsergridEntity.html     |  215 ++-
 .../docs/Classes/UsergridFileMetaData.html      |   30 +-
 sdks/swift/docs/Classes/UsergridQuery.html      |  156 +-
 sdks/swift/docs/Classes/UsergridRequest.html    |   36 +-
 sdks/swift/docs/Classes/UsergridResponse.html   |   42 +-
 .../docs/Classes/UsergridResponseError.html     |   24 +-
 sdks/swift/docs/Classes/UsergridUser.html       |  231 ++-
 sdks/swift/docs/Classes/UsergridUserAuth.html   |   30 +-
 sdks/swift/docs/Enums.html                      |   28 +-
 sdks/swift/docs/Enums/UsergridAuthMode.html     |  283 +++
 .../docs/Enums/UsergridDeviceProperties.html    |   20 +-
 sdks/swift/docs/Enums/UsergridDirection.html    |   16 +-
 .../docs/Enums/UsergridEntityProperties.html    |   24 +-
 sdks/swift/docs/Enums/UsergridHttpMethod.html   |   16 +-
 .../docs/Enums/UsergridImageContentType.html    |   16 +-
 .../swift/docs/Enums/UsergridQueryOperator.html |   20 +-
 .../docs/Enums/UsergridQuerySortOrder.html      |   20 +-
 .../docs/Enums/UsergridUserProperties.html      |   20 +-
 sdks/swift/docs/Extensions.html                 |   72 +-
 sdks/swift/docs/Extensions/NSDate.html          |  448 +++++
 sdks/swift/docs/Global Variables.html           |   18 +-
 sdks/swift/docs/Typealiases.html                |   36 +-
 .../Contents/Resources/Documents/Classes.html   |  209 ++-
 .../Resources/Documents/Classes/Usergrid.html   | 1086 ++++++++---
 .../Documents/Classes/UsergridAppAuth.html      |  183 +-
 .../Documents/Classes/UsergridAsset.html        |  265 ++-
 .../Classes/UsergridAssetUploadRequest.html     |  356 ++++
 .../Documents/Classes/UsergridAuth.html         |  274 ++-
 .../Documents/Classes/UsergridClient.html       | 1310 +++++++++----
 .../Documents/Classes/UsergridClientConfig.html |  345 +++-
 .../Documents/Classes/UsergridDevice.html       |  519 +++++-
 .../Documents/Classes/UsergridEntity.html       |  809 +++++---
 .../Documents/Classes/UsergridFileMetaData.html |  217 ++-
 .../Documents/Classes/UsergridQuery.html        |  540 ++++--
 .../Documents/Classes/UsergridRequest.html      |  619 +++++++
 .../Documents/Classes/UsergridResponse.html     |  309 ++--
 .../Classes/UsergridResponseError.html          |  473 +++++
 .../Documents/Classes/UsergridUser.html         | 1734 ++++++++++++++++--
 .../Documents/Classes/UsergridUserAuth.html     |  169 +-
 .../Contents/Resources/Documents/Enums.html     |  115 +-
 .../Documents/Enums/UsergridAuthFallback.html   |   53 +-
 .../Documents/Enums/UsergridAuthMode.html       |  283 +++
 .../Enums/UsergridDeviceProperties.html         |   83 +-
 .../Documents/Enums/UsergridDirection.html      |   71 +-
 .../Enums/UsergridEntityProperties.html         |  101 +-
 .../Documents/Enums/UsergridHttpMethod.html     |  341 ++++
 .../Enums/UsergridImageContentType.html         |   73 +-
 .../Documents/Enums/UsergridQueryOperator.html  |   89 +-
 .../Documents/Enums/UsergridQuerySortOrder.html |   83 +-
 .../Documents/Enums/UsergridUserProperties.html |   95 +-
 .../Resources/Documents/Extensions.html         |   72 +-
 .../Resources/Documents/Extensions/NSDate.html  |  448 +++++
 .../Resources/Documents/Global Variables.html   |  210 +++
 .../Resources/Documents/Typealiases.html        |  159 +-
 .../Resources/Documents/css/highlight.css       |    6 +-
 .../Contents/Resources/Documents/css/jazzy.css  |   65 +-
 .../Contents/Resources/Documents/index.html     |  741 +++++++-
 .../Contents/Resources/Documents/js/jazzy.js    |   11 +-
 .../Resources/Documents/undocumented.txt        |   11 -
 .../.docset/Contents/Resources/docSet.dsidx     |  Bin 114688 -> 147456 bytes
 sdks/swift/docs/docsets/.tgz                    |  Bin 111866 -> 148251 bytes
 sdks/swift/docs/index.html                      |   24 +-
 .../main/resources/usergrid-default.properties  |   32 +
 .../apache/usergrid/batch/job/OnlyOnceJob.java  |   22 +-
 .../corepersistence/ApplicationIdCache.java     |    6 +-
 .../corepersistence/ApplicationIdCacheImpl.java |   71 +-
 .../usergrid/corepersistence/CoreModule.java    |    6 +
 .../corepersistence/CpEntityManager.java        |  235 ++-
 .../corepersistence/CpEntityManagerFactory.java |   49 +-
 .../corepersistence/CpManagerCache.java         |    2 +-
 .../corepersistence/CpRelationManager.java      |  149 +-
 .../usergrid/corepersistence/CpSetup.java       |  100 +-
 .../corepersistence/EntityManagerFig.java       |    4 +
 .../usergrid/corepersistence/ManagerCache.java  |    2 +-
 .../asyncevents/AsyncEventService.java          |    7 +
 .../asyncevents/AsyncEventServiceImpl.java      |  153 +-
 .../asyncevents/EventBuilder.java               |   12 +-
 .../asyncevents/EventBuilderImpl.java           |   37 +-
 .../asyncevents/model/AsyncEvent.java           |    7 +-
 .../model/DeIndexOldVersionsEvent.java          |   50 +
 .../asyncevents/model/EdgeDeleteEvent.java      |    4 +-
 .../asyncevents/model/EdgeIndexEvent.java       |   70 +
 .../model/ElasticsearchIndexEvent.java          |    2 +-
 .../asyncevents/model/EntityDeleteEvent.java    |    3 +
 .../asyncevents/model/EntityIndexEvent.java     |   54 +
 .../model/InitializeApplicationIndexEvent.java  |    2 +-
 .../index/IndexProcessorFig.java                |   13 +-
 .../corepersistence/index/IndexSchemaCache.java |   50 +
 .../index/IndexSchemaCacheFactory.java          |   44 +
 .../index/IndexSchemaCacheFig.java              |   39 +
 .../index/IndexSchemaCacheImpl.java             |  120 ++
 .../corepersistence/index/IndexServiceImpl.java |   99 +-
 .../index/ReIndexRequestBuilder.java            |    7 +
 .../index/ReIndexRequestBuilderImpl.java        |   32 +
 .../index/ReIndexServiceImpl.java               |   49 +-
 .../pipeline/builder/IdBuilder.java             |    6 +
 .../pipeline/read/FilterFactory.java            |    8 +-
 .../read/traverse/AbstractReadGraphFilter.java  |   18 +-
 .../pipeline/read/traverse/IdFilter.java        |   52 +
 .../results/IdQueryExecutor.java                |   66 +
 .../service/ApplicationServiceImpl.java         |   37 +-
 .../service/CollectionSearch.java               |    9 +
 .../service/CollectionService.java              |    5 +
 .../service/CollectionServiceImpl.java          |   23 +
 .../service/ServiceSchedulerFig.java            |    2 +-
 .../usergrid/persistence/EntityManager.java     |    7 +
 .../persistence/EntityManagerFactory.java       |    6 +-
 .../persistence/MultiQueryIterator.java         |    2 +-
 .../persistence/NotificationGraphIterator.java  |  163 ++
 .../persistence/PagingResultsIterator.java      |   25 +-
 .../apache/usergrid/persistence/PathQuery.java  |   67 +-
 .../org/apache/usergrid/persistence/Query.java  |    2 +
 .../apache/usergrid/persistence/Results.java    |   20 +
 .../persistence/cassandra/ApplicationCF.java    |    2 +-
 .../persistence/cassandra/CassandraService.java |    2 -
 .../usergrid/persistence/cassandra/Setup.java   |   28 +-
 .../persistence/entities/Notification.java      |  106 +-
 .../org/apache/usergrid/utils/StringUtils.java  |    8 +
 .../main/resources/usergrid-core-context.xml    |    6 +
 .../corepersistence/StaleIndexCleanupTest.java  |  184 +-
 .../index/AsyncEventServiceImplTest.java        |   23 +-
 .../usergrid/corepersistence/index/RxTest.java  |  129 ++
 .../usergrid/persistence/CoreSchemaManager.java |   14 +-
 .../cassandra/EntityManagerFactoryImplIT.java   |    8 +-
 .../impl/ScopedCacheSerializationImpl.java      |    9 +-
 .../impl/EntityCollectionManagerImpl.java       |    2 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |    9 +-
 .../serialization/SerializationFig.java         |    3 +
 .../core/astyanax/CassandraClusterImpl.java     |    4 +-
 .../persistence/core/astyanax/ColumnSearch.java |    7 +-
 .../core/astyanax/MultiRowColumnIterator.java   |   37 +-
 .../astyanax/MultiRowShardColumnIterator.java   |  462 +++++
 .../core/consistency/TimeServiceImpl.java       |    5 +-
 .../core/executor/TaskExecutorFactory.java      |   10 +-
 .../persistence/core/shard/SmartShard.java      |   61 +
 .../astyanax/MultiRowColumnIteratorTest.java    |   14 +-
 .../usergrid/persistence/graph/GraphFig.java    |   17 +
 .../graph/impl/GraphManagerImpl.java            |    2 +-
 .../impl/EdgeMetadataSerializationV2Impl.java   |    4 +-
 .../impl/shard/NodeShardCache.java              |    7 +-
 .../graph/serialization/impl/shard/Shard.java   |   33 +-
 .../impl/shard/impl/EdgeSearcher.java           |  113 +-
 .../shard/impl/EdgeShardSerializationImpl.java  |   56 +-
 .../shard/impl/NodeShardAllocationImpl.java     |   41 +-
 .../impl/shard/impl/NodeShardCacheImpl.java     |   29 +-
 .../shard/impl/ShardEntryGroupIterator.java     |   12 +
 .../shard/impl/ShardGroupCompactionImpl.java    |  183 +-
 .../impl/ShardedEdgeSerializationImpl.java      |   51 +-
 .../impl/shard/impl/ShardsColumnIterator.java   |   64 +-
 .../shard/impl/serialize/ShardSerializer.java   |   86 +
 .../graph/GraphManagerShardConsistencyIT.java   |  215 ++-
 .../impl/shard/EdgeShardSerializationTest.java  |   12 +-
 .../impl/shard/NodeShardAllocationTest.java     |   44 +-
 .../impl/shard/ShardGroupCompactionTest.java    |    4 +-
 .../graph/src/test/resources/log4j.properties   |    6 +
 .../persistence/map/impl/MapManagerImpl.java    |    6 +
 stack/corepersistence/pom.xml                   |    2 +-
 .../persistence/index/EntityIndexBatch.java     |   13 +-
 .../usergrid/persistence/index/IndexFig.java    |    2 +-
 .../index/impl/EntityToMapConverter.java        |   93 +-
 .../index/impl/EsEntityIndexBatchImpl.java      |   21 +-
 .../index/impl/EsEntityIndexImpl.java           |   25 +-
 .../index/impl/FailureMonitorImpl.java          |    2 +-
 .../persistence/index/impl/IndexOperation.java  |    9 +-
 .../index/impl/IndexOperationMessage.java       |    2 +-
 .../persistence/index/impl/EntityIndexTest.java |    2 +-
 .../usergrid/persistence/queue/QueueFig.java    |    8 +-
 .../queue/impl/QueueManagerFactoryImpl.java     |   27 +-
 .../apache/usergrid/mongo/BasicMongoTest.java   |    8 +-
 .../apache/usergrid/mongo/MongoQueryTest.java   |   18 +-
 stack/pom.xml                                   |    2 +-
 .../org/apache/usergrid/rest/ApiResponse.java   |    7 +-
 .../org/apache/usergrid/rest/RootResource.java  |   25 +
 .../rest/applications/ApplicationResource.java  |    2 +-
 .../rest/applications/CollectionResource.java   |  229 +++
 .../rest/applications/ServiceResource.java      |  140 +-
 .../notifiers/NotifierResource.java             |    3 +-
 .../notifiers/NotifiersResource.java            |    3 +-
 .../rest/applications/users/UserResource.java   |   26 +-
 .../rest/applications/users/UsersResource.java  |    3 +-
 .../IllegalArgumentExceptionMapper.java         |    4 +-
 .../ServiceResourceNotFoundExceptionMapper.java |    9 +-
 .../organizations/OrganizationResource.java     |    8 +-
 .../security/SecuredResourceFilterFactory.java  |   29 +-
 .../OAuth2AccessTokenSecurityFilter.java        |    3 +-
 .../usergrid/rest/system/DatabaseResource.java  |    4 +-
 .../usergrid/rest/system/IndexResource.java     |    6 +
 .../apache/usergrid/rest/NotificationsIT.java   |   11 +
 .../rest/applications/ApplicationCreateIT.java  |    3 +-
 .../applications/ApplicationResourceIT.java     |    2 +-
 .../collection/CollectionsResourceIT.java       |  823 ++++++++-
 .../collection/paging/PagingResourceIT.java     |   70 +-
 .../collection/users/PermissionsResourceIT.java |    6 +-
 .../events/ApplicationRequestCounterIT.java     |   48 +
 .../rest/test/resource/AbstractRestIT.java      |    1 +
 .../rest/test/resource/ClientSetup.java         |   10 +
 .../test/resource/endpoints/NamedResource.java  |   22 +
 .../resources/usergrid-custom-test.properties   |    4 +
 .../cassandra/ManagementServiceImpl.java        |  110 +-
 .../usergrid/security/shiro/ShiroCache.java     |   41 +-
 .../security/shiro/ShiroCacheManager.java       |   15 +-
 .../shiro/credentials/AdminUserAccessToken.java |    3 +
 .../ApplicationClientCredentials.java           |    5 +
 .../shiro/principals/AdminUserPrincipal.java    |    3 +
 .../principals/ApplicationGuestPrincipal.java   |    4 +-
 .../shiro/principals/ApplicationPrincipal.java  |    4 +-
 .../principals/ApplicationUserPrincipal.java    |    3 +
 .../shiro/principals/OrganizationPrincipal.java |    4 +-
 .../security/shiro/utils/LocalShiroCache.java   |   80 +
 .../usergrid/security/tokens/TokenService.java  |    3 +
 .../tokens/cassandra/TokenServiceImpl.java      |   40 +-
 .../services/AbstractCollectionService.java     |   56 +
 .../services/AbstractConnectionsService.java    |   13 +
 .../usergrid/services/AbstractService.java      |   14 +-
 .../org/apache/usergrid/services/Service.java   |    3 +
 .../usergrid/services/ServiceManager.java       |    1 -
 .../usergrid/services/ServiceRequest.java       |    5 +
 .../applications/ApplicationsService.java       |   14 +
 .../usergrid/services/groups/GroupsService.java |    4 +
 .../ApplicationQueueManagerCache.java           |  143 ++
 .../notifications/NotificationDeviceFilter.java |   45 +
 .../notifications/NotificationsService.java     |   41 +-
 .../services/notifications/QueueListener.java   |   97 +-
 .../services/notifications/TaskManager.java     |  128 +-
 .../services/notifications/gcm/GCMAdapter.java  |    7 +-
 .../impl/ApplicationQueueManagerImpl.java       |  382 +++-
 .../services/notifiers/NotifiersService.java    |    6 +
 .../usergrid/services/queues/QueueListener.java |    2 +-
 .../usergrid/services/roles/RolesService.java   |    2 +
 .../usergrid/services/users/UsersService.java   |    2 +
 .../services/users/roles/RolesService.java      |    4 +
 .../resources/usergrid-services-context.xml     |   11 +-
 .../migration/AppInfoMigrationPluginTest.java   |    8 +-
 .../apns/NotificationsServiceIT.java            |   32 +-
 .../gcm/NotificationsServiceIT.java             |  135 +-
 .../resources/usergrid-custom-test.properties   |    1 +
 .../usergrid/cassandra/SchemaManager.java       |    3 -
 .../usergrid/cassandra/FakeSchemaManager.java   |    8 +-
 .../test/notifications/notifications.js         |    5 -
 tests/performance/runLoadNestedEntities.sh      |   98 +
 .../datagenerators/EntityDataGenerator.scala    |   40 +
 .../org/apache/usergrid/enums/EntityType.scala  |    3 +-
 409 files changed, 25793 insertions(+), 8248 deletions(-)
----------------------------------------------------------------------



[10/54] [abbrv] usergrid git commit: Additional tests to show how connection queries work when some entities are not indexed.

Posted by mr...@apache.org.
Additional tests to show how connection queries work when some entities are not indexed.


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

Branch: refs/heads/apm
Commit: 44d81fb5b628677f71e54fb719a8996806be3fb2
Parents: fbced58
Author: Dave Johnson <sn...@apache.org>
Authored: Thu Apr 14 19:18:07 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Thu Apr 14 19:18:07 2016 -0400

----------------------------------------------------------------------
 .../collection/CollectionsResourceIT.java       | 113 ++++++++++++++++++-
 1 file changed, 110 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/44d81fb5/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index b240629..35ee2f8 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@ -209,7 +209,8 @@ public class CollectionsResourceIT extends AbstractRestIT {
         this.app().collection( "testCollections" ).collection( "_indexes" ).delete();
         refreshIndex();
 
-        this.app().collection( "testCollections" ).collection( "_reindex" ).post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
+        this.app().collection( "testCollections" ).collection( "_reindex" )
+            .post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
         refreshIndex();
 
 
@@ -370,7 +371,8 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
 
         //Reindex and verify that the entity only has field one index.
-        this.app().collection( "testCollection" ).collection( "_reindex" ).post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
+        this.app().collection( "testCollection" ).collection( "_reindex" )
+            .post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
 
         for(int i = 0; i < 10; i++) {
             String query = "one ='value"+ i + "'";
@@ -430,7 +432,8 @@ public class CollectionsResourceIT extends AbstractRestIT {
 
 
         //Reindex and verify that the entity only has field one index.
-        this.app().collection( "testCollection" ).collection( "_reindex" ).post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
+        this.app().collection( "testCollection" ).collection( "_reindex" )
+            .post(true,clientSetup.getSuperuserToken(),ApiResponse.class,null,null,false);
 
 
         indexingArray.add( "one" );
@@ -989,4 +992,108 @@ public class CollectionsResourceIT extends AbstractRestIT {
             .get( new QueryParameters().setQuery( "select * where color='magenta'" ) ).iterator();
         assertFalse( getByQuery.hasNext() );
     }
+
+
+    /**
+     * Test that indexed entities can be connected to un-indexed Entities and connections still work.
+     */
+    @Test
+    public void testIndexedEntityToUnindexedEntityConnections() {
+
+        // create entities in an un-indexed collection
+
+        ArrayList<String> indexingArray = new ArrayList<>(  );
+        indexingArray.add( "!" );
+        Entity payload = new Entity();
+        payload.put( "fields", indexingArray);
+
+        String randomizer = RandomStringUtils.randomAlphanumeric(10);
+        String unIndexedCollectionName = "col_" + randomizer;
+        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload );
+        refreshIndex();
+
+        String entityName1 = "unindexed1";
+        Entity unindexed1 = this.app().collection( unIndexedCollectionName )
+            .post( new Entity().withProp("name", entityName1).withProp( "color", "violet" ) );
+
+        String entityName2 = "unindexed2";
+        Entity unindexed2 = this.app().collection( unIndexedCollectionName )
+            .post( new Entity().withProp("name", entityName2).withProp( "color", "violet" ) );
+
+        // create an indexed entity
+
+        String indexedCollection = "col_" + randomizer;
+        String indexedEntityName = "indexedEntity";
+        Entity indexedEntity = this.app().collection( indexedCollection )
+            .post( new Entity().withProp("name", indexedEntityName).withProp( "color", "orange" ) );
+
+        // create connections from indexed entity to un-indexed entities
+
+        app().collection(indexedCollection).entity(indexedEntity).connection("likes").entity(unindexed1).post();
+        app().collection(indexedCollection).entity(indexedEntity).connection("likes").entity(unindexed2).post();
+
+        Collection connectionsByGraph = app().collection( indexedCollection )
+            .entity(indexedEntity).connection( "likes" ).get();
+        assertEquals( 2, connectionsByGraph.getNumOfEntities() );
+
+        Collection connectionsByQuery = app().collection( indexedCollection )
+            .entity(indexedEntity).connection( "likes" )
+            .get( new QueryParameters().setQuery( "select * where color='violet'" ));
+        assertEquals( 0, connectionsByQuery.getNumOfEntities() );
+
+    }
+
+
+    /**
+     * Test that index entities can be connected to un-indexed Entities and connections still work.
+     */
+    @Test
+    public void testUnindexedEntityToIndexedEntityConnections() {
+
+        // create two entities in an indexed collection
+
+        String randomizer = RandomStringUtils.randomAlphanumeric(10);
+        String indexedCollection = "col_" + randomizer;
+        String indexedEntityName = "indexedEntity";
+
+        Entity indexedEntity1 = this.app().collection( indexedCollection )
+            .post( new Entity().withProp("name", indexedEntityName + "_1").withProp( "color", "orange" ) );
+
+        Entity indexedEntity2 = this.app().collection( indexedCollection )
+            .post( new Entity().withProp("name", indexedEntityName + "_2").withProp( "color", "orange" ) );
+
+        // create an un-indexed entity
+
+        ArrayList<String> indexingArray = new ArrayList<>(  );
+        indexingArray.add( "!" );
+        Entity payload = new Entity();
+        payload.put( "fields", indexingArray);
+
+        String unIndexedCollectionName = "col_" + randomizer;
+        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload );
+        refreshIndex();
+
+        String entityName1 = "unindexed1";
+        Entity unindexed1 = this.app().collection( unIndexedCollectionName )
+            .post( new Entity().withProp("name", entityName1).withProp( "color", "violet" ) );
+
+        // create connections from un-indexed entity to indexed entities
+
+        app().collection(unIndexedCollectionName).entity(unindexed1).connection("likes").entity(indexedEntity1).post();
+        app().collection(unIndexedCollectionName).entity(unindexed1).connection("likes").entity(indexedEntity2).post();
+
+        // should be able to get connections via graph from un-indexed to index
+
+        Collection connectionsByGraph = app().collection( indexedCollection )
+            .entity(unindexed1).connection( "likes" ).get();
+        assertEquals( 2, connectionsByGraph.getNumOfEntities() );
+
+        // should not be able to get connections via query from unindexed to indexed
+
+        Collection connectionsByQuery = app().collection( indexedCollection )
+            .entity(unindexed1).connection( "likes" )
+            .get( new QueryParameters().setQuery( "select * where color='orange'" ));
+        assertEquals( 0, connectionsByQuery.getNumOfEntities() );
+    }
+
 }


[02/54] [abbrv] usergrid git commit: Initial commit for new JavaSDK.

Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponseError.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponseError.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponseError.java
new file mode 100644
index 0000000..387ae56
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/response/UsergridResponseError.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.response;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@SuppressWarnings("unused")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class UsergridResponseError {
+
+    @Nullable private String errorName;
+    @Nullable private String errorDescription;
+    @Nullable private String errorException;
+
+    @NotNull private final Map<String, JsonNode> properties = new HashMap<>();
+
+    public UsergridResponseError() {
+        this(null,null,null);
+    }
+    public UsergridResponseError(@Nullable final String errorName) {
+        this(errorName, null, null);
+    }
+    public UsergridResponseError(@Nullable final String errorName, @Nullable final String errorDescription) {
+        this(errorName,errorDescription,null);
+    }
+    public UsergridResponseError(@Nullable final String errorName, @Nullable final String errorDescription, @Nullable final String errorException) {
+        this.errorName = errorName;
+        this.errorDescription = errorDescription;
+        this.errorException = errorException;
+    }
+
+    @NotNull
+    @JsonAnyGetter
+    public Map<String, JsonNode> getProperties() {
+        return properties;
+    }
+
+    @JsonAnySetter
+    public void setProperty(@NotNull final String key, @NotNull final JsonNode value) {
+        properties.put(key, value);
+    }
+
+    @Nullable
+    @JsonProperty("error")
+    public String getErrorName() {
+        return errorName;
+    }
+
+    @JsonProperty("error")
+    public void setErrorName(@NotNull final String errorName) {
+        this.errorName = errorName;
+    }
+
+    @Nullable
+    @JsonProperty("exception")
+    public String getErrorException() {
+        return errorException;
+    }
+
+    @JsonProperty("exception")
+    public void setErrorException(@NotNull final String errorException) {
+        this.errorException = errorException;
+    }
+
+    @Nullable
+    @JsonProperty("error_description")
+    public String getErrorDescription() {
+        return errorDescription;
+    }
+
+    @JsonProperty("error_description")
+    public void setErrorDescription(@NotNull final String errorDescription) {
+        this.errorDescription = errorDescription;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
index a465199..d2f43fb 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/JsonUtils.java
@@ -16,167 +16,119 @@
  */
 package org.apache.usergrid.java.client.utils;
 
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-
 import com.fasterxml.jackson.core.JsonGenerationException;
 import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import org.apache.usergrid.java.client.exception.ClientException;
-
-public class JsonUtils {
-
-
-	static ObjectMapper mapper = new ObjectMapper();
-
-	public static String getStringProperty(Map<String, JsonNode> properties,
-			String name) {
-		JsonNode value = properties.get(name);
-		if (value != null) {
-			return value.asText();
-		}
-		return null;
-	}
-
-	public static void setStringProperty(Map<String, JsonNode> properties,
-			String name, String value) {
-		if (value == null) {
-			properties.remove(name);
-		} else {
-			properties.put(name, JsonNodeFactory.instance.textNode(value));
-		}
-	}
-
-	public static Long getLongProperty(Map<String, JsonNode> properties,
-			String name) {
-		JsonNode value = properties.get(name);
-		if (value != null) {
-			return value.asLong(0);
-		}
-		return null;
-	}
-
-	public static void setLongProperty(Map<String, JsonNode> properties,
-			String name, Long value) {
-		if (value == null) {
-			properties.remove(name);
-		} else {
-			properties.put(name, JsonNodeFactory.instance.numberNode(value));
-		}
-	}
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.node.*;
+import org.apache.usergrid.java.client.exception.UsergridException;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-	public static void setFloatProperty(Map<String, JsonNode> properties, String name, Float value){
-	    if(value == null){
-	        properties.remove(name);
-	    }else{
-	        properties.put(name, JsonNodeFactory.instance.numberNode(value));
-	    }
-	}
-
-	public static Boolean getBooleanProperty(Map<String, JsonNode> properties,
-			String name) {
-		JsonNode value = properties.get(name);
-		if (value != null) {
-			return value.asBoolean();
-		}
-		return false;
-	}
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
 
-	public static void setBooleanProperty(Map<String, JsonNode> properties,
-			String name, Boolean value) {
-		if (value == null) {
-			properties.remove(name);
-		} else {
-			properties.put(name, JsonNodeFactory.instance.booleanNode(value));
-		}
-	}
+@SuppressWarnings("unused")
+public final class JsonUtils {
 
-	public static UUID getUUIDProperty(Map<String, JsonNode> properties,
-			String name) {
-		JsonNode value = properties.get(name);
-		if (value != null) {
-			UUID uuid = null;
-			try {
-				uuid = UUID.fromString(value.asText());
-			} catch (Exception e) {
-			}
-			return uuid;
-		}
-		return null;
-	}
+    @NotNull public static final ObjectMapper mapper = new ObjectMapper();
 
-	public static void setUUIDProperty(Map<String, JsonNode> properties,
-			String name, UUID value) {
-		if (value == null) {
-			properties.remove(name);
-		} else {
-			properties.put(name,
-					JsonNodeFactory.instance.textNode(value.toString()));
-		}
-	}
+    static {
+        SimpleModule module = new SimpleModule();
+        module.addDeserializer(UsergridEntity.class, new UsergridEntityDeserializer());
+        mapper.registerModule(module);
+    }
 
-	public static String toJsonString(Object obj) {
-		try {
-			return mapper.writeValueAsString(obj);
-		} catch (JsonGenerationException e) {
-			throw new ClientException("Unable to generate json", e);
-		} catch (JsonMappingException e) {
-		    throw new ClientException("Unable to map json", e);
-		} catch (IOException e) {
-		    throw new ClientException("IO error", e);
-		}
-	}
+    @NotNull
+    public static ObjectNode createObjectNode() {
+        return mapper.createObjectNode();
+    }
 
-	public static <T> T parse(String json, Class<T> c) {
-		try {
-			return mapper.readValue(json, c);
-		} catch (JsonGenerationException e) {
-            throw new ClientException("Unable to generate json", e);
+    @Nullable
+    public static String getStringProperty(@NotNull final Map<String, JsonNode> properties, @NotNull final String name) {
+        JsonNode value = properties.get(name);
+        if (value != null) {
+            return value.asText();
+        }
+        return null;
+    }
+
+    @NotNull
+    public static ArrayList<Object> convertToArrayList(@NotNull final ArrayNode arrayNode) {
+        ArrayList<Object> arrayList = new ArrayList<>();
+        Iterator<JsonNode> iterator = arrayNode.elements();
+        while( iterator.hasNext() ) {
+            arrayList.add(iterator.next());
+        }
+        return arrayList;
+    }
+
+    @NotNull
+    public static String toJsonString(@NotNull final Object obj) {
+        try {
+            return mapper.writeValueAsString(obj);
+        } catch (JsonGenerationException e) {
+            throw new UsergridException("Unable to generate json", e);
         } catch (JsonMappingException e) {
-            throw new ClientException("Unable to map json", e);
+            throw new UsergridException("Unable to map json", e);
         } catch (IOException e) {
-            throw new ClientException("IO error", e);
+            throw new UsergridException("IO error", e);
         }
-	}
-
-	public static JsonNode toJsonNode(Object obj) {
-		return mapper.convertValue(obj, JsonNode.class);
-	}
-
-	public static <T> T fromJsonNode(JsonNode json, Class<T> c) {
-		try {
-			JsonParser jp = json.traverse();
-			return mapper.readValue(jp, c);
-		} catch (JsonGenerationException e) {
-            throw new ClientException("Unable to generate json", e);
+    }
+
+    @NotNull
+    public static JsonNode toJsonNode(@NotNull final Object obj) {
+        return mapper.convertValue(obj, JsonNode.class);
+    }
+
+    @NotNull
+    public static <T> T fromJsonNode(@NotNull final JsonNode json, @NotNull final Class<T> c) {
+        try {
+            JsonParser jp = json.traverse();
+            return mapper.readValue(jp, c);
+        } catch (JsonGenerationException e) {
+            throw new UsergridException("Unable to generate json", e);
         } catch (JsonMappingException e) {
-            throw new ClientException("Unable to map json", e);
+            throw new UsergridException("Unable to map json", e);
         } catch (IOException e) {
-            throw new ClientException("IO error", e);
+            throw new UsergridException("IO error", e);
         }
-	}
-
-	public static <T> T getObjectProperty(Map<String, JsonNode> properties,
-			String name, Class<T> c) {
-		JsonNode value = properties.get(name);
-		if (value != null) {
-			return fromJsonNode(value, c);
-		}
-		return null;
-	}
-
-	public static void setObjectProperty(Map<String, JsonNode> properties,
-			String name, Object value) {
-		if (value == null) {
-			properties.remove(name);
-		} else {
-			properties.put(name,
-					JsonNodeFactory.instance.textNode(value.toString()));
-		}
-	}
+    }
 
+    public static void setObjectProperty(@NotNull final Map<String, JsonNode> properties, @NotNull final String name, @Nullable final ObjectNode value) {
+        if (value == null) {
+            properties.remove(name);
+        } else {
+            properties.put(name, value);
+        }
+    }
+
+    @Nullable
+    @SuppressWarnings("unchecked")
+    public static <T> T getProperty(@NotNull final Map<String, JsonNode> properties, @NotNull final String name) {
+        JsonNode value = properties.get(name);
+        if( value == null ) {
+            return null;
+        } else if (value instanceof TextNode) {
+            return (T) value.asText();
+        } else if (value instanceof LongNode) {
+            Long valueLong = value.asLong();
+            return (T) valueLong;
+        } else if (value instanceof BooleanNode) {
+            Boolean valueBoolean = value.asBoolean();
+            return (T) valueBoolean;
+        } else if (value instanceof IntNode) {
+            Integer valueInteger = value.asInt();
+            return (T) valueInteger;
+        } else if (value instanceof FloatNode) {
+            return (T) Float.valueOf(value.toString());
+        } else {
+            return (T) value;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/MapUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/MapUtils.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/MapUtils.java
index dd128eb..cbf6d51 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/MapUtils.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/MapUtils.java
@@ -16,24 +16,21 @@
  */
 package org.apache.usergrid.java.client.utils;
 
+import org.jetbrains.annotations.NotNull;
+
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-public class MapUtils {
-
-	public static <T> Map<String, T> newMapWithoutKeys(Map<String, T> map,
-			List<String> keys) {
-		Map<String, T> newMap = null;
-		if (map != null) {
-			newMap = new HashMap<String, T>(map);
-		} else {
-			newMap = new HashMap<String, T>();
-		}
-		for (String key : keys) {
-			newMap.remove(key);
-		}
-		return newMap;
-	}
+@SuppressWarnings("unused")
+public final class MapUtils {
 
+    @NotNull
+    public static <T> Map<String, T> newMapWithoutKeys(@NotNull  final Map<String, T> map, @NotNull final List<String> keys) {
+        Map<String, T> newMap = new HashMap<>();
+        for (String key : keys) {
+            newMap.remove(key);
+        }
+        return newMap;
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/ObjectUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/ObjectUtils.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/ObjectUtils.java
index 465845a..1d05405 100644
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/ObjectUtils.java
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/ObjectUtils.java
@@ -16,21 +16,23 @@
  */
 package org.apache.usergrid.java.client.utils;
 
+import org.jetbrains.annotations.Nullable;
+
 import java.util.Map;
 
-public class ObjectUtils {
+public final class ObjectUtils {
 
-	public static boolean isEmpty(Object s) {
-		if (s == null) {
-			return true;
-		}
-		if ((s instanceof String) && (((String) s).trim().length() == 0)) {
-			return true;
-		}
-		if (s instanceof Map) {
-			return ((Map<?, ?>) s).isEmpty();
-		}
-		return false;
-	}
+    public static boolean isEmpty(@Nullable final Object s) {
+        if (s == null) {
+            return true;
+        }
+        if ((s instanceof String) && (((String) s).trim().length() == 0)) {
+            return true;
+        }
+        if (s instanceof Map) {
+            return ((Map<?, ?>) s).isEmpty();
+        }
+        return false;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UrlUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UrlUtils.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UrlUtils.java
deleted file mode 100644
index bf2a2b3..0000000
--- a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UrlUtils.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.java.client.utils;
-
-import static java.net.URLEncoder.encode;
-import static org.apache.usergrid.java.client.utils.ObjectUtils.isEmpty;
-
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.usergrid.java.client.exception.ClientException;
-
-public class UrlUtils {
-
-
-    public static URL url(String s) {
-        try {
-            return new URL(s);
-        } catch (MalformedURLException e) {
-            throw new ClientException("Incorrect URL format", e);
-        }
-    }
-
-    public static URL url(URL u, String s) {
-        try {
-            return new URL(u, s);
-        } catch (MalformedURLException e) {
-            throw new ClientException("Incorrect URL format", e);
-        }
-    }
-
-    public static String path(Object... segments) {
-        String path = "";
-        boolean first = true;
-        for (Object segment : segments) {
-            if (segment instanceof Object[]) {
-                segment = path((Object[]) segment);
-            }
-            if (!isEmpty(segment)) {
-                if (first) {
-                    path = segment.toString();
-                    first = false;
-                } else {
-                    if (!path.endsWith("/")) {
-                        path += "/";
-                    }
-                    path += segment.toString();
-                }
-            }
-        }
-        return path;
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static String encodeParams(Map<String, Object> params) {
-        if (params == null) {
-            return "";
-        }
-        boolean first = true;
-        StringBuilder results = new StringBuilder();
-        for (Entry<String, Object> entry : params.entrySet()) {
-            if (entry.getValue() instanceof List) {
-                for (Object o : (List) entry.getValue()) {
-                    if (!isEmpty(o)) {
-                        if (!first) {
-                            results.append('&');
-                        }
-                        first = false;
-                        results.append(entry.getKey());
-                        results.append("=");
-                        try {
-                            results.append(encode(o.toString(), "UTF-8"));
-                        } catch (UnsupportedEncodingException e) {
-                            throw new ClientException("Unknown encoding", e);
-                        }
-                    }
-                }
-            } else if (!isEmpty(entry.getValue())) {
-                if (!first) {
-                    results.append('&');
-                }
-                first = false;
-                results.append(entry.getKey());
-                results.append("=");
-                try {
-                    results.append(encode(entry.getValue().toString(), "UTF-8"));
-                } catch (UnsupportedEncodingException e) {
-                    throw new ClientException("Unsupported string encoding", e);
-                }
-            }
-        }
-        return results.toString();
-    }
-
-    public static String addQueryParams(String url, Map<String, Object> params) {
-        if (params == null) {
-            return url;
-        }
-        if (!url.contains("?")) {
-            url += "?";
-        }
-        url += encodeParams(params);
-        return url;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UsergridEntityDeserializer.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UsergridEntityDeserializer.java b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UsergridEntityDeserializer.java
new file mode 100644
index 0000000..5daeace
--- /dev/null
+++ b/sdks/java/src/main/java/org/apache/usergrid/java/client/utils/UsergridEntityDeserializer.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.java.client.utils;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.IOException;
+
+public final class UsergridEntityDeserializer extends JsonDeserializer<UsergridEntity> {
+
+    @NotNull private static final ObjectMapper objectMapper = new ObjectMapper();
+
+    @NotNull
+    public UsergridEntity deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException {
+        UsergridEntity entity = UsergridEntityDeserializer.objectMapper.readValue(jsonParser,UsergridEntity.class);
+        Class<? extends UsergridEntity> entitySubClass = UsergridEntity.customSubclassForType(entity.getType());
+        if( entitySubClass != null ) {
+            entity = JsonUtils.mapper.convertValue(entity,entitySubClass);
+        }
+        return entity;
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthFallBackTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthFallBackTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthFallBackTestCase.java
new file mode 100644
index 0000000..944aaef
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthFallBackTestCase.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.*;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertTrue;
+
+public class ClientAuthFallBackTestCase {
+
+    private static UsergridQuery usersQuery = new UsergridQuery("users").desc("created");
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        Usergrid.authenticateApp(new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET));
+
+        String[] segments = {"roles","guest","permissions"};
+        Map<String, Object> params = new HashMap<>();
+        params.put("permission","get,post,put,delete:/**");
+        UsergridRequest request = new UsergridRequest(UsergridEnums.UsergridHttpMethod.DELETE, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, Usergrid.clientAppUrl(), params, null, Usergrid.authForRequests(), segments);
+        Usergrid.sendRequest(request);
+    }
+
+    @After
+    public void after() {
+        Usergrid.setAuthMode(UsergridEnums.UsergridAuthMode.APP);
+        String[] segments = {"roles","guest","permissions"};
+        Map<String, Object> params = new HashMap<>();
+        params.put("permission","get,post,put,delete:/**");
+        UsergridRequest request = new UsergridRequest(UsergridEnums.UsergridHttpMethod.POST, UsergridRequest.APPLICATION_JSON_MEDIA_TYPE, Usergrid.clientAppUrl(), params, null, Usergrid.authForRequests(), segments);
+        Usergrid.sendRequest(request);
+        Usergrid.reset();
+    }
+
+    @Test
+    public void authFallBackNONETest() {
+        Usergrid.setAuthMode(UsergridEnums.UsergridAuthMode.NONE);
+        UsergridResponse resp = Usergrid.GET(usersQuery);
+        assertTrue("The returned response should have error", resp.getResponseError() != null);
+    }
+
+    @Test
+    public void authFallBackAPPTest() {
+        Usergrid.setAuthMode(UsergridEnums.UsergridAuthMode.APP);
+        UsergridResponse resp = Usergrid.GET(usersQuery);
+        assertTrue("The returned response should not have error", resp.getResponseError() == null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthTestCase.java
new file mode 100644
index 0000000..79e1bbc
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/ClientAuthTestCase.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.UsergridEnums.*;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.auth.UsergridUserAuth;
+import org.apache.usergrid.java.client.model.UsergridUser;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class ClientAuthTestCase {
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL);
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void clientAuth_APP() {
+        Usergrid.setAuthMode(UsergridAuthMode.APP);
+        UsergridAppAuth appAuth = new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET);
+        UsergridResponse response = Usergrid.authenticateApp(appAuth);
+        assertTrue("response status is OK", response.ok());
+        assertNull("no error thrown", response.getResponseError());
+        assertTrue("appAuth.isValidToken should be true", appAuth.isValidToken());
+        assertNotNull("should have a valid token", appAuth.getAccessToken());
+        assertNotNull("should have an expiry", appAuth.getExpiry());
+        assertEquals("client.appAuth.token should be set to the token returned from Usergrid", Usergrid.getAppAuth(), appAuth);
+        assertTrue("should have a token that is not empty", appAuth.getAccessToken().length() > 0);
+        assertTrue("client.appAuth.expiry should be set to a future date", appAuth.getExpiry() > System.currentTimeMillis());
+    }
+
+    @Test
+    public void clientAuth_USER() {
+        Usergrid.setAuthMode(UsergridAuthMode.USER);
+        UsergridUserAuth userAuth = new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password);
+        UsergridResponse response = Usergrid.authenticateUser(userAuth);
+        assertTrue("response status is OK", response.ok());
+        assertNull("no error thrown", response.getResponseError());
+        assertTrue("appAuth.isValidToken should be true", userAuth.isValidToken());
+        assertNotNull("should have a token", userAuth.getAccessToken());
+        assertNotNull("should have an expiry", userAuth.getExpiry());
+
+        UsergridUser currentUser = Usergrid.getCurrentUser();
+        assertNotNull("client.currentUser should not be null", currentUser);
+        assertNotNull("client.currentUser().getUserAuth() should not be null", currentUser.getUserAuth());
+        assertEquals("client.currentUser().userAuth should be the same as userAuth", currentUser.getUserAuth(), userAuth);
+        assertTrue("should have a token that is not empty", userAuth.getAccessToken().length() > 0);
+        assertTrue("client.currentUser().userAuth.getExpiry() should be set to a future date", userAuth.getExpiry() > System.currentTimeMillis());
+        assertEquals("client.authForRequests() should be the same as userAuth", Usergrid.authForRequests(), userAuth);
+    }
+
+    @Test
+    public void clientAuth_NONE() {
+        Usergrid.setAuthMode(UsergridAuthMode.NONE);
+        UsergridUserAuth userAuth = new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password);
+        Usergrid.authenticateUser(userAuth);
+        assertNull("no auth should be returned from client.authForRequests", Usergrid.authForRequests());
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/ClientConnectionsTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/ClientConnectionsTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/ClientConnectionsTestCase.java
new file mode 100644
index 0000000..72b88dd
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/ClientConnectionsTestCase.java
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.UsergridEnums.UsergridDirection;
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class ClientConnectionsTestCase {
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        UsergridAppAuth appAuth = new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET);
+        Usergrid.authenticateApp(appAuth);
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void clientConnect() {
+        String collectionName = "testClientConnection" + System.currentTimeMillis();
+
+        UsergridEntity entityOne = new UsergridEntity(collectionName,"john");
+        entityOne.putProperty("place","San Jose");
+        entityOne.save();
+        assertNotNull(entityOne.getUuid());
+
+        UsergridEntity entityTwo = new UsergridEntity(collectionName,"amici");
+        entityOne.putProperty("place","San Jose");
+        entityTwo.save();
+        assertNotNull(entityTwo.getUuid());
+
+        //should connect entities by passing UsergridEntity objects as parameters
+        Usergrid.connect(entityOne, "likes", entityTwo);
+
+        UsergridEntity responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityOne, "likes").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityTwo.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityTwo.getUuid(),responseEntity.getUuid());
+
+        //should connect entities by passing a source UsergridEntity object and a target uuid.
+        Usergrid.connect(entityOne.getType(), entityOne.getUuid(), "visited", entityTwo.getUuid());
+
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityOne, "visited").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityTwo.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityTwo.getUuid(),responseEntity.getUuid());
+
+        //should connect entities by passing source type, source uuid, and target uuid as parameters
+        Usergrid.connect(entityTwo.getType(), entityTwo.getUuid(), "visitor", entityOne.getUuid());
+
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityTwo, "visitor").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityOne.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityOne.getUuid(),responseEntity.getUuid());
+
+        //should connect entities by passing source type, source name, target type, and target name as parameters
+        assertNotNull(entityOne.getName());
+        assertNotNull(entityTwo.getName());
+        Usergrid.connect(entityTwo.getType(), entityTwo.getName(), "welcomed", entityOne.getType(), entityOne.getName());
+
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityTwo, "welcomed").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityOne.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityOne.getUuid(),responseEntity.getUuid());
+
+        //should connect entities by passing source type, source name, target type, and target name as parameters
+        Usergrid.connect(entityTwo.getType(), entityTwo.getName(), "invalidLink", "invalidName");
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityTwo, "invalidLink").first();
+        assertNull("response entity should be null.", responseEntity);
+    }
+
+    @Test
+    public void clientGetConnect() {
+        String collectionName = "testClientGetConnection" + System.currentTimeMillis();
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entityOne = new UsergridEntity(collectionName, "john");
+        entityOne.putProperty("place","San Jose");
+        entityOne.save();
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entityTwo = new UsergridEntity(collectionName, "amici");
+        entityTwo.putProperty("place","San Jose");
+        entityTwo.save();
+
+        //should connect entities by passing UsergridEntity objects as parameters
+        Usergrid.connect(entityOne, "likes", entityTwo);
+        Usergrid.connect(entityOne, "visited", entityTwo);
+
+        UsergridEntity responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityOne, "likes").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityTwo.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityTwo.getUuid(),responseEntity.getUuid());
+
+        responseEntity = Usergrid.getConnections(UsergridDirection.IN, entityTwo, "visited").first();
+        assertNotNull(responseEntity);
+        assertEquals("both entities name should be same", entityOne.getName(),responseEntity.getName());
+        assertEquals("both entities uuid should be same", entityOne.getUuid(),responseEntity.getUuid());
+
+    }
+
+    @Test
+    public void clientDisConnect() {
+        String collectionName = "testClientGetConnection" + System.currentTimeMillis();
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entityOne = new UsergridEntity(collectionName,"john");
+        entityOne.putProperty("place","San Jose");
+        entityOne.save();
+        assertNotNull(entityOne.getName());
+        assertNotNull(entityOne.getUuid());
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entityTwo = new UsergridEntity(collectionName, "amici");
+        entityTwo.putProperty("place","San Jose");
+        entityTwo.save();
+        assertNotNull(entityTwo.getName());
+        assertNotNull(entityTwo.getUuid());
+
+        //should connect entities by passing UsergridEntity objects as parameters
+        Usergrid.connect(entityOne, "likes", entityTwo);
+        Usergrid.connect(entityOne, "visited", entityTwo);
+        Usergrid.connect(entityOne, "twice", entityTwo);
+        Usergrid.connect(entityOne, "thrice", entityTwo);
+
+        //should disConnect entities by passing UsergridEntity objects as parameters
+        Usergrid.disconnect(entityOne, "likes", entityTwo);
+        UsergridEntity responseEntity = Usergrid.getConnections(UsergridDirection.IN, entityTwo, "likes").first();
+        assertNull("responseEntity should be null", responseEntity);
+
+        //should disConnect entities by passing source type, source uuid, and target uuid as parameters
+        Usergrid.disconnect(entityOne.getType(), entityOne.getUuid(), "visited", entityTwo.getUuid());
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityOne, "visited").first();
+        assertNull("responseEntity should be null", responseEntity);
+
+        //should disConnect entities by passing source type, source name, target type, and target name as parameters
+        Usergrid.disconnect(entityOne.getType(), entityOne.getName(), "twice", entityTwo.getType(), entityTwo.getName());
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityOne, "twice").first();
+        assertNull("responseEntity should be null", responseEntity);
+
+        //should fail to disConnect entities when specifying target name without type
+        Usergrid.disconnect(entityTwo.getType(), entityTwo.getName(), "thrice", entityOne.getName());
+        responseEntity = Usergrid.getConnections(UsergridDirection.OUT, entityTwo, "thrice").first();
+        assertNull("both entities name should be same",responseEntity);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/ClientRestTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/ClientRestTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/ClientRestTestCase.java
new file mode 100644
index 0000000..b01a167
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/ClientRestTestCase.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+
+import static org.junit.Assert.*;
+
+public class ClientRestTestCase {
+
+    final String collectionName = "testClientConnection" + System.currentTimeMillis();
+
+    @Before
+    public void before()  {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        UsergridAppAuth appAuth = new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET);
+        Usergrid.authenticateApp(appAuth);
+        createCollectionAndEntity();
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    public void createCollectionAndEntity()  {
+        UsergridEntity entityOne = new UsergridEntity(collectionName,"john");
+        entityOne.putProperty("place", "San Jose");
+        entityOne.save();
+
+        UsergridEntity entityTwo = new UsergridEntity(collectionName,"amici");
+        entityTwo.putProperty("place", "San Jose");
+        entityTwo.save();
+
+        assertNotNull(entityOne.getUuid());
+        assertNotNull(entityTwo.getUuid());
+
+        Usergrid.connect(entityOne, "likes", entityTwo);
+        Usergrid.connect(entityOne.getType(), entityOne.getUuid(), "visited", entityTwo.getUuid());
+    }
+
+    @Test
+    public void clientGET() {
+        // Retrieve the response.
+        UsergridResponse response = Usergrid.GET(collectionName, "john");
+        assertTrue("response should be ok", response.ok());
+        assertNull("no error thrown", response.getResponseError());
+
+        assertNotNull(response.getEntities());
+        assertTrue("response entities is an Array", response.getEntities().getClass() == ArrayList.class);
+
+        // response.first should exist and have a valid uuid
+        UsergridEntity firstEntity = response.first();
+        assertNotNull(firstEntity);
+        assertNotNull("first entity is not null and has uuid", firstEntity.getUuid());
+
+        // response.entity should exist, equals the first entity, and have a valid uuid
+        UsergridEntity responseEntity = response.entity();
+        assertNotNull(responseEntity);
+        assertEquals(firstEntity, responseEntity);
+        assertNotNull("entity is not null and has uuid", responseEntity.getUuid());
+
+        // response.last should exist and have a valid uuid
+        UsergridEntity lastEntity = response.last();
+        assertNotNull(lastEntity);
+        assertNotNull("last entity is not null and has uuid", lastEntity.getUuid());
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/EntityTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/EntityTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/EntityTestCase.java
new file mode 100644
index 0000000..42c3054
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/EntityTestCase.java
@@ -0,0 +1,676 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.TextNode;
+import org.apache.usergrid.java.client.UsergridEnums.UsergridDirection;
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+public class EntityTestCase {
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        Usergrid.authenticateApp(new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET));
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    @Test
+    public void testEntityCreationSuccess() {
+        String collectionName = "ect" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        HashMap<String,JsonNode> map = new HashMap<>();
+        map.put("name",new TextNode(entityName));
+        map.put("color",new TextNode("red"));
+        map.put("shape",new TextNode("square"));
+
+        UsergridEntity entity = new UsergridEntity(collectionName,null,map);
+        UsergridResponse response = entity.save();
+        assertNull(response.getResponseError());
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The returned entity is null!", eLookUp);
+        assertEquals("entities has the correct type", eLookUp.getType(),collectionName);
+        assertEquals("entities has the correct name", eLookUp.getName(),entityName);
+        assertEquals("entities has the correct color", eLookUp.getStringProperty("color"),"red");
+        assertEquals("entities has the correct shape", eLookUp.getStringProperty("shape"),"square");
+    }
+
+    @Test
+    public void testDuplicateEntityNameFailure() {
+        String collectionName = "testDuplicateEntityNameFailure" + System.currentTimeMillis();
+
+        UsergridEntity entity = new UsergridEntity(collectionName,"test3");
+        UsergridResponse response = Usergrid.POST(entity);
+        assertNull("First entity create should have succeeded.", response.getResponseError());
+
+        response = Usergrid.POST(entity);
+        assertNotNull("Second entity create should not succeed!", response.getResponseError());
+    }
+
+    @Test
+    public void testEntityLookupByName() {
+        String collectionName = "testEntityLookupByName" + System.currentTimeMillis();
+        String entityName = "testEntity4";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        UsergridEntity eLookup = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The returned entity is null!", eLookup);
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+    }
+
+    @Test
+    public void testEntityLookupByUUID() {
+        String collectionName = "testEntityLookupByUUID" + System.currentTimeMillis();
+        String entityName = "testEntity5";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+        assertNotNull(entity.getUuid());
+
+        UsergridEntity eLookup = Usergrid.GET(collectionName, entity.getUuid()).first();
+        assertNotNull("The returned entity is null!", eLookup);
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+    }
+
+    @Test
+    public void testEntityLookupByQuery() {
+        String collectionName = "testEntityLookupByQuery" + System.currentTimeMillis();
+        String entityName = "testEntity6";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.putProperty("color","red");
+        entity.putProperty("shape","square");
+        entity.save();
+
+        SDKTestUtils.indexSleep();
+
+        UsergridQuery query = new UsergridQuery(collectionName).eq("color", "red");
+        UsergridEntity eLookup = Usergrid.GET(query).first();
+
+        assertNotNull("The entity was not returned on lookup", eLookup);
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+
+        query = new UsergridQuery(collectionName).eq("name", entityName);
+        eLookup = Usergrid.GET(query).first();
+
+        assertNotNull("The entity was not returned on lookup", eLookup);
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+
+        query = new UsergridQuery(collectionName).eq("shape", "square");
+        eLookup = Usergrid.GET(query).first();
+
+        assertNotNull("The entity was not returned on lookup", eLookup);
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+
+        query = new UsergridQuery(collectionName).eq("shape", "circle");
+        eLookup = Usergrid.GET(query).first();
+
+        assertNull("The entity was not expected to be returned on lookup", eLookup);
+    }
+
+    @Test
+    public void testEntityUpdate() {
+        String collectionName = "testEntityLookupByUUID" + System.currentTimeMillis();
+        String entityName = "testEntity7";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.putProperty("color","red");
+        entity.putProperty("shape","square");
+        entity.putProperty("orientation","up");
+        entity.save();
+
+        SDKTestUtils.sleep(1000);
+
+        UsergridQuery query = new UsergridQuery(collectionName).eq("orientation", "up");
+        UsergridEntity eLookup = Usergrid.GET(query).first();
+        assertNotNull(eLookup);
+
+        assertEquals("The returned entity does not have the same UUID when querying by field", entity.getUuid(),eLookup.getUuid());
+
+        entity.putProperty("orientation", "down");
+        entity.save();
+        assertNotNull(entity.getUuid());
+
+        eLookup = Usergrid.GET(collectionName, entity.getUuid()).first();
+        assertNotNull(eLookup);
+
+        assertEquals("The returned entity does not have the same UUID", entity.getUuid(),eLookup.getUuid());
+        assertEquals("The field was not updated!", eLookup.getStringProperty("orientation"),"down");
+
+        SDKTestUtils.sleep(1000);
+
+        query = new UsergridQuery(collectionName).eq("orientation", "up");
+        eLookup = Usergrid.GET(query).first();
+
+        assertNull("The entity was returned for old value!", eLookup);
+    }
+
+    @Test
+    public void testEntityDelete() {
+        String collectionName = "testEntityDelete" + System.currentTimeMillis();
+        String entityName = "testEntity8";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.putProperty("color","red");
+        entity.putProperty("shape","square");
+        entity.putProperty("orientation","up");
+        entity.save();
+
+        SDKTestUtils.indexSleep();
+
+        assertNotNull(entity.getUuid());
+        assertNotNull(entity.getName());
+
+        UsergridQuery query = new UsergridQuery(collectionName).eq("orientation", "up");
+        UsergridEntity eLookup = Usergrid.GET(query).first();
+
+        assertNotNull("The returned entity was null!", eLookup);
+        assertEquals("The returned entity does not have the same UUID when querying by field", entity.getUuid(),eLookup.getUuid());
+
+        Usergrid.DELETE(entity);
+
+        eLookup = Usergrid.GET(collectionName, entity.getUuid()).first();
+        assertNull("The entity was not expected to be returned by UUID", eLookup);
+
+        eLookup = Usergrid.GET(collectionName, entity.getName()).first();
+        assertNull("The entity was not expected to be returned by getName", eLookup);
+
+        query = new UsergridQuery(collectionName).eq("color", "red");
+        eLookup = Usergrid.GET(query).first();
+        assertNull("The entity was not expected to be returned", eLookup);
+
+        query = new UsergridQuery(collectionName).eq("shape", "square");
+        eLookup = Usergrid.GET(query).first();
+        assertNull("The entity was not expected to be returned", eLookup);
+
+        query = new UsergridQuery(collectionName).eq("orientation", "up");
+        eLookup = Usergrid.GET(query).first();
+        assertNull("The entity was not expected to be returned", eLookup);
+    }
+
+    @Test
+    public void testEntityPutPropertyAndSave() {
+        String collectionName = "testEntityPutProperty" + System.currentTimeMillis();
+        String entityName = "testEntity9";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.putProperty("color","red");
+        entity.putProperty("shape","square");
+        entity.putProperty("orientation","up");
+        entity.putProperty("sides", 4);
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+
+        //Check if the property was added correctly
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertEquals("The entity putProperty() was successful ", eLookUp.getStringProperty("orientation"),"up");
+        assertEquals("The entity putProperty() was successful ", eLookUp.getIntegerProperty("sides"), new Integer(4));
+
+        //Overwrite the property if it exists.
+        entity.putProperty("orientation", "horizontal");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The returned entity was null!", eLookUp);
+        assertEquals("The entity putProperty() was successful ", eLookUp.getStringProperty("orientation"),"horizontal");
+
+        //should not be able to set the name key (name is immutable)
+        entity.putProperty("name","entityNew");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The returned entity was null!", eLookUp);
+        assertEquals("The entity putProperty() was successful ", eLookUp.getName(),"testEntity9");
+    }
+
+    @Test
+    public void testEntityPutProperties() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity9";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.putProperty("color","black");
+        entity.putProperty("orientation","up");
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertEquals("The entity putProperty() was successful ", eLookUp.getStringProperty("orientation"),"up");
+        assertEquals("overwrite existing property", eLookUp.getStringProperty("color"),"black");
+    }
+
+    @Test
+    public void testEntityRemovePropertiesAndSave() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+
+        String entityName = "testEntity9";
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entity = SDKTestUtils.createEntity(collectionName, entityName, fields);
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("shape", "square");
+        properties.put("orientation", "up");
+        properties.put("color", "black");
+        entity.putProperties(properties);
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, "testEntity9").first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        String[] removeProperties = {"shape", "color"};
+        entity.removeProperties(Arrays.asList(removeProperties));
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, "testEntity9").first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertTrue("overwrite existing property", eLookUp.getStringProperty("color") == null);
+        assertTrue("overwrite existing property", eLookUp.getStringProperty("shape") == null);
+
+    }
+
+    @Test
+    public void testEntityRemoveProperty() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+
+        Map<String, String> fields = new HashMap<>(3);
+        fields.put("color", "red");
+
+        String entityName = "testEntity11";
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entity = SDKTestUtils.createEntity(collectionName, entityName, fields);
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("shape", "square");
+        properties.put("orientation", "up");
+        properties.put("color", "black");
+        entity.putProperties(properties);
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, "testEntity11").first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        entity.removeProperty("color");
+        entity.removeProperty("shape");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, "testEntity11").first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertTrue("overwrite existing property", eLookUp.getStringProperty("color") == null);
+        assertTrue("overwrite existing property", eLookUp.getStringProperty("shape") == null);
+
+    }
+
+    @Test
+    public void testEntityAppendInArray() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        ArrayList<Object> lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        lenArr.add(4);
+        entity.insert("lenArray", lenArr);
+        entity.save();
+
+        lenArr = new ArrayList<>();
+        lenArr.add(6);
+        lenArr.add(7);
+        entity.append("lenArray", lenArr);
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        ArrayNode toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(1).add(2).add(3).add(4).add(6).add(7);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+    }
+
+    @Test
+    public void testEntityPrependInArray() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        ArrayList<Object> lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        lenArr.add(4);
+        entity.putProperty("lenArray", lenArr);
+        entity.save();
+
+        lenArr = new ArrayList<>();
+        lenArr.add(6);
+        lenArr.add(7);
+
+        entity.insert("lenArray", lenArr, 0);
+        entity.save();
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        ArrayNode toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(6).add(7).add(1).add(2).add(3).add(4);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+    }
+
+    @Test
+    public void testEntityPopInArray() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        ArrayList<Object> lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        entity.putProperty("lenArray", lenArr);
+        entity.save();
+
+        // should remove the last value of an existing array
+        entity.pop("lenArray");
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        ArrayNode toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(1).add(2);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+
+        // value should remain unchanged if it is not an array
+        entity.putProperty("foo", "test1");
+        entity.save();
+
+        entity.pop("foo");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertEquals("foo should equal test1.", eLookUp.getStringProperty("foo"), "test1");
+
+        //should gracefully handle empty arrays
+        ArrayList<Object> lenArr2 = new ArrayList<>();
+        entity.putProperty("foo", lenArr2);
+        entity.save();
+        entity.pop("foo");
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("foo"),toCompare);
+    }
+
+    @Test
+    public void testEntityShiftInArray() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        //should remove the last value of an existing array
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        ArrayList<Object> lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        entity.putProperty("lenArray", lenArr);
+        entity.save();
+
+        entity.shift("lenArray");
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        ArrayNode toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(2).add(3);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+
+        //value should remain unchanged if it is not an array
+        entity.putProperty("foo", "test1");
+        entity.shift("foo");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertEquals("The entity returned is not null.", eLookUp.getStringProperty("foo"), "test1");
+
+        //should gracefully handle empty arrays
+        ArrayList<Object> lenArr2 = new ArrayList<>();
+        entity.putProperty("foo", lenArr2);
+        entity.shift("foo");
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("foo"), new ArrayNode(JsonNodeFactory.instance));
+    }
+
+    @Test
+    public void testEntityInsertInArray() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityName = "testEntity1";
+
+        //should set properties for a given object, overwriting properties that exist and creating those that don\'t
+        UsergridEntity entity = new UsergridEntity(collectionName,entityName);
+        entity.save();
+
+        ArrayList<Object> lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        lenArr.add(4);
+        entity.putProperty("lenArray", lenArr);
+        entity.save();
+
+        ArrayList<Object> lenArr2 = new ArrayList<>();
+        lenArr2.add(6);
+        lenArr2.add(7);
+
+        entity.insert("lenArray", lenArr2, 6);
+        entity.save();
+
+        UsergridEntity eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        ArrayNode toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(1).add(2).add(3).add(4).add(6).add(7);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+
+        //should merge an array of values into an existing array at the specified index
+        lenArr = new ArrayList<>();
+        lenArr.add(1);
+        lenArr.add(2);
+        lenArr.add(3);
+        lenArr.add(4);
+
+        entity.putProperty("lenArray", lenArr);
+        entity.save();
+
+        lenArr2 = new ArrayList<>();
+        lenArr2.add(5);
+        lenArr2.add(6);
+        lenArr2.add(7);
+        lenArr2.add(8);
+
+        entity.insert("lenArray", lenArr2, 2);
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add(1).add(2).add(5).add(6).add(7).add(8).add(3).add(4);
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("lenArray"),toCompare);
+
+        //should convert an existing value into an array when inserting a second value
+        entity.putProperty("foo", "test");
+        entity.insert("foo", "test1", 1);
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add("test").add("test1");
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("foo"),toCompare);
+
+        //should create a new array when a property does not exist
+        entity.insert("foo1", "test2", 1);
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add("test2");
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("foo1"),toCompare);
+
+        //should gracefully handle index out of positive range
+        entity.putProperty("ArrayIndex", "test1");
+        entity.insert("ArrayIndex", "test2", 1000);
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add("test1").add("test2");
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("ArrayIndex"),toCompare);
+
+        //should gracefully handle index out of negative range
+        entity.insert("ArrayIndex", "test3", -1000);
+        entity.save();
+
+        eLookUp = Usergrid.GET(collectionName, entityName).first();
+        assertNotNull("The entity returned is not null.", eLookUp);
+
+        toCompare = new ArrayNode(JsonNodeFactory.instance);
+        toCompare.add("test3").add("test1").add("test2");
+        assertEquals("The two arrays should be equal.", eLookUp.getJsonNodeProperty("ArrayIndex"),toCompare);
+    }
+
+    @Test
+    public void testEntityConnectDisconnectGetConnections() {
+        String collectionName = "testEntityProperties" + System.currentTimeMillis();
+        String entityOneName = "testEntity1";
+        String entityTwoName = "testEntity2";
+
+        UsergridEntity entityOne = new UsergridEntity(collectionName,entityOneName);
+        entityOne.putProperty("color","red");
+        entityOne.putProperty("shape","square");
+        entityOne.save();
+
+        UsergridEntity entityTwo = new UsergridEntity(collectionName,entityTwoName);
+        entityTwo.putProperty("color","green");
+        entityTwo.putProperty("shape","circle");
+        entityTwo.save();
+
+        assertNotNull(entityOne.getUuid());
+        assertNotNull(entityTwo.getUuid());
+        assertNotNull(entityOne.getName());
+        assertNotNull(entityTwo.getName());
+        assertNotNull(entityOne.uuidOrName());
+        assertNotNull(entityTwo.uuidOrName());
+
+        //should connect entities by passing a target UsergridEntity object as a parameter
+        entityOne.connect("likes", entityTwo);
+        entityOne.save();
+
+        UsergridEntity eLookUpConnectedEntity = entityOne.getConnections(UsergridDirection.OUT, "likes").first();
+        assertNotNull("The connected entity returned is not null.", eLookUpConnectedEntity);
+
+        assertEquals("The entity name should be equals.", eLookUpConnectedEntity.getName(),entityTwoName);
+
+        eLookUpConnectedEntity = entityTwo.getConnections(UsergridDirection.IN, "likes").first();
+        assertNotNull("The connected entity returned is not null.", eLookUpConnectedEntity);
+        assertEquals("The entity name should be equals.", eLookUpConnectedEntity.getName(),entityOneName);
+
+        entityOne.disconnect("likes", entityTwo);
+        entityOne.save();
+
+        eLookUpConnectedEntity = entityTwo.getConnections(UsergridDirection.IN, "likes").first();
+        assertNull("The entity returned is not null.", eLookUpConnectedEntity);
+
+        //should connect entities by passing target uuid as a parameter
+        Usergrid.connect(entityOne.getType(),entityOne.getUuid(),"visited",entityTwo.getUuid());
+        entityOne.save();
+
+        eLookUpConnectedEntity = entityOne.getConnections(UsergridDirection.OUT, "visited").first();
+        assertNotNull("The connected entity returned is not null.", eLookUpConnectedEntity);
+        assertEquals("The entity name should be equals.", eLookUpConnectedEntity.getName(),entityTwoName);
+
+        Usergrid.disconnect(entityOne.getType(),entityOne.getUuid(),"visited",entityTwo.getUuid());
+        entityOne.save();
+
+        eLookUpConnectedEntity = entityOne.getConnections(UsergridDirection.OUT, "visited").first();
+        assertNull("The entity returned is not null.", eLookUpConnectedEntity);
+
+        //should connect entities by passing target type and name as parameters
+        Usergrid.connect(entityOne.getType(),entityOne.getUuid(),"revisit",entityTwo.getType(),entityTwo.getName());
+        entityOne.save();
+
+        eLookUpConnectedEntity = entityOne.getConnections(UsergridDirection.OUT, "revisit").first();
+        assertNotNull("The connected entity returned is not null.", eLookUpConnectedEntity);
+        assertEquals("The entity name should be equals.", eLookUpConnectedEntity.getName(),entityTwoName);
+
+        Usergrid.disconnect(entityOne.getType(),entityOne.getUuid(),"revisit",entityTwo.getType(),entityTwo.getName());
+        entityOne.save();
+
+        eLookUpConnectedEntity = entityOne.getConnections(UsergridDirection.OUT, "revisit").first();
+        assertNull("The entity returned is not null.", eLookUpConnectedEntity);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/QueryTestCase.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/QueryTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/QueryTestCase.java
new file mode 100644
index 0000000..f013134
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/QueryTestCase.java
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.DoubleNode;
+import org.apache.usergrid.java.client.Usergrid;
+import org.apache.usergrid.java.client.auth.UsergridAppAuth;
+import org.apache.usergrid.java.client.model.UsergridEntity;
+import org.apache.usergrid.java.client.query.UsergridQuery;
+import org.apache.usergrid.java.client.response.UsergridResponse;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+public class QueryTestCase {
+
+    public static final String COLLECTION = "shapes";
+
+    public static float distFrom(float lat1, float lng1, float lat2, float lng2) {
+        double earthRadius = 6371000; //meters
+        double dLat = Math.toRadians(lat2 - lat1);
+        double dLng = Math.toRadians(lng2 - lng1);
+        double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(dLng / 2) * Math.sin(dLng / 2);
+        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
+        return (float) (earthRadius * c);
+    }
+
+    @Before
+    public void before() {
+        Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack);
+        Usergrid.authenticateApp(new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET));
+    }
+
+    @After
+    public void after() {
+        Usergrid.reset();
+    }
+
+    /**
+     * Test a basic set of queries where there is inclusion and exclusion based on
+     * two fields
+     */
+    @Test
+    public void testBasicQuery() {
+
+        UsergridQuery qDelete = new UsergridQuery(COLLECTION);
+        Usergrid.DELETE(qDelete);
+
+        Map<String, UsergridEntity> entityMapByUUID = SDKTestUtils.createColorShapes(COLLECTION);
+        Map<String, UsergridEntity> entityMapByName = new HashMap<>(entityMapByUUID.size());
+
+        for (Map.Entry<String, UsergridEntity> uuidEntity : entityMapByUUID.entrySet()) {
+            entityMapByName.put(uuidEntity.getValue().getName(), uuidEntity.getValue());
+        }
+
+        SDKTestUtils.indexSleep();
+
+        Map<String, String> fields = new HashMap<>(7);
+        fields.put("red", "square");
+        fields.put("blue", "circle");
+        fields.put("yellow", "triangle");
+
+        for (Map.Entry<String, String> entry : fields.entrySet()) {
+            UsergridEntity targetEntity = entityMapByName.get(entry.getKey() + entry.getValue());
+
+            UsergridResponse response = Usergrid.GET(new UsergridQuery(COLLECTION).eq("color", entry.getKey()));
+            assertNotNull("entities returned should not be null.", response.getEntities());
+            assertTrue("query for " + entry.getKey() + " shape should return 1, not: " + response.getEntities().size(), response.getEntities().size() == 1);
+
+            UsergridEntity responseEntity = response.first();
+            assertNotNull("first entity should not be null.", responseEntity);
+            assertEquals("query for " + entry.getKey() + " shape should the right UUID", responseEntity.getUuid(),targetEntity.getUuid());
+        }
+        Usergrid.DELETE(qDelete);
+    }
+
+    /**
+     * Test that geolocation is working as expected with different ranges and radius
+     * also test that results are sorted ascending by distance from the specified point
+     */
+    @Test
+    public void testGeoQuery() {
+
+        String collectionName = "sdkTestLocation";
+
+        UsergridQuery deleteQuery = new UsergridQuery(collectionName);
+        Usergrid.DELETE(deleteQuery);
+
+        ArrayList<UsergridEntity> entities = new ArrayList<>();
+        UsergridEntity apigeeOffice = new UsergridEntity(collectionName,"Apigee Office");
+        apigeeOffice.setLocation(37.334115, -121.894340);
+        entities.add(apigeeOffice);
+
+        UsergridEntity amicis = new UsergridEntity(collectionName,"Amicis");
+        amicis.setLocation(37.335616, -121.894168);
+        entities.add(amicis);
+
+        UsergridEntity sanPedroMarket = new UsergridEntity(collectionName,"SanPedroMarket");
+        sanPedroMarket.setLocation(37.336499, -121.894356);
+        entities.add(sanPedroMarket);
+
+        UsergridEntity saintJamesPark = new UsergridEntity(collectionName,"saintJamesPark");
+        saintJamesPark.setLocation(37.339079, -121.891422);
+        entities.add(saintJamesPark);
+
+        UsergridEntity sanJoseNews = new UsergridEntity(collectionName,"sanJoseNews");
+        sanJoseNews.setLocation(37.337812, -121.890784);
+        entities.add(sanJoseNews);
+
+        UsergridEntity deAnza = new UsergridEntity(collectionName,"deAnza");
+        deAnza.setLocation(37.334370, -121.895081);
+        entities.add(deAnza);
+
+        Usergrid.POST(entities);
+
+        SDKTestUtils.indexSleep();
+
+        float centerLat = 37.334110f;
+        float centerLon = -121.894340f;
+
+        // Test a large distance
+        UsergridResponse queryResponse = Usergrid.GET(new UsergridQuery(collectionName).locationWithin(611.00000, centerLat, centerLon));
+        assertNotNull(queryResponse.getEntities());
+
+        float lastDistanceFrom = 0;
+        for (UsergridEntity entity : queryResponse.getEntities()) {
+
+            JsonNode locationNode = entity.getEntityProperty("location");
+            assertNotNull("location node should not be null", locationNode);
+
+            DoubleNode lat = (DoubleNode) locationNode.get("latitude");
+            DoubleNode lon = (DoubleNode) locationNode.get("longitude");
+
+            float distanceFrom = distFrom(centerLat, centerLon, lat.floatValue(), lon.floatValue());
+            System.out.println("Entity " + entity.getName() + " is " + distanceFrom + " away");
+
+            assertTrue("Entity " + entity.getName() + " was included but is not within specified distance (" + distanceFrom + ")", distanceFrom <= 611.0);
+
+            if (lastDistanceFrom != 0) {
+                assertTrue("GEO results are not sorted by distance ascending: expected " + lastDistanceFrom + " <= " + distanceFrom, lastDistanceFrom <= distanceFrom);
+            }
+
+            lastDistanceFrom = distanceFrom;
+        }
+
+        // Test a small distance
+        queryResponse = Usergrid.GET(new UsergridQuery(collectionName).locationWithin(150, centerLat, centerLon));
+        assertNotNull(queryResponse.getEntities());
+
+        lastDistanceFrom = 0;
+        for (UsergridEntity entity : queryResponse.getEntities()) {
+
+            JsonNode locationNode = entity.getEntityProperty("location");
+            assertNotNull("location node should not be null", locationNode);
+
+            DoubleNode lat = (DoubleNode) locationNode.get("latitude");
+            DoubleNode lon = (DoubleNode) locationNode.get("longitude");
+
+            float distanceFrom = distFrom(centerLat, centerLon, lat.floatValue(), lon.floatValue());
+            System.out.println("Entity " + entity.getName() + " is " + distanceFrom + " away");
+
+            assertTrue("Entity " + entity.getName() + " was included but is not within specified distance (" + distanceFrom + ")", distanceFrom <= 150);
+
+            if (lastDistanceFrom != 0) {
+                assertTrue("GEO results are not sorted by distance ascending: expected " + lastDistanceFrom + " <= " + distanceFrom, lastDistanceFrom <= distanceFrom);
+            }
+
+            lastDistanceFrom = distanceFrom;
+        }
+
+        Usergrid.DELETE(deleteQuery);
+    }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e127e62/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
new file mode 100644
index 0000000..8663326
--- /dev/null
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.client;
+
+import org.apache.usergrid.java.client.UsergridEnums.UsergridAuthMode;
+
+public class SDKTestConfiguration {
+    public static final String APP_CLIENT_ID = "b3U6THNcevskEeOQZLcUROUUVA"; //"YXA6_j0WsfFCEeWKoy6txsCOfA" ;
+    public static final String APP_CLIENT_SECRET = "b3U6RZHYznP28xieBzQPackFPmmnevU"; //"YXA6jg8x4wjq1AAyQBKtn4bRd1l0gJ8"; //
+
+    public static final String APP_UserName = "rwalsh"; //"test";// //"b3U66ne33W4OEeWXmAIj6QFb-Q";
+    public static final String APP_Password = "Apigee123"; //"test";//"b3U6PxbpQiTrXKCWu0n1CjK1uTZXuG4";
+    public static final String USERGRID_URL = "https://api.usergrid.com/";
+    public static final String ORG_NAME = "rwalsh";
+    public static final String APP_NAME = "sandbox";
+
+    public static UsergridAuthMode authFallBack = UsergridAuthMode.APP;
+
+//  public static final String APP_CLIENT_ID = "YXA61n2kpFffEeWs9QLknKqhHw";
+//  public static final String APP_CLIENT_SECRET = "YXA69_aRW1IHLgMTUUYSitsGwOLY8uQ";
+//  public static final String USERGRID_URL = "https://fhirsandbox-prod.apigee.net/appservices";
+//  public static final String ORG_NAME = "usergrid";
+//  public static final String APP_NAME = "sandbox";
+}


[54/54] [abbrv] usergrid git commit: Merge remote-tracking branch 'origin/master' into apm

Posted by mr...@apache.org.
Merge remote-tracking branch 'origin/master' into apm


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

Branch: refs/heads/apm
Commit: 28cad0117254552c786717a52fe4921aef6e6ad1
Parents: 1684a64 9250a81
Author: Michael Russo <mr...@apigee.com>
Authored: Thu Jun 2 10:06:40 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Thu Jun 2 10:06:40 2016 -0700

----------------------------------------------------------------------
 UsergridSDK.podspec                             |   18 +
 content/community/index.html                    |    3 +-
 content/docs/README.html                        |    8 +-
 .../file-storage-configuration.html             |    8 +-
 content/docs/assets-and-files/folders.html      |    8 +-
 .../assets-and-files/legacy-asset-support.html  |    8 +-
 .../assets-and-files/retrieving-assets.html     |    8 +-
 .../docs/assets-and-files/uploading-assets.html |    8 +-
 .../creating-and-incrementing-counters.html     |    8 +-
 .../events-and-counters.html                    |    8 +-
 .../retrieving-counters.html                    |    8 +-
 .../docs/data-queries/advanced-query-usage.html |    8 +-
 .../docs/data-queries/operators-and-types.html  |    8 +-
 content/docs/data-queries/query-parameters.html |    8 +-
 .../docs/data-queries/querying-your-data.html   |    8 +-
 content/docs/data-storage/collections.html      |    8 +-
 content/docs/data-storage/data-store-dbms.html  |    8 +-
 content/docs/data-storage/entities.html         |    8 +-
 .../docs/data-storage/optimizing-access.html    |    8 +-
 .../entity-connections/connecting-entities.html |    8 +-
 .../disconnecting-entities.html                 |    8 +-
 .../entity-connections/retrieving-entities.html |    8 +-
 content/docs/genindex.html                      |    8 +-
 content/docs/geolocation/geolocation.html       |    8 +-
 content/docs/index.html                         |    8 +-
 content/docs/installation/deployment-guide.html |    8 +-
 .../docs/installation/ug1-deploy-to-tomcat.html |    8 +-
 .../installation/ug1-launcher-quick-start.html  |    8 +-
 .../docs/installation/ug2-deploy-to-tomcat.html |    8 +-
 content/docs/introduction/async-vs-sync.html    |    8 +-
 content/docs/introduction/data-model.html       |    8 +-
 content/docs/introduction/overview.html         |    8 +-
 .../docs/introduction/usergrid-features.html    |    8 +-
 content/docs/jersey2skeleton/README.html        |    8 +-
 content/docs/objects.inv                        |  Bin 686 -> 686 bytes
 content/docs/orgs-and-apps/admin-user.html      |    8 +-
 content/docs/orgs-and-apps/application.html     |    8 +-
 content/docs/orgs-and-apps/managing.html        |    8 +-
 content/docs/orgs-and-apps/organization.html    |    8 +-
 .../push-notifications/adding-push-support.html |    8 +-
 .../creating-and-managing-notifications.html    |    8 +-
 .../push-notifications/creating-notifiers.html  |    8 +-
 .../push-notifications/getting-started.html     |    8 +-
 .../managing-users-and-devices.html             |    8 +-
 content/docs/push-notifications/overview.html   |    8 +-
 .../docs/push-notifications/registering.html    |    8 +-
 content/docs/push-notifications/tbd.html        |    8 +-
 .../push-notifications/troubleshooting.html     |    8 +-
 content/docs/push-notifications/tutorial.html   |    8 +-
 .../docs/push-notifications/users-devices.html  |    8 +-
 content/docs/reference/contribute-code.html     |    8 +-
 content/docs/reference/presos-and-videos.html   |    8 +-
 content/docs/rest-endpoints/api-docs.html       |    8 +-
 content/docs/sdks/ios-new.html                  |    8 +-
 content/docs/sdks/sdk-outline.html              |    8 +-
 content/docs/sdks/tbd.html                      |    8 +-
 content/docs/search.html                        |    8 +-
 .../docs/security-and-auth/app-security.html    |    8 +-
 .../authenticating-api-requests.html            |    8 +-
 ...nticating-users-and-application-clients.html |    8 +-
 .../changing-token-time-live-ttl.html           |    8 +-
 .../docs/security-and-auth/facebook-sign.html   |    8 +-
 .../revoking-tokens-logout.html                 |    8 +-
 .../security-and-auth/securing-your-app.html    |    8 +-
 .../user-authentication-types.html              |    8 +-
 .../security-and-auth/using-permissions.html    |    8 +-
 content/docs/security-and-auth/using-roles.html |    8 +-
 content/docs/user-management/activity.html      |    8 +-
 content/docs/user-management/group.html         |    8 +-
 content/docs/user-management/groups.html        |    8 +-
 .../docs/user-management/messagee-example.html  |    8 +-
 .../docs/user-management/user-connections.html  |    8 +-
 .../docs/user-management/user-management.html   |    8 +-
 .../docs/user-management/working-user-data.html |    8 +-
 .../creating-a-new-application.html             |    8 +-
 .../docs/using-usergrid/creating-account.html   |    8 +-
 .../using-usergrid/using-a-sandbox-app.html     |    8 +-
 content/docs/using-usergrid/using-the-api.html  |    8 +-
 content/index.html                              |    3 +-
 content/releases/index.html                     |    3 +-
 docs/conf.py                                    |    4 +-
 sdks/java/README.md                             |  598 +++++-
 sdks/java/pom.xml                               |   73 +-
 .../org/apache/usergrid/java/client/Client.java | 1292 -------------
 .../apache/usergrid/java/client/Usergrid.java   |  285 +++
 .../usergrid/java/client/UsergridClient.java    |  427 +++++
 .../java/client/UsergridClientConfig.java       |   60 +
 .../usergrid/java/client/UsergridEnums.java     |  170 ++
 .../usergrid/java/client/UsergridRequest.java   |  205 +++
 .../java/client/UsergridRequestManager.java     |   86 +
 .../java/client/auth/UsergridAppAuth.java       |   55 +
 .../usergrid/java/client/auth/UsergridAuth.java |   75 +
 .../java/client/auth/UsergridUserAuth.java      |   56 +
 .../usergrid/java/client/entities/Activity.java |  625 -------
 .../usergrid/java/client/entities/Device.java   |   68 -
 .../usergrid/java/client/entities/Entity.java   |  191 --
 .../usergrid/java/client/entities/Group.java    |   79 -
 .../usergrid/java/client/entities/Message.java  |  148 --
 .../usergrid/java/client/entities/User.java     |  158 --
 .../java/client/exception/ClientException.java  |   41 -
 .../client/exception/UsergridException.java     |   50 +
 .../java/client/model/UsergridDevice.java       |   60 +
 .../java/client/model/UsergridEntity.java       |  487 +++++
 .../java/client/model/UsergridUser.java         |  198 ++
 .../java/client/query/UsergridQuery.java        |  434 +++++
 .../java/client/response/AggregateCounter.java  |   52 -
 .../client/response/AggregateCounterSet.java    |  111 --
 .../java/client/response/ApiResponse.java       |  421 -----
 .../client/response/ClientCredentialsInfo.java  |   58 -
 .../java/client/response/QueueInfo.java         |   44 -
 .../java/client/response/UsergridResponse.java  |  230 +++
 .../client/response/UsergridResponseError.java  |   98 +
 .../usergrid/java/client/utils/JsonUtils.java   |  262 ++-
 .../usergrid/java/client/utils/MapUtils.java    |   27 +-
 .../usergrid/java/client/utils/ObjectUtils.java |   28 +-
 .../usergrid/java/client/utils/UrlUtils.java    |  124 --
 .../utils/UsergridEntityDeserializer.java       |   41 +
 .../client/ClientAuthFallBackTestCase.java      |   72 +
 .../usergrid/client/ClientAuthTestCase.java     |   85 +
 .../client/ClientConnectionsTestCase.java       |  171 ++
 .../usergrid/client/ClientRestTestCase.java     |   90 +
 .../apache/usergrid/client/EntityTestCase.java  |  676 +++++++
 .../apache/usergrid/client/QueryTestCase.java   |  194 ++
 .../usergrid/client/SDKTestConfiguration.java   |   38 +
 .../apache/usergrid/client/SDKTestUtils.java    |  108 ++
 .../client/UsergridClientAuthTestCase.java      |   73 +
 .../usergrid/client/UsergridInitTestCase.java   |   48 +
 .../client/UsergridResponseErrorTestCase.java   |   62 +
 .../client/UsergridResponseTestCase.java        |   85 +
 .../usergrid/client/UsergridTestCase.java       |   30 +
 sdks/java/usergrid-java-client-2.1.0.jar        |  Bin 0 -> 1992232 bytes
 sdks/swift/README.md                            |    2 +-
 .../Source/Base.lproj/Main.storyboard           |   26 +-
 .../ActivityFeed/Source/FormTextField.swift     |    2 +-
 .../Source/MessageViewController.swift          |   26 +-
 .../Samples/Push/Source/UsergridManager.swift   |    2 +-
 sdks/swift/Source/Usergrid.swift                |   32 +-
 sdks/swift/Source/UsergridAsset.swift           |   18 +-
 sdks/swift/Source/UsergridAuth.swift            |    6 +-
 sdks/swift/Source/UsergridClient.swift          |   89 +-
 sdks/swift/Source/UsergridClientConfig.swift    |   14 +-
 sdks/swift/Source/UsergridDevice.swift          |   41 +-
 sdks/swift/Source/UsergridEntity.swift          |  104 +-
 sdks/swift/Source/UsergridEnums.swift           |   22 +-
 sdks/swift/Source/UsergridExtensions.swift      |   82 +-
 sdks/swift/Source/UsergridFileMetaData.swift    |    4 +-
 sdks/swift/Source/UsergridQuery.swift           |    3 +-
 sdks/swift/Source/UsergridRequest.swift         |    2 +-
 sdks/swift/Source/UsergridRequestManager.swift  |   72 +-
 sdks/swift/Source/UsergridResponse.swift        |    6 +-
 sdks/swift/Source/UsergridUser.swift            |   62 +-
 sdks/swift/Tests/ASSET_Tests.swift              |  218 ++-
 sdks/swift/Tests/AUTH_Tests.swift               |   92 +-
 sdks/swift/Tests/CONNECTION_Tests.swift         |   42 +-
 sdks/swift/Tests/ClientCreationTests.swift      |   44 +-
 sdks/swift/Tests/GET_Tests.swift                |   38 +-
 sdks/swift/Tests/PUT_Tests.swift                |   38 +-
 sdks/swift/Tests/TestAssets/UsergridGuy.jpg     |  Bin 0 -> 12981 bytes
 sdks/swift/Tests/User_Tests.swift               |  310 +++-
 sdks/swift/UsergridSDK.podspec                  |   18 -
 .../swift/UsergridSDK.xcodeproj/project.pbxproj |    4 +-
 sdks/swift/docs/Classes.html                    |   16 +-
 sdks/swift/docs/Classes/Usergrid.html           |  290 ++-
 sdks/swift/docs/Classes/UsergridAppAuth.html    |   30 +-
 sdks/swift/docs/Classes/UsergridAsset.html      |   44 +-
 .../Classes/UsergridAssetUploadRequest.html     |   20 +-
 sdks/swift/docs/Classes/UsergridAuth.html       |   34 +-
 sdks/swift/docs/Classes/UsergridClient.html     |  275 ++-
 .../docs/Classes/UsergridClientConfig.html      |   54 +-
 sdks/swift/docs/Classes/UsergridDevice.html     |  205 ++-
 sdks/swift/docs/Classes/UsergridEntity.html     |  215 ++-
 .../docs/Classes/UsergridFileMetaData.html      |   30 +-
 sdks/swift/docs/Classes/UsergridQuery.html      |  156 +-
 sdks/swift/docs/Classes/UsergridRequest.html    |   36 +-
 sdks/swift/docs/Classes/UsergridResponse.html   |   42 +-
 .../docs/Classes/UsergridResponseError.html     |   24 +-
 sdks/swift/docs/Classes/UsergridUser.html       |  231 ++-
 sdks/swift/docs/Classes/UsergridUserAuth.html   |   30 +-
 sdks/swift/docs/Enums.html                      |   28 +-
 sdks/swift/docs/Enums/UsergridAuthMode.html     |  283 +++
 .../docs/Enums/UsergridDeviceProperties.html    |   20 +-
 sdks/swift/docs/Enums/UsergridDirection.html    |   16 +-
 .../docs/Enums/UsergridEntityProperties.html    |   24 +-
 sdks/swift/docs/Enums/UsergridHttpMethod.html   |   16 +-
 .../docs/Enums/UsergridImageContentType.html    |   16 +-
 .../swift/docs/Enums/UsergridQueryOperator.html |   20 +-
 .../docs/Enums/UsergridQuerySortOrder.html      |   20 +-
 .../docs/Enums/UsergridUserProperties.html      |   20 +-
 sdks/swift/docs/Extensions.html                 |   72 +-
 sdks/swift/docs/Extensions/NSDate.html          |  448 +++++
 sdks/swift/docs/Global Variables.html           |   18 +-
 sdks/swift/docs/Typealiases.html                |   36 +-
 .../Contents/Resources/Documents/Classes.html   |  209 ++-
 .../Resources/Documents/Classes/Usergrid.html   | 1086 ++++++++---
 .../Documents/Classes/UsergridAppAuth.html      |  183 +-
 .../Documents/Classes/UsergridAsset.html        |  265 ++-
 .../Classes/UsergridAssetUploadRequest.html     |  356 ++++
 .../Documents/Classes/UsergridAuth.html         |  274 ++-
 .../Documents/Classes/UsergridClient.html       | 1310 +++++++++----
 .../Documents/Classes/UsergridClientConfig.html |  345 +++-
 .../Documents/Classes/UsergridDevice.html       |  519 +++++-
 .../Documents/Classes/UsergridEntity.html       |  809 +++++---
 .../Documents/Classes/UsergridFileMetaData.html |  217 ++-
 .../Documents/Classes/UsergridQuery.html        |  540 ++++--
 .../Documents/Classes/UsergridRequest.html      |  619 +++++++
 .../Documents/Classes/UsergridResponse.html     |  309 ++--
 .../Classes/UsergridResponseError.html          |  473 +++++
 .../Documents/Classes/UsergridUser.html         | 1734 ++++++++++++++++--
 .../Documents/Classes/UsergridUserAuth.html     |  169 +-
 .../Contents/Resources/Documents/Enums.html     |  115 +-
 .../Documents/Enums/UsergridAuthFallback.html   |   53 +-
 .../Documents/Enums/UsergridAuthMode.html       |  283 +++
 .../Enums/UsergridDeviceProperties.html         |   83 +-
 .../Documents/Enums/UsergridDirection.html      |   71 +-
 .../Enums/UsergridEntityProperties.html         |  101 +-
 .../Documents/Enums/UsergridHttpMethod.html     |  341 ++++
 .../Enums/UsergridImageContentType.html         |   73 +-
 .../Documents/Enums/UsergridQueryOperator.html  |   89 +-
 .../Documents/Enums/UsergridQuerySortOrder.html |   83 +-
 .../Documents/Enums/UsergridUserProperties.html |   95 +-
 .../Resources/Documents/Extensions.html         |   72 +-
 .../Resources/Documents/Extensions/NSDate.html  |  448 +++++
 .../Resources/Documents/Global Variables.html   |  210 +++
 .../Resources/Documents/Typealiases.html        |  159 +-
 .../Resources/Documents/css/highlight.css       |    6 +-
 .../Contents/Resources/Documents/css/jazzy.css  |   65 +-
 .../Contents/Resources/Documents/index.html     |  741 +++++++-
 .../Contents/Resources/Documents/js/jazzy.js    |   11 +-
 .../Resources/Documents/undocumented.txt        |   11 -
 .../.docset/Contents/Resources/docSet.dsidx     |  Bin 114688 -> 147456 bytes
 sdks/swift/docs/docsets/.tgz                    |  Bin 111866 -> 148251 bytes
 sdks/swift/docs/index.html                      |   24 +-
 .../main/resources/usergrid-default.properties  |   10 +-
 .../corepersistence/ApplicationIdCacheImpl.java |    9 +-
 .../corepersistence/CpEntityManager.java        |    4 +-
 .../index/IndexSchemaCacheFig.java              |    2 +-
 .../index/IndexSchemaCacheImpl.java             |    3 +-
 .../corepersistence/index/IndexServiceImpl.java |    1 +
 .../org/apache/usergrid/utils/StringUtils.java  |    8 +
 .../main/resources/usergrid-core-context.xml    |    6 +
 .../shard/impl/NodeShardAllocationImpl.java     |    7 +-
 .../shard/impl/ShardGroupCompactionImpl.java    |   18 +-
 .../usergrid/persistence/queue/QueueFig.java    |    4 +-
 .../queue/impl/QueueManagerFactoryImpl.java     |   27 +-
 .../org/apache/usergrid/rest/RootResource.java  |   25 +
 .../rest/applications/CollectionResource.java   |    8 +-
 .../apache/usergrid/rest/NotificationsIT.java   |   11 +
 .../collection/CollectionsResourceIT.java       |  147 +-
 .../events/ApplicationRequestCounterIT.java     |   48 +
 .../cassandra/ManagementServiceImpl.java        |   93 +-
 .../ApplicationQueueManagerCache.java           |  143 ++
 .../notifications/NotificationsService.java     |   11 +-
 .../services/notifications/QueueListener.java   |   58 +-
 .../services/notifications/TaskManager.java     |  117 +-
 .../impl/ApplicationQueueManagerImpl.java       |  151 +-
 .../services/notifiers/NotifiersService.java    |    6 +
 .../gcm/NotificationsServiceIT.java             |   77 +
 website/README.md                               |    2 +-
 website/layouts/footer.html                     |    3 +-
 259 files changed, 20312 insertions(+), 7206 deletions(-)
----------------------------------------------------------------------



[25/54] [abbrv] usergrid git commit: Temporarily disable notification counters and back to Schedulers.io()

Posted by mr...@apache.org.
Temporarily disable notification counters and back to Schedulers.io()


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

Branch: refs/heads/apm
Commit: df9abc4d0c16af25dbfd75ea544bc9953b7addc7
Parents: 81eb251
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 18:01:57 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 18:01:57 2016 -0700

----------------------------------------------------------------------
 .../services/notifications/TaskManager.java     |  4 +-
 .../impl/ApplicationQueueManagerImpl.java       | 58 ++++++++++++--------
 2 files changed, 36 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/df9abc4d/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
index e908c3b..870cae9 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
@@ -62,7 +62,7 @@ public class TaskManager {
             //random date and time for format
 
 
-            incrementNotificationCounter( "completed" );
+            //incrementNotificationCounter( "completed" );
 
             EntityRef deviceRef = new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID);
 
@@ -100,7 +100,7 @@ public class TaskManager {
 
         try {
 
-            incrementNotificationCounter( "failed" );
+            //incrementNotificationCounter( "failed" );
 
             if (logger.isDebugEnabled()) {
                 logger.debug("Notification {} for device {} got error {}", notification.getUuid(), deviceUUID, code);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/df9abc4d/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 5254fd6..778307c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -62,7 +62,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
 
 
-    private final ExecutorService asyncExecutor;
+    //private final ExecutorService asyncExecutor;
 
 
 
@@ -78,6 +78,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
         this.queueMeter = metricsFactory.getMeter(ApplicationQueueManagerImpl.class, "notification.queue");
         this.sendMeter = metricsFactory.getMeter(NotificationsService.class, "queue.send");
 
+        /**
         int maxAsyncThreads;
         int workerQueueSize;
 
@@ -102,7 +103,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
             .createTaskExecutor( "push-device-io", maxAsyncThreads, workerQueueSize,
                 TaskExecutorFactory.RejectionAction.CALLERRUNS );
 
-
+        **/
     }
 
     private boolean scheduleQueueJob(Notification notification) throws Exception {
@@ -269,7 +270,6 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
                         return Observable.from(entities);
 
                         })
-                        .distinct( deviceRef -> deviceRef.getUuid())
                         .filter( device -> {
 
                             if(logger.isTraceEnabled()) {
@@ -306,37 +306,47 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                         })
                         .map(sendMessageFunction)
-                        .doOnNext( message -> {
-                            try {
+                        .subscribeOn(Schedulers.io());
 
-                                if(message.isPresent()){
+                }, concurrencyFactor)
+                .distinct( queueMessage -> {
 
-                                    if(logger.isTraceEnabled()) {
-                                        logger.trace("Queueing notification message for device: {}", message.get().getDeviceId());
-                                    }
-                                    qm.sendMessage( message.get() );
-                                    queueMeter.mark();
-                                }
+                    if(queueMessage.isPresent()) {
+                        return queueMessage.get().getNotificationId();
+                    }
+                    
+                    return queueMessage; // this will always be distinct, default handling for the Optional.empty() case
 
-                            } catch (IOException e) {
+                } )
+                .doOnNext( message -> {
+                    try {
 
-                                if(message.isPresent()){
-                                    logger.error("Unable to queue notification for notification UUID {} and device UUID {} ",
-                                        message.get().getNotificationId(), message.get().getDeviceId());
-                                }
-                                else{
-                                    logger.error("Unable to queue notification as it's not present when trying to send to queue");
-                                }
+                        if(message.isPresent()){
 
+                            if(logger.isTraceEnabled()) {
+                                logger.trace("Queueing notification message for device: {}", message.get().getDeviceId());
                             }
+                            qm.sendMessage( message.get() );
+                            queueMeter.mark();
+                        }
 
+                    } catch (IOException e) {
 
-                        }).subscribeOn(Schedulers.from(asyncExecutor));
+                        if(message.isPresent()){
+                            logger.error("Unable to queue notification for notification UUID {} and device UUID {} ",
+                                message.get().getNotificationId(), message.get().getDeviceId());
+                        }
+                        else{
+                            logger.error("Unable to queue notification as it's not present when trying to send to queue");
+                        }
 
-                }, concurrencyFactor)
+                    }
+
+
+                })
                 .doOnError(throwable -> {
 
-                    logger.error("Error while processing devices for notification : {}", notification.getUuid());
+                    logger.error("Error while processing devices for notification : {}, error: {}", notification.getUuid(), throwable.getMessage());
                     notification.setProcessingFinished(-1L);
                     notification.setDeviceProcessedCount(deviceCount.get());
                     logger.warn("Partial notification. Only {} devices processed for notification {}",
@@ -362,7 +372,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
 
                 });
 
-            processMessagesObservable.subscribeOn(Schedulers.from(asyncExecutor)).subscribe(); // fire the queuing into the background
+            processMessagesObservable.subscribeOn(Schedulers.io()).subscribe(); // fire the queuing into the background
 
         }
 


[32/54] [abbrv] usergrid git commit: Add status/memory endpoint to get heap usage, max heap, and free heap.

Posted by mr...@apache.org.
Add status/memory endpoint to get heap usage, max heap, and free heap.


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

Branch: refs/heads/apm
Commit: 02352dff0ba164dfcf2789457c0c65e0deee8771
Parents: a8ba65f
Author: Mike Dunker <md...@apigee.com>
Authored: Thu Apr 21 10:08:25 2016 -0700
Committer: Mike Dunker <md...@apigee.com>
Committed: Thu Apr 21 10:08:25 2016 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/utils/StringUtils.java  |  8 +++++++
 .../org/apache/usergrid/rest/RootResource.java  | 23 ++++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/02352dff/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
index b91b866..6bb44d8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
@@ -17,6 +17,7 @@
 package org.apache.usergrid.utils;
 
 
+import java.text.DecimalFormat;
 import java.util.Arrays;
 
 import org.apache.commons.io.IOUtils;
@@ -169,4 +170,11 @@ public class StringUtils extends org.apache.commons.lang.StringUtils {
         }
         return null;
     }
+
+    public static String readableByteSize(long size) {
+        if(size <= 0) return "0";
+        final String[] units = new String[] { "B", "kB", "MB", "GB", "TB" };
+        int digitGroups = (int) (Math.log10(size)/Math.log10(1024));
+        return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups];
+    }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/02352dff/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
index 75ed567..9701105 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
@@ -248,6 +248,29 @@ public class RootResource extends AbstractContextResource implements MetricProce
 
     }
 
+    @GET
+    @Path("/status/memory")
+    @JSONP
+    @Produces({MediaType.APPLICATION_JSON, "application/javascript"})
+    public ApiResponse getMemoryStats(){
+
+        ApiResponse response = createApiResponse();
+
+        ObjectNode node = JsonNodeFactory.instance.objectNode();
+
+        long heapSize = Runtime.getRuntime().totalMemory();
+        long heapMaxSize = Runtime.getRuntime().maxMemory();
+        long heapFreeSize = Runtime.getRuntime().freeMemory();
+
+        node.put( "currentHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapSize) );
+        node.put( "maxHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapMaxSize) );
+        node.put( "freeHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapFreeSize) );
+
+        response.setProperty( "status", node );
+        return response;
+
+    }
+
 
 
     private void dumpMetrics( ObjectNode node ) {


[36/54] [abbrv] usergrid git commit: Docs are for "2.x" and not "1.0"

Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/app-security.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/app-security.html b/content/docs/security-and-auth/app-security.html
index cde27e6..3bd07fc 100644
--- a/content/docs/security-and-auth/app-security.html
+++ b/content/docs/security-and-auth/app-security.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Security &amp; token authentication &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Security &amp; token authentication &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Using permissions" href="using-permissions.html"/>
         <link rel="prev" title="Troubleshooting" href="../push-notifications/troubleshooting.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -304,7 +304,7 @@ is protected from malicious attacks. For more information, see
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/authenticating-api-requests.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/authenticating-api-requests.html b/content/docs/security-and-auth/authenticating-api-requests.html
index e48d17a..30aa265 100644
--- a/content/docs/security-and-auth/authenticating-api-requests.html
+++ b/content/docs/security-and-auth/authenticating-api-requests.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Authenticating API requests &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Authenticating API requests &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Revoking tokens (logout)" href="revoking-tokens-logout.html"/>
         <link rel="prev" title="Changing token expiration (time-to-live)" href="changing-token-time-live-ttl.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -353,7 +353,7 @@ parameters to your request URL:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/authenticating-users-and-application-clients.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/authenticating-users-and-application-clients.html b/content/docs/security-and-auth/authenticating-users-and-application-clients.html
index 1f2a5bb..340d0e3 100644
--- a/content/docs/security-and-auth/authenticating-users-and-application-clients.html
+++ b/content/docs/security-and-auth/authenticating-users-and-application-clients.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Authenticating users &amp; app clients &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Authenticating users &amp; app clients &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Authentication levels" href="user-authentication-types.html"/>
         <link rel="prev" title="Using roles" href="using-roles.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -514,7 +514,7 @@ requests to the organization:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/changing-token-time-live-ttl.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/changing-token-time-live-ttl.html b/content/docs/security-and-auth/changing-token-time-live-ttl.html
index 03cfa81..f9f9cad 100644
--- a/content/docs/security-and-auth/changing-token-time-live-ttl.html
+++ b/content/docs/security-and-auth/changing-token-time-live-ttl.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Changing token expiration (time-to-live) &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Changing token expiration (time-to-live) &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Authenticating API requests" href="authenticating-api-requests.html"/>
         <link rel="prev" title="Authentication levels" href="user-authentication-types.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -373,7 +373,7 @@ security risk and should be used with caution.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/facebook-sign.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/facebook-sign.html b/content/docs/security-and-auth/facebook-sign.html
index 44da356..0f4ee84 100644
--- a/content/docs/security-and-auth/facebook-sign.html
+++ b/content/docs/security-and-auth/facebook-sign.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Facebook sign in &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Facebook sign in &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Security best practices" href="securing-your-app.html"/>
         <link rel="prev" title="Revoking tokens (logout)" href="revoking-tokens-logout.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -490,7 +490,7 @@ use the SDK. Here\u2019s the code to create a client:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/revoking-tokens-logout.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/revoking-tokens-logout.html b/content/docs/security-and-auth/revoking-tokens-logout.html
index 3fcb523..e82be31 100644
--- a/content/docs/security-and-auth/revoking-tokens-logout.html
+++ b/content/docs/security-and-auth/revoking-tokens-logout.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Revoking tokens (logout) &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Revoking tokens (logout) &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Facebook sign in" href="facebook-sign.html"/>
         <link rel="prev" title="Authenticating API requests" href="authenticating-api-requests.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -326,7 +326,7 @@ admin user tokens by making a PUT request to /management/users//</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/securing-your-app.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/securing-your-app.html b/content/docs/security-and-auth/securing-your-app.html
index 99aee72..a722510 100644
--- a/content/docs/security-and-auth/securing-your-app.html
+++ b/content/docs/security-and-auth/securing-your-app.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Security best practices &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Security best practices &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="User management &amp; social graph" href="../user-management/user-management.html"/>
         <link rel="prev" title="Facebook sign in" href="facebook-sign.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -382,7 +382,7 @@ permission rules, see <a class="reference external" href="using-permissions.html
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/user-authentication-types.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/user-authentication-types.html b/content/docs/security-and-auth/user-authentication-types.html
index 6b8d457..f94587c 100644
--- a/content/docs/security-and-auth/user-authentication-types.html
+++ b/content/docs/security-and-auth/user-authentication-types.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Authentication levels &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Authentication levels &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Changing token expiration (time-to-live)" href="changing-token-time-live-ttl.html"/>
         <link rel="prev" title="Authenticating users &amp; app clients" href="authenticating-users-and-application-clients.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -388,7 +388,7 @@ should not use the admin user authentication level.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/using-permissions.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/using-permissions.html b/content/docs/security-and-auth/using-permissions.html
index 04a82c7..96d70a6 100644
--- a/content/docs/security-and-auth/using-permissions.html
+++ b/content/docs/security-and-auth/using-permissions.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Using permissions &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Using permissions &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Using roles" href="using-roles.html"/>
         <link rel="prev" title="Security &amp; token authentication" href="app-security.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -494,7 +494,7 @@ the response:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/security-and-auth/using-roles.html
----------------------------------------------------------------------
diff --git a/content/docs/security-and-auth/using-roles.html b/content/docs/security-and-auth/using-roles.html
index 0fb46e1..b0f452f 100644
--- a/content/docs/security-and-auth/using-roles.html
+++ b/content/docs/security-and-auth/using-roles.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Using roles &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Using roles &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Authenticating users &amp; app clients" href="authenticating-users-and-application-clients.html"/>
         <link rel="prev" title="Using permissions" href="using-permissions.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -721,7 +721,7 @@ from the entity.</li>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/activity.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/activity.html b/content/docs/user-management/activity.html
index dc397ac..ac5788d 100644
--- a/content/docs/user-management/activity.html
+++ b/content/docs/user-management/activity.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Activity &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Activity &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Social Graph Connections" href="user-connections.html"/>
         <link rel="prev" title="Working with group data" href="group.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -850,7 +850,7 @@ activities for which this group has a relationship (owns).</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/group.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/group.html b/content/docs/user-management/group.html
index be83831..43255d2 100644
--- a/content/docs/user-management/group.html
+++ b/content/docs/user-management/group.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Working with group data &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Working with group data &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Activity" href="activity.html"/>
         <link rel="prev" title="Working with User Data" href="working-user-data.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -813,7 +813,7 @@ for details.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/groups.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/groups.html b/content/docs/user-management/groups.html
index dbde055..efa4adf 100644
--- a/content/docs/user-management/groups.html
+++ b/content/docs/user-management/groups.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Groups &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Groups &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/> 
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/> 
 
   
   <script src="../_static/js/modernizr.min.js"></script>
@@ -57,7 +57,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -382,7 +382,7 @@ or subscribe to all /groups/memes/dogs</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/messagee-example.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/messagee-example.html b/content/docs/user-management/messagee-example.html
index e336348..ffb3b62 100644
--- a/content/docs/user-management/messagee-example.html
+++ b/content/docs/user-management/messagee-example.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>App Example - Messagee &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>App Example - Messagee &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Geolocating your Entities" href="../geolocation/geolocation.html"/>
         <link rel="prev" title="Social Graph Connections" href="user-connections.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -467,7 +467,7 @@ SDK</a></p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/user-connections.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/user-connections.html b/content/docs/user-management/user-connections.html
index ec0fdc5..3cbbc2a 100644
--- a/content/docs/user-management/user-connections.html
+++ b/content/docs/user-management/user-connections.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Social Graph Connections &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Social Graph Connections &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="App Example - Messagee" href="messagee-example.html"/>
         <link rel="prev" title="Activity" href="activity.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -342,7 +342,7 @@ entities</a>.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/user-management.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/user-management.html b/content/docs/user-management/user-management.html
index 1cd9dde..eb0f4b2 100644
--- a/content/docs/user-management/user-management.html
+++ b/content/docs/user-management/user-management.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>User management &amp; social graph &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>User management &amp; social graph &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Working with User Data" href="working-user-data.html"/>
         <link rel="prev" title="Security best practices" href="../security-and-auth/securing-your-app.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -356,7 +356,7 @@ are most relevant to your users.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/user-management/working-user-data.html
----------------------------------------------------------------------
diff --git a/content/docs/user-management/working-user-data.html b/content/docs/user-management/working-user-data.html
index b4662f0..18f2f0e 100644
--- a/content/docs/user-management/working-user-data.html
+++ b/content/docs/user-management/working-user-data.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Working with User Data &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Working with User Data &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Working with group data" href="group.html"/>
         <link rel="prev" title="User management &amp; social graph" href="user-management.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -689,7 +689,7 @@ immediately.</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/using-usergrid/creating-a-new-application.html
----------------------------------------------------------------------
diff --git a/content/docs/using-usergrid/creating-a-new-application.html b/content/docs/using-usergrid/creating-a-new-application.html
index cbcd095..7b1bcdb 100644
--- a/content/docs/using-usergrid/creating-a-new-application.html
+++ b/content/docs/using-usergrid/creating-a-new-application.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Creating a new application &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Creating a new application &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Using a Sandbox Application" href="using-a-sandbox-app.html"/>
         <link rel="prev" title="Creating a Usergrid Account" href="creating-account.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -306,7 +306,7 @@ Practices</a> .</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/using-usergrid/creating-account.html
----------------------------------------------------------------------
diff --git a/content/docs/using-usergrid/creating-account.html b/content/docs/using-usergrid/creating-account.html
index 55f65a6..f853fe7 100644
--- a/content/docs/using-usergrid/creating-account.html
+++ b/content/docs/using-usergrid/creating-account.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Creating a Usergrid Account &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Creating a Usergrid Account &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Creating a new application" href="creating-a-new-application.html"/>
         <link rel="prev" title="Async vs. sync calls" href="../introduction/async-vs-sync.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -317,7 +317,7 @@ environment. For more about Usergrid&#8217;s SDKs, see
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/using-usergrid/using-a-sandbox-app.html
----------------------------------------------------------------------
diff --git a/content/docs/using-usergrid/using-a-sandbox-app.html b/content/docs/using-usergrid/using-a-sandbox-app.html
index 1f5b1fa..ef65e42 100644
--- a/content/docs/using-usergrid/using-a-sandbox-app.html
+++ b/content/docs/using-usergrid/using-a-sandbox-app.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Using a Sandbox Application &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Using a Sandbox Application &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="Using the API" href="using-the-api.html"/>
         <link rel="prev" title="Creating a new application" href="creating-a-new-application.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -342,7 +342,7 @@ application whatever you like (including &#8220;sandbox&#8221;).</li>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/content/docs/using-usergrid/using-the-api.html
----------------------------------------------------------------------
diff --git a/content/docs/using-usergrid/using-the-api.html b/content/docs/using-usergrid/using-the-api.html
index c251dee..c46b1fb 100644
--- a/content/docs/using-usergrid/using-the-api.html
+++ b/content/docs/using-usergrid/using-the-api.html
@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Using the API &mdash; Apache Usergrid 1.0 documentation</title>
+  <title>Using the API &mdash; Apache Usergrid 2.x documentation</title>
   
 
   
@@ -30,7 +30,7 @@
   
 
   
-    <link rel="top" title="Apache Usergrid 1.0 documentation" href="../index.html"/>
+    <link rel="top" title="Apache Usergrid 2.x documentation" href="../index.html"/>
         <link rel="next" title="The Usergrid Data Store" href="../data-storage/data-store-dbms.html"/>
         <link rel="prev" title="Using a Sandbox Application" href="using-a-sandbox-app.html"/> 
 
@@ -59,7 +59,7 @@
           
           
             <div class="version">
-              1.0
+              2.x
             </div>
           
         
@@ -476,7 +476,7 @@ available for the following languages:</p>
     <script type="text/javascript">
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:'../',
-            VERSION:'1.0',
+            VERSION:'2.x',
             COLLAPSE_INDEX:false,
             FILE_SUFFIX:'.html',
             HAS_SOURCE:  true

http://git-wip-us.apache.org/repos/asf/usergrid/blob/279c020d/docs/conf.py
----------------------------------------------------------------------
diff --git a/docs/conf.py b/docs/conf.py
index db1c4fe..96a071d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -70,9 +70,9 @@ copyright = u'2013-2015, Apache Usergrid'
 # built documents.
 #
 # The short X.Y version.
-version = '1.0'
+version = '2.x'
 # The full version, including alpha/beta/rc tags.
-release = '1.0'
+release = '2.x'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.


[12/54] [abbrv] usergrid git commit: Updating test configuration constants.

Posted by mr...@apache.org.
Updating test configuration constants.


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

Branch: refs/heads/apm
Commit: 58714975e4af7951213c635a56d3a1451bd792ed
Parents: 09dd7f6
Author: Robert Walsh <rj...@gmail.com>
Authored: Fri Apr 15 08:25:39 2016 -0500
Committer: Robert Walsh <rj...@gmail.com>
Committed: Fri Apr 15 08:25:39 2016 -0500

----------------------------------------------------------------------
 .../java/org/apache/usergrid/client/SDKTestConfiguration.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/58714975/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
----------------------------------------------------------------------
diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
index 8663326..e92e7be 100644
--- a/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
+++ b/sdks/java/src/test/java/org/apache/usergrid/client/SDKTestConfiguration.java
@@ -22,11 +22,11 @@ public class SDKTestConfiguration {
     public static final String APP_CLIENT_ID = "b3U6THNcevskEeOQZLcUROUUVA"; //"YXA6_j0WsfFCEeWKoy6txsCOfA" ;
     public static final String APP_CLIENT_SECRET = "b3U6RZHYznP28xieBzQPackFPmmnevU"; //"YXA6jg8x4wjq1AAyQBKtn4bRd1l0gJ8"; //
 
-    public static final String APP_UserName = "rwalsh"; //"test";// //"b3U66ne33W4OEeWXmAIj6QFb-Q";
+    public static final String APP_UserName = "javaSDK"; //"test";// //"b3U66ne33W4OEeWXmAIj6QFb-Q";
     public static final String APP_Password = "Apigee123"; //"test";//"b3U6PxbpQiTrXKCWu0n1CjK1uTZXuG4";
     public static final String USERGRID_URL = "https://api.usergrid.com/";
     public static final String ORG_NAME = "rwalsh";
-    public static final String APP_NAME = "sandbox";
+    public static final String APP_NAME = "sdk.demo";
 
     public static UsergridAuthMode authFallBack = UsergridAuthMode.APP;
 


[53/54] [abbrv] usergrid git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/usergrid

Posted by mr...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/usergrid


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

Branch: refs/heads/apm
Commit: 9250a81e734bd886e13d23d897c6acbc0e3fda87
Parents: 8c16d6a 337c94c
Author: Dave Johnson <sn...@apache.org>
Authored: Mon May 23 10:15:50 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon May 23 10:15:50 2016 -0400

----------------------------------------------------------------------
 UsergridSDK.podspec                             |   18 +
 sdks/java/README.md                             |  598 +++++-
 sdks/java/pom.xml                               |   73 +-
 .../org/apache/usergrid/java/client/Client.java | 1292 -------------
 .../apache/usergrid/java/client/Usergrid.java   |  285 +++
 .../usergrid/java/client/UsergridClient.java    |  427 +++++
 .../java/client/UsergridClientConfig.java       |   60 +
 .../usergrid/java/client/UsergridEnums.java     |  170 ++
 .../usergrid/java/client/UsergridRequest.java   |  205 +++
 .../java/client/UsergridRequestManager.java     |   86 +
 .../java/client/auth/UsergridAppAuth.java       |   55 +
 .../usergrid/java/client/auth/UsergridAuth.java |   75 +
 .../java/client/auth/UsergridUserAuth.java      |   56 +
 .../usergrid/java/client/entities/Activity.java |  625 -------
 .../usergrid/java/client/entities/Device.java   |   68 -
 .../usergrid/java/client/entities/Entity.java   |  191 --
 .../usergrid/java/client/entities/Group.java    |   79 -
 .../usergrid/java/client/entities/Message.java  |  148 --
 .../usergrid/java/client/entities/User.java     |  158 --
 .../java/client/exception/ClientException.java  |   41 -
 .../client/exception/UsergridException.java     |   50 +
 .../java/client/model/UsergridDevice.java       |   60 +
 .../java/client/model/UsergridEntity.java       |  487 +++++
 .../java/client/model/UsergridUser.java         |  198 ++
 .../java/client/query/UsergridQuery.java        |  434 +++++
 .../java/client/response/AggregateCounter.java  |   52 -
 .../client/response/AggregateCounterSet.java    |  111 --
 .../java/client/response/ApiResponse.java       |  421 -----
 .../client/response/ClientCredentialsInfo.java  |   58 -
 .../java/client/response/QueueInfo.java         |   44 -
 .../java/client/response/UsergridResponse.java  |  230 +++
 .../client/response/UsergridResponseError.java  |   98 +
 .../usergrid/java/client/utils/JsonUtils.java   |  262 ++-
 .../usergrid/java/client/utils/MapUtils.java    |   27 +-
 .../usergrid/java/client/utils/ObjectUtils.java |   28 +-
 .../usergrid/java/client/utils/UrlUtils.java    |  124 --
 .../utils/UsergridEntityDeserializer.java       |   41 +
 .../client/ClientAuthFallBackTestCase.java      |   72 +
 .../usergrid/client/ClientAuthTestCase.java     |   85 +
 .../client/ClientConnectionsTestCase.java       |  171 ++
 .../usergrid/client/ClientRestTestCase.java     |   90 +
 .../apache/usergrid/client/EntityTestCase.java  |  676 +++++++
 .../apache/usergrid/client/QueryTestCase.java   |  194 ++
 .../usergrid/client/SDKTestConfiguration.java   |   38 +
 .../apache/usergrid/client/SDKTestUtils.java    |  108 ++
 .../client/UsergridClientAuthTestCase.java      |   73 +
 .../usergrid/client/UsergridInitTestCase.java   |   48 +
 .../client/UsergridResponseErrorTestCase.java   |   62 +
 .../client/UsergridResponseTestCase.java        |   85 +
 .../usergrid/client/UsergridTestCase.java       |   30 +
 sdks/java/usergrid-java-client-2.1.0.jar        |  Bin 0 -> 1992232 bytes
 sdks/swift/README.md                            |    2 +-
 .../Source/Base.lproj/Main.storyboard           |   26 +-
 .../ActivityFeed/Source/FormTextField.swift     |    2 +-
 .../Source/MessageViewController.swift          |   26 +-
 .../Samples/Push/Source/UsergridManager.swift   |    2 +-
 sdks/swift/Source/Usergrid.swift                |   32 +-
 sdks/swift/Source/UsergridAsset.swift           |   18 +-
 sdks/swift/Source/UsergridAuth.swift            |    6 +-
 sdks/swift/Source/UsergridClient.swift          |   89 +-
 sdks/swift/Source/UsergridClientConfig.swift    |   14 +-
 sdks/swift/Source/UsergridDevice.swift          |   41 +-
 sdks/swift/Source/UsergridEntity.swift          |  104 +-
 sdks/swift/Source/UsergridEnums.swift           |   22 +-
 sdks/swift/Source/UsergridExtensions.swift      |   82 +-
 sdks/swift/Source/UsergridFileMetaData.swift    |    4 +-
 sdks/swift/Source/UsergridQuery.swift           |    3 +-
 sdks/swift/Source/UsergridRequest.swift         |    2 +-
 sdks/swift/Source/UsergridRequestManager.swift  |   72 +-
 sdks/swift/Source/UsergridResponse.swift        |    6 +-
 sdks/swift/Source/UsergridUser.swift            |   62 +-
 sdks/swift/Tests/ASSET_Tests.swift              |  218 ++-
 sdks/swift/Tests/AUTH_Tests.swift               |   92 +-
 sdks/swift/Tests/CONNECTION_Tests.swift         |   42 +-
 sdks/swift/Tests/ClientCreationTests.swift      |   44 +-
 sdks/swift/Tests/GET_Tests.swift                |   38 +-
 sdks/swift/Tests/PUT_Tests.swift                |   38 +-
 sdks/swift/Tests/TestAssets/UsergridGuy.jpg     |  Bin 0 -> 12981 bytes
 sdks/swift/Tests/User_Tests.swift               |  310 +++-
 sdks/swift/UsergridSDK.podspec                  |   18 -
 .../swift/UsergridSDK.xcodeproj/project.pbxproj |    4 +-
 sdks/swift/docs/Classes.html                    |   16 +-
 sdks/swift/docs/Classes/Usergrid.html           |  290 ++-
 sdks/swift/docs/Classes/UsergridAppAuth.html    |   30 +-
 sdks/swift/docs/Classes/UsergridAsset.html      |   44 +-
 .../Classes/UsergridAssetUploadRequest.html     |   20 +-
 sdks/swift/docs/Classes/UsergridAuth.html       |   34 +-
 sdks/swift/docs/Classes/UsergridClient.html     |  275 ++-
 .../docs/Classes/UsergridClientConfig.html      |   54 +-
 sdks/swift/docs/Classes/UsergridDevice.html     |  205 ++-
 sdks/swift/docs/Classes/UsergridEntity.html     |  215 ++-
 .../docs/Classes/UsergridFileMetaData.html      |   30 +-
 sdks/swift/docs/Classes/UsergridQuery.html      |  156 +-
 sdks/swift/docs/Classes/UsergridRequest.html    |   36 +-
 sdks/swift/docs/Classes/UsergridResponse.html   |   42 +-
 .../docs/Classes/UsergridResponseError.html     |   24 +-
 sdks/swift/docs/Classes/UsergridUser.html       |  231 ++-
 sdks/swift/docs/Classes/UsergridUserAuth.html   |   30 +-
 sdks/swift/docs/Enums.html                      |   28 +-
 sdks/swift/docs/Enums/UsergridAuthMode.html     |  283 +++
 .../docs/Enums/UsergridDeviceProperties.html    |   20 +-
 sdks/swift/docs/Enums/UsergridDirection.html    |   16 +-
 .../docs/Enums/UsergridEntityProperties.html    |   24 +-
 sdks/swift/docs/Enums/UsergridHttpMethod.html   |   16 +-
 .../docs/Enums/UsergridImageContentType.html    |   16 +-
 .../swift/docs/Enums/UsergridQueryOperator.html |   20 +-
 .../docs/Enums/UsergridQuerySortOrder.html      |   20 +-
 .../docs/Enums/UsergridUserProperties.html      |   20 +-
 sdks/swift/docs/Extensions.html                 |   72 +-
 sdks/swift/docs/Extensions/NSDate.html          |  448 +++++
 sdks/swift/docs/Global Variables.html           |   18 +-
 sdks/swift/docs/Typealiases.html                |   36 +-
 .../Contents/Resources/Documents/Classes.html   |  209 ++-
 .../Resources/Documents/Classes/Usergrid.html   | 1086 ++++++++---
 .../Documents/Classes/UsergridAppAuth.html      |  183 +-
 .../Documents/Classes/UsergridAsset.html        |  265 ++-
 .../Classes/UsergridAssetUploadRequest.html     |  356 ++++
 .../Documents/Classes/UsergridAuth.html         |  274 ++-
 .../Documents/Classes/UsergridClient.html       | 1310 +++++++++----
 .../Documents/Classes/UsergridClientConfig.html |  345 +++-
 .../Documents/Classes/UsergridDevice.html       |  519 +++++-
 .../Documents/Classes/UsergridEntity.html       |  809 +++++---
 .../Documents/Classes/UsergridFileMetaData.html |  217 ++-
 .../Documents/Classes/UsergridQuery.html        |  540 ++++--
 .../Documents/Classes/UsergridRequest.html      |  619 +++++++
 .../Documents/Classes/UsergridResponse.html     |  309 ++--
 .../Classes/UsergridResponseError.html          |  473 +++++
 .../Documents/Classes/UsergridUser.html         | 1734 ++++++++++++++++--
 .../Documents/Classes/UsergridUserAuth.html     |  169 +-
 .../Contents/Resources/Documents/Enums.html     |  115 +-
 .../Documents/Enums/UsergridAuthFallback.html   |   53 +-
 .../Documents/Enums/UsergridAuthMode.html       |  283 +++
 .../Enums/UsergridDeviceProperties.html         |   83 +-
 .../Documents/Enums/UsergridDirection.html      |   71 +-
 .../Enums/UsergridEntityProperties.html         |  101 +-
 .../Documents/Enums/UsergridHttpMethod.html     |  341 ++++
 .../Enums/UsergridImageContentType.html         |   73 +-
 .../Documents/Enums/UsergridQueryOperator.html  |   89 +-
 .../Documents/Enums/UsergridQuerySortOrder.html |   83 +-
 .../Documents/Enums/UsergridUserProperties.html |   95 +-
 .../Resources/Documents/Extensions.html         |   72 +-
 .../Resources/Documents/Extensions/NSDate.html  |  448 +++++
 .../Resources/Documents/Global Variables.html   |  210 +++
 .../Resources/Documents/Typealiases.html        |  159 +-
 .../Resources/Documents/css/highlight.css       |    6 +-
 .../Contents/Resources/Documents/css/jazzy.css  |   65 +-
 .../Contents/Resources/Documents/index.html     |  741 +++++++-
 .../Contents/Resources/Documents/js/jazzy.js    |   11 +-
 .../Resources/Documents/undocumented.txt        |   11 -
 .../.docset/Contents/Resources/docSet.dsidx     |  Bin 114688 -> 147456 bytes
 sdks/swift/docs/docsets/.tgz                    |  Bin 111866 -> 148251 bytes
 sdks/swift/docs/index.html                      |   24 +-
 .../main/resources/usergrid-default.properties  |   10 +-
 .../corepersistence/ApplicationIdCacheImpl.java |    9 +-
 .../corepersistence/CpEntityManager.java        |    4 +-
 .../index/IndexSchemaCacheFig.java              |    2 +-
 .../index/IndexSchemaCacheImpl.java             |    3 +-
 .../corepersistence/index/IndexServiceImpl.java |    1 +
 .../org/apache/usergrid/utils/StringUtils.java  |    8 +
 .../main/resources/usergrid-core-context.xml    |    6 +
 .../shard/impl/NodeShardAllocationImpl.java     |    7 +-
 .../shard/impl/ShardGroupCompactionImpl.java    |   18 +-
 .../usergrid/persistence/queue/QueueFig.java    |    4 +-
 .../queue/impl/QueueManagerFactoryImpl.java     |   27 +-
 .../org/apache/usergrid/rest/RootResource.java  |   25 +
 .../rest/applications/CollectionResource.java   |    8 +-
 .../apache/usergrid/rest/NotificationsIT.java   |   11 +
 .../collection/CollectionsResourceIT.java       |  147 +-
 .../events/ApplicationRequestCounterIT.java     |   48 +
 .../cassandra/ManagementServiceImpl.java        |   93 +-
 .../ApplicationQueueManagerCache.java           |  143 ++
 .../notifications/NotificationsService.java     |   11 +-
 .../services/notifications/QueueListener.java   |   58 +-
 .../services/notifications/TaskManager.java     |  117 +-
 .../impl/ApplicationQueueManagerImpl.java       |  151 +-
 .../services/notifiers/NotifiersService.java    |    6 +
 .../gcm/NotificationsServiceIT.java             |   77 +
 177 files changed, 20005 insertions(+), 6895 deletions(-)
----------------------------------------------------------------------