usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [45/50] [abbrv] git commit: Removed ExportInfo and all mentions of it in the code.
Date Thu, 06 Mar 2014 19:22:00 GMT
Removed ExportInfo and all mentions of it in the code.


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

Branch: refs/pull/60/merge
Commit: cb606aa7bed323a499c4798390e3e3ad26a53a02
Parents: 7dd6cee
Author: grey <greyes@apigee.com>
Authored: Thu Mar 6 10:06:10 2014 -0800
Committer: grey <greyes@apigee.com>
Committed: Thu Mar 6 10:06:10 2014 -0800

----------------------------------------------------------------------
 .../applications/ApplicationResource.java       |  2 -
 .../rest/management/ManagementResourceIT.java   | 40 ++++-----
 .../apache/usergrid/management/ExportInfo.java  | 86 --------------------
 .../usergrid/management/export/ExportJob.java   | 17 ----
 .../cassandra/ManagementServiceIT.java          | 48 +----------
 5 files changed, 21 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb606aa7/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
index bf44877..4bb81d5 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
@@ -227,8 +227,6 @@ public class ApplicationResource extends AbstractContextResource {
 
 //TODO: do input verification here! make sure json map has all correct values.
         try {
-            //parse the json into some useful object (the config params)
-            //ExportInfo objEx = new ExportInfo( json );
             if((properties = ( Map<String, Object> )  json.get( "properties" )) ==
null){
                 throw new NullPointerException("Could not find 'properties'");
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb606aa7/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
index 0c8e99a..9143ffd 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
@@ -531,26 +531,26 @@ public class ManagementResourceIT extends AbstractRestIT {
 
         assertEquals( Status.OK, status );
     }
-//
-//
-//    @Test
-//    public void exportCallSuccessful() throws Exception {
-//        Status responseStatus = Status.OK;
-//        JsonNode node = null;
-//
-//        HashMap<String, Object> payload = payloadBuilder();
-//
-//        try {
-//            node = resource().path( "/management/orgs/test-organization/apps/test-app/collection/users/export"
)
-//                             .queryParam( "access_token", superAdminToken() ).accept( MediaType.APPLICATION_JSON
)
-//                             .type( MediaType.APPLICATION_JSON_TYPE ).post( JsonNode.class,
payload );
-//        }
-//        catch ( UniformInterfaceException uie ) {
-//            responseStatus = uie.getResponse().getClientResponseStatus();
-//        }
-//
-//        assertEquals( Status.OK, responseStatus );
-//    }
+
+
+    @Test
+    public void exportCallSuccessful() throws Exception {
+        Status responseStatus = Status.OK;
+        JsonNode node = null;
+
+        HashMap<String, Object> payload = payloadBuilder();
+
+        try {
+            node = resource().path( "/management/orgs/test-organization/apps/test-app/collection/users/export"
)
+                             .queryParam( "access_token", superAdminToken() ).accept( MediaType.APPLICATION_JSON
)
+                             .type( MediaType.APPLICATION_JSON_TYPE ).post( JsonNode.class,
payload );
+        }
+        catch ( UniformInterfaceException uie ) {
+            responseStatus = uie.getResponse().getClientResponseStatus();
+        }
+
+        assertEquals( Status.OK, responseStatus );
+    }
 
 //is this test still valid knowing that the sch. won't run in intelliJ?
     @Ignore

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb606aa7/stack/services/src/main/java/org/apache/usergrid/management/ExportInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/ExportInfo.java b/stack/services/src/main/java/org/apache/usergrid/management/ExportInfo.java
deleted file mode 100644
index fecf700..0000000
--- a/stack/services/src/main/java/org/apache/usergrid/management/ExportInfo.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.usergrid.management;
-
-
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.usergrid.persistence.TypedEntity;
-
-
-/**
- * Created by ApigeeCorporation on 1/31/14.
- */
-//TODO: Documentation on this class.
-public class ExportInfo extends TypedEntity {
-
-    private String path;
-    private Map<String, Object> properties;
-    private String storage_provider;
-    private Map<String, Object> storage_info;
-    private String s3_accessId;
-    private String s3_key;
-    private String bucket_location;
-    private UUID applicationId; //TODO: include application when initializing export info
-    private String collection;  //TODO: include collection when initializing export info
-    private UUID organizationId;
-
-
-    public ExportInfo( Map<String, Object> exportData )  {
-        if(exportData == null) {
-            throw new NullPointerException(  );
-        }
-        if(exportData.get( "properties" ) == null) {
-            throw new NullPointerException(  );
-        }
-        properties = ( Map ) exportData.get( "properties" );
-        storage_provider = ( String ) properties.get( "storage_provider" );
-        storage_info = ( Map ) properties.get( "storage_info" );
-        s3_accessId = ( String ) storage_info.get( "s3_accessId" );
-        s3_key = ( String ) storage_info.get( "s3_key" );
-        bucket_location = ( String ) storage_info.get( "bucket_location" );
-    }
-
-    public String getCollection() { return collection; }
-
-    public UUID getApplicationId() {
-        return applicationId;
-    }
-
-    public UUID getOrganizationId() { return organizationId; }
-
-   // public String getPath() {
-   //     return path;
-    //}
-
-
-    //Wouldn't get exposed.
-    public Map<String, Object> getProperties() {
-        return properties;
-    }
-
-
-    public String getStorage_provider() {
-        return storage_provider;
-    }
-    //TODO: write setter methods
-
-
-    public Map<String, Object> getStorage_info() { return storage_info; }
-
-
-    //TODO: is this a security concern? How would we get rid of the key once we're done with
this value?
-    public String getS3_key() { return s3_key; }
-
-
-    public String getBucket_location() { return bucket_location; }
-
-
-    public String getS3_accessId() { return s3_accessId; }
-
-
-    public void setApplicationId( UUID appId ) { applicationId = appId;}
-
-    public void setCollection ( String colName) { collection = colName; }
-
-    public void setOrganizationId ( UUID orgId ) { organizationId = orgId; }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb606aa7/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
index 82bef54..ddabba3 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
@@ -1,8 +1,6 @@
 package org.apache.usergrid.management.export;
 
 
-import java.util.UUID;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,26 +32,11 @@ public class ExportJob extends OnlyOnceJob {
     public void doJob( JobExecution jobExecution ) throws Exception {
         logger.info( "execute ExportJob {}", jobExecution );
 
-        UUID exportId = ( UUID ) jobExecution.getJobData().getProperty( EXPORT_ID );
-        //as long as I have the entity UUID I should be able to find it from anywhere right?
-
-
         JobData jobData = jobExecution.getJobData();
         if ( jobData == null ) {
             logger.error( "jobData cannot be null" );
             return;
         }
-//        Object temp = jobData.getProperty("exportInfo");
-
-
-//        if(temp.get("exportInfo") instanceof ExportInfo)
-//        {
-//            config = ( ExportInfo ) temp.get("exportInfo");
-//        }
-//        if ( config == null ) {
-//            logger.error( "Export information cannot be null" );
-//            return;
-//        }
 
         jobExecution.heartbeat();
         try {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb606aa7/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
index 8734dbc..4184262 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
@@ -768,10 +768,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-//        exportInfo.setCollection( "users" );
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId );
         payload.put("collectionName","users");
@@ -854,9 +850,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
         payload.put("organizationId",organization.getUuid());
         payload.put("applicationId",applicationId);
 
@@ -941,11 +934,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-//        exportInfo.setCollection( "users" );
-
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
         payload.put( "collectionName","users");
@@ -993,10 +981,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
 
@@ -1047,11 +1031,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-//        exportInfo.setCollection( "roles" );
-
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
         payload.put( "collectionName","roles");
@@ -1121,11 +1100,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-//        exportInfo.setCollection( "roles" ); // <- this line determines if it is a collection
back up or a application backup.
-
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
 
@@ -1192,10 +1166,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
 
@@ -1259,10 +1229,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
-//        exportInfo.setCollection( "baconators" );
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
         payload.put( "collectionName","baconators");
@@ -1287,17 +1253,11 @@ public class ManagementServiceIT {
         assertEquals( entitiesToCreate , a.size() );
         f.delete();
     }
-//
-//
-//    //only handles the DoJob Code , different tests for DoExport
+
     @Test
     public void testExportDoJob() throws Exception {
 
         HashMap<String, Object> payload = payloadBuilder();
-
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
         payload.put( "organizationId",organization.getUuid() );
         payload.put( "applicationId",applicationId);
 
@@ -1332,9 +1292,6 @@ public class ManagementServiceIT {
 
         JobExecution jobExecution = mock( JobExecution.class );
 
-//        ExportInfo exportInfo = new ExportInfo( payload );
-//        exportInfo.setOrganizationId( organization.getUuid() );
-//        exportInfo.setApplicationId( applicationId );
         payload.put("organizationId",organization.getUuid());
         payload.put("applicationId",applicationId);
 
@@ -1419,9 +1376,6 @@ public class ManagementServiceIT {
         ExportService exportService = setup.getExportService();
         HashMap<String, Object> payload = payloadBuilder();
 
-       // ExportInfo exportInfo = new ExportInfo( payload );
-        //exportInfo.setApplicationId( applicationId );
-
         payload.put("applicationId",applicationId);
 
         EntityManager em = setup.getEmf().getEntityManager( applicationId );


Mime
View raw message