airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [5/5] airavata git commit: adding data mover code to data manager
Date Wed, 16 Dec 2015 23:21:55 GMT
adding data mover code to data manager


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

Branch: refs/heads/master
Commit: 6572a821436871df07d5747949c16c14fce69444
Parents: 36da4ee
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed Dec 16 18:21:39 2015 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Wed Dec 16 18:21:39 2015 -0500

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |    62 +-
 .../java/org/apache/airavata/api/Airavata.java  | 37488 +++++++++--------
 .../main/resources/lib/airavata/Airavata.cpp    |   569 +
 .../src/main/resources/lib/airavata/Airavata.h  |   170 +
 .../lib/airavata/Airavata_server.skeleton.cpp   |     5 +
 .../resources/lib/Airavata/API/Airavata.php     |   402 +
 .../lib/apache/airavata/api/Airavata-remote     |     7 +
 .../lib/apache/airavata/api/Airavata.py         |   320 +
 .../data/catalog/core/DataManagerFactory.java   |    34 -
 .../data/catalog/core/DataManagerImpl.java      |   207 -
 .../data/manager/core/DataManagerFactory.java   |    34 +
 .../data/manager/core/DataManagerImpl.java      |   393 +
 .../data/manager/core/ssh/CommandOutput.java    |    34 +
 .../data/manager/core/ssh/SSHApiException.java  |    33 +
 .../data/manager/core/ssh/SSHUtils.java         |   505 +
 .../manager/core/ssh/StandardOutReader.java     |    86 +
 .../manager/core/DataManagerFactoryTest.java    |    45 +
 .../data/manager/core/DataManagerImplTest.java  |   208 +
 .../data/manager/core/utils/AppCatInit.java     |   320 +
 .../data/manager/core/utils/DataCatInit.java    |   315 +
 .../catalog/core/DataManagerFactoryTest.java    |    41 -
 .../data/catalog/core/DataManagerImplTest.java  |   205 -
 .../data/catalog/core/utils/AppCatInit.java     |   320 -
 .../data/catalog/core/utils/DataCatInit.java    |   315 -
 .../airavata/data/catalog/cpi/DataManager.java  |    98 -
 .../data/catalog/cpi/DataManagerConstants.java  |    28 -
 .../data/catalog/cpi/DataManagerException.java  |    35 -
 .../airavata/data/manager/cpi/DataManager.java  |   109 +
 .../data/manager/cpi/DataManagerConstants.java  |    28 +
 .../data/manager/cpi/DataManagerException.java  |    35 +
 modules/data-manager/pom.xml                    |     4 +
 .../airavata-apis/airavata_api.thrift           |    10 +
 32 files changed, 23212 insertions(+), 19253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/6572a821/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 1ad1536..0917f5e 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -32,9 +32,9 @@ import org.apache.airavata.credential.store.client.CredentialStoreClientFactory;
 import org.apache.airavata.credential.store.cpi.CredentialStoreService;
 import org.apache.airavata.credential.store.datamodel.SSHCredential;
 import org.apache.airavata.credential.store.exception.CredentialStoreException;
-import org.apache.airavata.data.catalog.core.DataManagerFactory;
-import org.apache.airavata.data.catalog.cpi.DataManager;
-import org.apache.airavata.data.catalog.cpi.DataManagerException;
+import org.apache.airavata.data.manager.core.DataManagerFactory;
+import org.apache.airavata.data.manager.cpi.DataManager;
+import org.apache.airavata.data.manager.cpi.DataManagerException;
 import org.apache.airavata.messaging.core.MessageContext;
 import org.apache.airavata.messaging.core.Publisher;
 import org.apache.airavata.messaging.core.PublisherFactory;
@@ -4069,17 +4069,6 @@ public class AiravataServerHandler implements Airavata.Iface {
      * *
      */
 
-    /**
-     * Create new data resource. Resourse ID is returned
-     * @param authzToken
-     * @param dataResourceModel
-     * @return
-     * @throws InvalidRequestException
-     * @throws AiravataClientException
-     * @throws AiravataSystemException
-     * @throws AuthorizationException
-     * @throws TException
-     */
     @Override
     @SecurityCheck
     public String registerDataResource(AuthzToken authzToken, DataResourceModel dataResourceModel)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
@@ -4095,16 +4084,6 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    /**
-     * Update exisiting data resource
-     * @param authzToken
-     * @param dataResourceModel
-     * @throws InvalidRequestException
-     * @throws AiravataClientException
-     * @throws AiravataSystemException
-     * @throws AuthorizationException
-     * @throws TException
-     */
     @Override
     @SecurityCheck
     public void updateDataResource(AuthzToken authzToken, DataResourceModel dataResourceModel)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
@@ -4120,16 +4099,6 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    /**
-     * Remove existing data resource
-     * @param authzToken
-     * @param resourceId
-     * @throws InvalidRequestException
-     * @throws AiravataClientException
-     * @throws AiravataSystemException
-     * @throws AuthorizationException
-     * @throws TException
-     */
     @Override
     @SecurityCheck
     public void removeDataResource(AuthzToken authzToken, String resourceId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
@@ -4145,17 +4114,6 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    /**
-     * Retreive existing data resource
-     * @param authzToken
-     * @param resourceId
-     * @return
-     * @throws InvalidRequestException
-     * @throws AiravataClientException
-     * @throws AiravataSystemException
-     * @throws AuthorizationException
-     * @throws TException
-     */
     @Override
     @SecurityCheck
     public DataResourceModel getDataResource(AuthzToken authzToken, String resourceId) throws
InvalidRequestException,
@@ -4172,6 +4130,20 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
+    @Override
+    public String copyDataResource(AuthzToken authzToken, String resourceId, String destStorageResourceId,
String destinationParentPath) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
+        try {
+            DataManager dataManager = DataManagerFactory.getDataManager();
+            return dataManager.copyResource(resourceId, destStorageResourceId, destinationParentPath);
+        } catch (DataManagerException e) {
+            String msg = "Error in copying the data resource "+resourceId+".";
+            logger.error(msg, e);
+            AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage(msg+" More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
     private WorkflowCatalog getWorkflowCatalog() {
 		if (workflowCatalog == null) {
 			try {


Mime
View raw message