Fixes bug in resources and tests job status retrieval successfully
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3b436243 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3b436243 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3b436243 Branch: refs/heads/USERGRID-909 Commit: 3b436243eb19ea03151aedf1ea13a63e2048f2f4 Parents: e41b5f0 Author: Todd Nine <tn...@apigee.com> Authored: Mon Oct 26 18:24:58 2015 -0600 Committer: Todd Nine <tn...@apigee.com> Committed: Mon Oct 26 18:24:58 2015 -0600 ---------------------------------------------------------------------- .../java/org/apache/usergrid/rest/ConnectionResource.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3b436243/stack/rest/src/main/java/org/apache/usergrid/rest/ConnectionResource.java ---------------------------------------------------------------------- diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/ConnectionResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/ConnectionResource.java index b6a38e1..dfa4781 100644 --- a/stack/rest/src/main/java/org/apache/usergrid/rest/ConnectionResource.java +++ b/stack/rest/src/main/java/org/apache/usergrid/rest/ConnectionResource.java @@ -43,6 +43,7 @@ import org.apache.usergrid.corepersistence.service.ConnectionServiceImpl; import org.apache.usergrid.corepersistence.service.StatusService; import org.apache.usergrid.corepersistence.util.CpNamingUtils; import org.apache.usergrid.persistence.core.scope.ApplicationScope; +import org.apache.usergrid.persistence.index.query.Identifier; import org.apache.usergrid.persistence.index.utils.UUIDUtils; import org.apache.usergrid.persistence.model.util.UUIDGenerator; import org.apache.usergrid.rest.security.annotations.RequireSystemAccess; @@ -92,7 +93,7 @@ public class ConnectionResource extends AbstractContextResource { @RequireSystemAccess @GET - @Path( "dedup/{jobId}" ) + @Path( "dedup/{jobId: " + Identifier.UUID_REX + "}" ) public JSONWithPadding rebuildIndexesGet( @PathParam( "jobId" ) String jobId, @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback ) throws Exception { @@ -153,10 +154,10 @@ public class ConnectionResource extends AbstractContextResource { }}; statusService.setStatus( CpNamingUtils.MANAGEMENT_APPLICATION_ID, jobId, - StatusService.Status.INPROGRESS, status ); + StatusService.Status.INPROGRESS, status ).toBlocking().lastOrDefault( null ); } ).doOnSubscribe( () -> { statusService.setStatus( CpNamingUtils.MANAGEMENT_APPLICATION_ID, jobId, StatusService.Status.STARTED, - new HashMap<>() ); + new HashMap<>() ).toBlocking().lastOrDefault( null ); } ).doOnCompleted( () -> { final long runningTotal = count.get();