moving credential-store data model thrift file to data-models directory

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

Branch: refs/heads/develop
Commit: c9e26ec359c79d3d321e67060aac994941523e2f
Parents: 8e59d80
Author: Anuj Bhandar <bhandar.a...@gmail.com>
Authored: Wed Oct 12 16:36:46 2016 -0400
Committer: Anuj Bhandar <bhandar.a...@gmail.com>
Committed: Wed Oct 12 16:36:46 2016 -0400

----------------------------------------------------------------------
 .../component-cpis/credential-store-cpi.thrift  |  2 +-
 .../credential_store_data_models.thrift         | 72 --------------------
 .../credential_store_data_models.thrift         | 72 ++++++++++++++++++++
 .../generate-thrift-stubs.sh                    | 24 +++++++
 4 files changed, 97 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c9e26ec3/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift
----------------------------------------------------------------------
diff --git 
a/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift 
b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift
index 36e7980..923a192 100644
--- a/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift
+++ b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift
@@ -23,7 +23,7 @@
  *
 */
 
-include "credential_store_data_models.thrift"
+include 
"../data-models/credential-store-models/credential_store_data_models.thrift"
 include "credential_store_errors.thrift"
 
 namespace java org.apache.airavata.credential.store.cpi

http://git-wip-us.apache.org/repos/asf/airavata/blob/c9e26ec3/thrift-interface-descriptions/component-cpis/credential_store_data_models.thrift
----------------------------------------------------------------------
diff --git 
a/thrift-interface-descriptions/component-cpis/credential_store_data_models.thrift
 
b/thrift-interface-descriptions/component-cpis/credential_store_data_models.thrift
deleted file mode 100644
index f2c2c77..0000000
--- 
a/thrift-interface-descriptions/component-cpis/credential_store_data_models.thrift
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-
-namespace java org.apache.airavata.credential.store.datamodel
-namespace php Airavata.Model.Credential.Store
-
-const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS"
-
-struct SSHCredential {
-    1: required string gatewayId,
-    2: required string username,
-    3: optional string passphrase,
-    4: optional string publicKey,
-    5: optional string privateKey,
-    6: optional i64 persistedTime,
-    7: optional string token,
-    8: optional string description
-}
-
-struct SSHCredentialSummary {
-    1: required string gatewayId,
-    2: required string username,
-    3: optional string publicKey,
-    4: optional i64 persistedTime,
-    5: required string token,
-    6: optional string description
-}
-
-struct CommunityUser {
-    1: required string gatewayName,
-    2: required string username,
-    3: required string userEmail
-}
-
-struct CertificateCredential {
-    1: required CommunityUser communityUser,
-    2: required string x509Cert,
-    3: optional string notAfter,
-    4: optional string privateKey,
-    5: optional i64 lifeTime,
-    6: optional string notBefore
-    7: optional i64 persistedTime,
-    8: optional string token
-}
-
-struct PasswordCredential {
-    1: required string gatewayId,
-    2: required string portalUserName,
-    3: required string loginUserName,
-    4: required string password,
-    5: optional string description,
-    6: optional i64 persistedTime,
-    7: optional string token
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/c9e26ec3/thrift-interface-descriptions/data-models/credential-store-models/credential_store_data_models.thrift
----------------------------------------------------------------------
diff --git 
a/thrift-interface-descriptions/data-models/credential-store-models/credential_store_data_models.thrift
 
b/thrift-interface-descriptions/data-models/credential-store-models/credential_store_data_models.thrift
new file mode 100644
index 0000000..f2c2c77
--- /dev/null
+++ 
b/thrift-interface-descriptions/data-models/credential-store-models/credential_store_data_models.thrift
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+namespace java org.apache.airavata.credential.store.datamodel
+namespace php Airavata.Model.Credential.Store
+
+const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS"
+
+struct SSHCredential {
+    1: required string gatewayId,
+    2: required string username,
+    3: optional string passphrase,
+    4: optional string publicKey,
+    5: optional string privateKey,
+    6: optional i64 persistedTime,
+    7: optional string token,
+    8: optional string description
+}
+
+struct SSHCredentialSummary {
+    1: required string gatewayId,
+    2: required string username,
+    3: optional string publicKey,
+    4: optional i64 persistedTime,
+    5: required string token,
+    6: optional string description
+}
+
+struct CommunityUser {
+    1: required string gatewayName,
+    2: required string username,
+    3: required string userEmail
+}
+
+struct CertificateCredential {
+    1: required CommunityUser communityUser,
+    2: required string x509Cert,
+    3: optional string notAfter,
+    4: optional string privateKey,
+    5: optional i64 lifeTime,
+    6: optional string notBefore
+    7: optional i64 persistedTime,
+    8: optional string token
+}
+
+struct PasswordCredential {
+    1: required string gatewayId,
+    2: required string portalUserName,
+    3: required string loginUserName,
+    4: required string password,
+    5: optional string description,
+    6: optional i64 persistedTime,
+    7: optional string token
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/c9e26ec3/thrift-interface-descriptions/generate-thrift-stubs.sh
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/generate-thrift-stubs.sh 
b/thrift-interface-descriptions/generate-thrift-stubs.sh
index 4a9550a..949ce2e 100755
--- a/thrift-interface-descriptions/generate-thrift-stubs.sh
+++ b/thrift-interface-descriptions/generate-thrift-stubs.sh
@@ -69,12 +69,14 @@ 
DATAMODEL_THRIFT_FILE='data-models/airavata_data_models.thrift'
 
APP_CATALOG_THRIFT_FILE='data-models/app-catalog-models/app_catalog_models.thrift'
 
RESOURCE_CATALOG_THRIFT_FILE='data-models/resource-catalog-models/resource_catalog_models.thrift'
 WORKFLOW_THRIFT_FILE='data-models/workflow-models/workflow_data_model.thrift'
+CREDENTIAL_STORE_DATAMODEL_THRIFT_FILE='data-models/credential-store-models/credential_store_data_models.thrift'
 
 DATAMODEL_SRC_DIR='../airavata-api/airavata-data-models/src/main/java'
 JAVA_API_SDK_DIR='../airavata-api/airavata-api-stubs/src/main/java'
 
PHP_SDK_DIR='../airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib'
 
CPP_SDK_DIR='../airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/'
 
PYTHON_SDK_DIR='../airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/'
+CREDENTIAL_DATAMODEL_SRC_DIR='../modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel'
 
 # Initialize the thrift arguments.
 #  Since most of the Airavata API and Data Models have includes, use recursive 
option by default.
@@ -184,6 +186,27 @@ generate_java_stubs() {
     # As a precaution  remove and previously generated files if exists
     rm -rf ${JAVA_GEN_DIR}
 
+    # Generate the credential store data models in move them to respective 
modules/credential-store directory
+
+     $THRIFT_EXEC ${THRIFT_ARGS} --gen java:beans 
${CREDENTIAL_STORE_DATAMODEL_THRIFT_FILE} || fail unable to generate java bean 
thrift classes on app workflow data models
+
+    # For the generated java beans add the ASF V2 License header
+    add_license_header $JAVA_BEAN_GEN_DIR
+
+    # Compare the newly generated beans with existing sources and replace the 
changed ones.
+    copy_changed_files 
${JAVA_BEAN_GEN_DIR}/org/apache/airavata/credential/store/datamodel} 
${CREDENTIAL_DATAMODEL_SRC_DIR}
+
+    
###############################################################################
+    # Generate/Update source used by Airavata Server Skeletons & Java Client 
Stubs #
+    #  JAVA server and client both use generated api-boilerplate-code          
   #
+    
###############################################################################
+
+    #Java generation directory
+    JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
+
+    # As a precaution  remove and previously generated files if exists
+    rm -rf ${JAVA_GEN_DIR}
+
     # Using thrift Java generator, generate the java classes based on Airavata 
API. This
     #   The airavata_api.thrift includes rest of data models.
     $THRIFT_EXEC ${THRIFT_ARGS} --gen java ${AIRAVATA_API_THRIFT_FILE} || fail 
unable to generate java thrift classes on AiravataAPI
@@ -216,6 +239,7 @@ generate_php_stubs() {
     $THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload ${APP_CATALOG_THRIFT_FILE}  
|| fail unable to generate PHP thrift classes
     $THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload 
${RESOURCE_CATALOG_THRIFT_FILE}   || fail unable to generate PHP thrift classes
     $THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload ${AIRAVATA_API_THRIFT_FILE} 
|| fail unable to generate PHP thrift classes
+    $THRIFT_EXEC ${THRIFT_ARGS} --gen php:autoload 
${CREDENTIAL_STORE_DATAMODEL_THRIFT_FILE} || fail unable to generate PHP thrift 
classes
 
     # For the generated java classes add the ASF V2 License header
     ## TODO Write PHP license parser

Reply via email to