airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [05/50] [abbrv] airavata git commit: Change to GATEWAY_ID in credential store DOA
Date Thu, 19 Mar 2015 19:11:23 GMT
Change to GATEWAY_ID in credential store DOA


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

Branch: refs/heads/new-workflow-design
Commit: 9d960f76b0f35a2f704d2af04a5af19d9cfd2ed4
Parents: b25e0a5
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Fri Mar 6 10:10:57 2015 -0500
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Fri Mar 6 10:10:57 2015 -0500

----------------------------------------------------------------------
 .../airavata/api/airavataAPIConstants.java      |  2 +-
 .../lib/airavata/airavataAPI_constants.cpp      |  2 +-
 .../main/resources/lib/Airavata/API/Types.php   |  2 +-
 .../client/samples/CreateLaunchExperiment.java  | 68 +++++++++++++++++---
 .../airavataAPI.thrift                          |  2 +-
 .../store/store/impl/db/CommunityUserDAO.java   | 10 +--
 .../registry/jpa/impl/RegistryImpl.java         |  1 +
 .../src/main/resources/registry-derby.sql       |  2 +-
 .../src/main/resources/registry-mysql.sql       |  2 +-
 .../src/test/resources/registry-derby.sql       |  2 +-
 10 files changed, 72 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
index 3685b9f..0c82e0f 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
@@ -65,6 +65,6 @@ import org.slf4j.LoggerFactory;
    *              in a change to major/minor version numbers.
    * 
    */
-  public static final String AIRAVATA_API_VERSION = "0.14.0";
+  public static final String AIRAVATA_API_VERSION = "0.15.0";
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
index 0161d32..ddc6179 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/airavataAPI_constants.cpp
@@ -28,7 +28,7 @@ namespace apache { namespace airavata { namespace api {
 const airavataAPIConstants g_airavataAPI_constants;
 
 airavataAPIConstants::airavataAPIConstants() {
-  AIRAVATA_API_VERSION = "0.14.0";
+  AIRAVATA_API_VERSION = "0.15.0";
 
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
index cb100bc..481421f 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Types.php
@@ -17,6 +17,6 @@ use Thrift\Protocol\TBinaryProtocolAccelerated;
 use Thrift\Exception\TApplicationException;
 
 
-$GLOBALS['airavataAPI_CONSTANTS']['AIRAVATA_API_VERSION'] = "0.14.0";
+$GLOBALS['airavataAPI_CONSTANTS']['AIRAVATA_API_VERSION'] = "0.15.0";
 
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index eb1b833..3fc74eb 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -36,6 +36,7 @@ import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission
 import org.apache.airavata.model.error.*;
 import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.airavata.model.util.ProjectModelUtil;
+import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.thrift.TException;
@@ -60,7 +61,7 @@ public class CreateLaunchExperiment {
     private static String echoAppId = "Echo_f828a575-7f17-4149-9d45-abe2aa9c6109";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-    private static String amberAppId = "Amber_6321b79f-3891-4421-b6c0-e294043a302e";
+    private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
     private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
@@ -74,21 +75,70 @@ public class CreateLaunchExperiment {
     private static String unicoreHostName = "fsd-cloud15.zam.kfa-juelich.de";
     private static String stampedeHostName = "stampede.tacc.xsede.org";
     private static String br2HostName = "bigred2.uits.iu.edu";
+
+    private static String gatewayId;
     
  // unicore service endpoint url
     private static final String unicoreEndPointURL = "https://fsd-cloud15.zam.kfa-juelich.de:7000/INTEROP1/services/BESFactory?res=default_bes_factory";
     
     
     public static void main(String[] args) throws Exception {
-                airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST,
THRIFT_SERVER_PORT);
-                System.out.println("API version is " + airavataClient.getAPIVersion());
-//                registerApplications(); // run this only the first time
-                createAndLaunchExp();
+        airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+        System.out.println("API version is " + airavataClient.getAPIVersion());
+//        createGateway();
+//        getGateway("testGatewayId");
+//      registerApplications(); // run this only the first time
+      createAndLaunchExp();
     }
     
     private static String fsdResourceId;
 
 
+    public static void createGateway(){
+        try {
+            Gateway gateway = new Gateway();
+            gateway.setGatewayId("testGatewayId2");
+            gateway.setGatewayName("testGateway2");
+            gatewayId = airavataClient.addGateway(gateway);
+            System.out.println(gatewayId);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public static void getGateway(String gatewayId){
+        try {
+            Gateway gateway = airavataClient.getGateway(gatewayId);
+            gateway.setDomain("testDomain");
+            airavataClient.updateGateway(gatewayId, gateway);
+            List<Gateway> allGateways = airavataClient.getAllGateways();
+            System.out.println(allGateways.size());
+            if (airavataClient.isGatewayExist(gatewayId)){
+                Gateway gateway1 = airavataClient.getGateway(gatewayId);
+                System.out.println(gateway1.getGatewayName());
+            }
+            boolean b = airavataClient.deleteGateway("testGatewayId2");
+            System.out.println(b);
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
     public static void createAndLaunchExp() throws TException {
 //        final String expId = createEchoExperimentForFSD(airavataClient);
         try {
@@ -115,7 +165,7 @@ public class CreateLaunchExperiment {
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);
 
-//                launchExperiment(airavataClient, expId);
+                launchExperiment(airavataClient, expId);
             }
         } catch (Exception e) {
             logger.error("Error while connecting with server", e.getMessage());
@@ -1437,11 +1487,11 @@ public class CreateLaunchExperiment {
 //			}
 			for (InputDataObjectType inputDataObjectType : exInputs) {
 					if (inputDataObjectType.getName().equalsIgnoreCase("Heat_Restart_File")) {
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/02_Heat.rst");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/02_Heat.rst");
 					} else if (inputDataObjectType.getName().equalsIgnoreCase("Production_Control_File"))
{
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/03_Prod.in");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/03_Prod.in");
 					} else if (inputDataObjectType.getName().equalsIgnoreCase("Parameter_Topology_File"))
{
-						inputDataObjectType.setValue("file://root@test-drive.airavata.org:/var/www/experimentData/admin101a290e6330f15a91349159553ae8b6bb1/prmtop");
+						inputDataObjectType.setValue("/Users/chathuri/dev/airavata/source/php/inputs/AMBER_FILES/prmtop");
 					}
 			}
 			List<OutputDataObjectType> exOut = client.getApplicationOutputs(amberAppId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 6caf264..95a91e6 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -55,7 +55,7 @@ namespace js ApacheAiravataAPI
  *              in a change to major/minor version numbers.
  *
 */
-const string AIRAVATA_API_VERSION = "0.14.0"
+const string AIRAVATA_API_VERSION = "0.15.0"
 
 service Airavata {
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
index f55cd55..931580a 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/store/impl/db/CommunityUserDAO.java
@@ -78,7 +78,7 @@ public class CommunityUserDAO extends ParentDAO {
 
     public void deleteCommunityUser(CommunityUser user, Connection connection) throws CredentialStoreException
{
 
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -108,7 +108,7 @@ public class CommunityUserDAO extends ParentDAO {
     public void deleteCommunityUserByToken(CommunityUser user, String token, Connection connection)
             throws CredentialStoreException {
 
-        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?
AND TOKEN_ID=?";
+        String sql = "DELETE FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=?
AND TOKEN_ID=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -144,7 +144,7 @@ public class CommunityUserDAO extends ParentDAO {
     public CommunityUser getCommunityUser(String gatewayName, String communityUserName, Connection
connection)
             throws CredentialStoreException {
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND COMMUNITY_USER_NAME=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND COMMUNITY_USER_NAME=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -181,7 +181,7 @@ public class CommunityUserDAO extends ParentDAO {
     public CommunityUser getCommunityUserByToken(String gatewayName, String tokenId, Connection
connection)
             throws CredentialStoreException {
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=? AND TOKEN_ID=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=? AND TOKEN_ID=?";
 
         PreparedStatement preparedStatement = null;
 
@@ -221,7 +221,7 @@ public class CommunityUserDAO extends ParentDAO {
 
         List<CommunityUser> userList = new ArrayList<CommunityUser>();
 
-        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_NAME=?";
+        String sql = "SELECT * FROM COMMUNITY_USER WHERE GATEWAY_ID=?";
 
         PreparedStatement preparedStatement = null;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index d2af1cd..9dcf96f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@ -204,6 +204,7 @@ public class RegistryImpl implements Registry {
                     break;
                 case GATEWAY:
                     gatewayRegistry.updateGateway((String)identifier, (Gateway)newObjectToUpdate);
+                    break;
                 case EXPERIMENT:
                     experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, (String)
identifier);
                     break;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index 9d02c3a..b7c8a7d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index ec2fb42..442a47b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/9d960f76/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index 9d02c3a..b7c8a7d 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -36,7 +36,7 @@ CREATE TABLE CONFIGURATION
         PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
 );
 
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.12', CURRENT_TIMESTAMP ,'SYSTEM');
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version',
'0.15', CURRENT_TIMESTAMP ,'SYSTEM');
 
 CREATE TABLE USERS
 (


Mime
View raw message