airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [8/8] airavata git commit: adding data storage interfaces
Date Wed, 18 Nov 2015 00:58:02 GMT
adding data storage interfaces


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

Branch: refs/heads/develop
Commit: 13b50f7a50ee55439ad7cef5b73978a448b68d3f
Parents: c116140
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Tue Nov 17 19:57:45 2015 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Tue Nov 17 19:57:45 2015 -0500

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   34 +-
 .../java/org/apache/airavata/api/Airavata.java  | 1556 +++++++++---------
 .../main/resources/lib/airavata/Airavata.cpp    |  434 ++---
 .../src/main/resources/lib/airavata/Airavata.h  |  464 +++---
 .../lib/airavata/Airavata_server.skeleton.cpp   |   20 +-
 .../gateway_resource_profile_model_types.cpp    |   84 +-
 .../gateway_resource_profile_model_types.h      |   48 +-
 .../resources/lib/Airavata/API/Airavata.php     |  292 ++--
 .../Model/AppCatalog/GatewayProfile/Types.php   |   50 +-
 .../lib/apache/airavata/api/Airavata-remote     |   40 +-
 .../lib/apache/airavata/api/Airavata.py         |  322 ++--
 .../model/appcatalog/gatewayprofile/ttypes.py   |   50 +-
 .../gatewayprofile/DataStoragePreference.java   |  728 --------
 .../gatewayprofile/GatewayResourceProfile.java  |  152 +-
 .../gatewayprofile/StoragePreference.java       |  728 ++++++++
 .../core/utils/OrchestratorUtils.java           |    9 +-
 .../catalog/impl/GwyResourceProfileImpl.java    |   44 +-
 .../app/catalog/impl/StorageResourceImpl.java   |    6 +-
 .../app/catalog/model/DataStorageInterface.java |  113 --
 .../catalog/model/DataStorageInterface_PK.java  |   62 -
 .../catalog/model/DataStoragePreference.java    |   96 --
 .../catalog/model/DataStoragePreferencePK.java  |   64 -
 .../app/catalog/model/DataStorageResource.java  |    2 +-
 .../app/catalog/model/StorageInterface.java     |  102 ++
 .../app/catalog/model/StorageInterface_PK.java  |   62 +
 .../app/catalog/model/StoragePreference.java    |   95 ++
 .../app/catalog/model/StoragePreferencePK.java  |   64 +
 .../core/app/catalog/model/StorageResource.java |   56 +-
 .../resources/AppCatAbstractResource.java       |   33 +-
 .../DataStoragePreferenceResource.java          |  323 ----
 .../resources/StorageInterfaceResource.java     |  326 ++++
 .../resources/StoragePreferenceResource.java    |  322 ++++
 .../resources/StorageResourceResource.java      |   28 +-
 .../app/catalog/util/AppCatalogJPAUtils.java    |   48 +-
 .../catalog/util/AppCatalogResourceType.java    |    5 +-
 .../util/AppCatalogThriftConversion.java        |   22 +-
 .../src/main/resources/META-INF/persistence.xml |    2 +-
 .../src/main/resources/appcatalog-derby.sql     |   11 +-
 .../registry/cpi/GwyResourceProfile.java        |    6 +-
 .../airavata-api/airavata_api.thrift            |   20 +-
 .../gateway_resource_profile_model.thrift       |    6 +-
 41 files changed, 3645 insertions(+), 3284 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/13b50f7a/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 ab0e146..cfb754c 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
@@ -41,8 +41,8 @@ import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.computeresource.*;
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
-import org.apache.airavata.model.appcatalog.gatewayprofile.DataStoragePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
+import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
 import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
@@ -67,8 +67,6 @@ import org.apache.airavata.registry.core.app.catalog.resources.*;
 import org.apache.airavata.registry.core.app.catalog.util.AppCatalogThriftConversion;
 import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
 import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
-import org.apache.airavata.registry.core.experiment.catalog.model.*;
-import org.apache.airavata.registry.core.experiment.catalog.model.Process;
 import org.apache.airavata.registry.cpi.*;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.thrift.TException;
@@ -3586,7 +3584,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public boolean addGatewayDataStoragePreference(AuthzToken authzToken, String gatewayID,
String dataMoveId, DataStoragePreference dataStoragePreference) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+    public boolean addGatewayStoragePreference(AuthzToken authzToken, String gatewayID, String
dataMoveId, StoragePreference dataStoragePreference) throws InvalidRequestException, AiravataClientException,
AiravataSystemException, AuthorizationException, TException {
         try {
             if (!isGatewayExistInternal(gatewayID)){
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
@@ -3599,7 +3597,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             GatewayResourceProfile profile = gatewayProfile.getGatewayProfile(gatewayID);
 //            gatewayProfile.removeGatewayResourceProfile(gatewayID);
-            profile.addToDataStoragePreferences(dataStoragePreference);
+            profile.addToStoragePreferences(dataStoragePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
             return true;
         } catch (AppCatalogException e) {
@@ -3656,7 +3654,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public DataStoragePreference getGatewayDataStoragePreference(AuthzToken authzToken, String
gatewayID, String dataMoveId) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
+    public StoragePreference getGatewayStoragePreference(AuthzToken authzToken, String gatewayID,
String dataMoveId) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         try {
             if (!isGatewayExistInternal(gatewayID)){
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
@@ -3673,7 +3671,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 throw exception;
             }
 
-            return gatewayProfile.getDataStoragePreference(gatewayID, dataMoveId);
+            return gatewayProfile.getStoragePreference(gatewayID, dataMoveId);
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway data storage preference...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3712,7 +3710,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public List<DataStoragePreference> getAllGatewayDataStoragePreferences(AuthzToken
authzToken, String gatewayID) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
+    public List<StoragePreference> getAllGatewayStoragePreferences(AuthzToken authzToken,
String gatewayID) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         try {
             if (!isGatewayExistInternal(gatewayID)){
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
@@ -3720,7 +3718,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
-            return gatewayProfile.getGatewayProfile(gatewayID).getDataStoragePreferences();
+            return gatewayProfile.getGatewayProfile(gatewayID).getStoragePreferences();
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway data storage preferences...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3793,7 +3791,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public boolean updateGatewayDataStoragePreference(AuthzToken authzToken, String gatewayID,
String dataMoveId, DataStoragePreference dataStoragePreference) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+    public boolean updateGatewayStoragePreference(AuthzToken authzToken, String gatewayID,
String storageId, StoragePreference dataStoragePreference) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
         try {
             if (!isGatewayExistInternal(gatewayID)){
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
@@ -3802,19 +3800,19 @@ public class AiravataServerHandler implements Airavata.Iface {
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             GatewayResourceProfile profile = gatewayProfile.getGatewayProfile(gatewayID);
-            List<DataStoragePreference> dataStoragePreferences = profile.getDataStoragePreferences();
-            DataStoragePreference preferenceToRemove = null;
-            for (DataStoragePreference preference : dataStoragePreferences) {
-                if (preference.getDataMovememtResourceId().equals(dataMoveId)){
+            List<StoragePreference> dataStoragePreferences = profile.getStoragePreferences();
+            StoragePreference preferenceToRemove = null;
+            for (StoragePreference preference : dataStoragePreferences) {
+                if (preference.getStorageResourceId().equals(storageId)){
                     preferenceToRemove=preference;
                     break;
                 }
             }
             if (preferenceToRemove!=null) {
-                profile.getDataStoragePreferences().remove(
+                profile.getStoragePreferences().remove(
                         preferenceToRemove);
             }
-            profile.getDataStoragePreferences().add(dataStoragePreference);
+            profile.getStoragePreferences().add(dataStoragePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
             return true;
         } catch (AppCatalogException e) {
@@ -3856,7 +3854,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     @Override
-    public boolean deleteGatewayDataStoragePreference(AuthzToken authzToken, String gatewayID,
String dataMoveId) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
+    public boolean deleteGatewayStoragePreference(AuthzToken authzToken, String gatewayID,
String storageId) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         try {
             if (!isGatewayExistInternal(gatewayID)){
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
@@ -3864,7 +3862,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
-            return gatewayProfile.removeDataStoragePreferenceFromGateway(gatewayID, dataMoveId);
+            return gatewayProfile.removeDataStoragePreferenceFromGateway(gatewayID, storageId);
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway data storage preference...",
e);
             AiravataSystemException exception = new AiravataSystemException();


Mime
View raw message