You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2015/06/03 06:46:09 UTC
[1/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Repository: airavata
Updated Branches:
refs/heads/moduleRefactor 8d160a7af -> 82773c73b
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/resources/registry-derby.sql b/modules/orchestrator/orchestrator-service/src/test/resources/registry-derby.sql
new file mode 100644
index 0000000..9ed5ca9
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/resources/registry-derby.sql
@@ -0,0 +1,361 @@
+/*
+ *
+ * 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.
+ *
+ */
+CREATE TABLE GATEWAY
+(
+ GATEWAY_NAME VARCHAR(255),
+ OWNER VARCHAR(255),
+ PRIMARY KEY (GATEWAY_NAME)
+);
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255),
+ CONFIG_VAL VARCHAR(255),
+ EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ CATEGORY_ID VARCHAR (255),
+ 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');
+
+CREATE TABLE USERS
+(
+ USER_NAME VARCHAR(255),
+ PASSWORD VARCHAR(255),
+ PRIMARY KEY(USER_NAME)
+);
+
+CREATE TABLE GATEWAY_WORKER
+(
+ GATEWAY_NAME VARCHAR(255),
+ USER_NAME VARCHAR(255),
+ PRIMARY KEY (GATEWAY_NAME, USER_NAME),
+ FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT
+(
+ GATEWAY_NAME VARCHAR(255),
+ USER_NAME VARCHAR(255) NOT NULL,
+ PROJECT_ID VARCHAR(255),
+ PROJECT_NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (PROJECT_ID),
+ FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT_USER
+(
+ PROJECT_ID VARCHAR(255),
+ USER_NAME VARCHAR(255),
+ PRIMARY KEY (PROJECT_ID,USER_NAME),
+ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PUBLISHED_WORKFLOW
+(
+ GATEWAY_NAME VARCHAR(255),
+ CREATED_USER VARCHAR(255),
+ PUBLISH_WORKFLOW_NAME VARCHAR(255),
+ VERSION VARCHAR(255),
+ PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ PATH VARCHAR (255),
+ WORKFLOW_CONTENT BLOB,
+ PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
+ FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE USER_WORKFLOW
+(
+ GATEWAY_NAME VARCHAR(255),
+ OWNER VARCHAR(255),
+ TEMPLATE_NAME VARCHAR(255),
+ LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT TIMESTAMP,
+ PATH VARCHAR (255),
+ WORKFLOW_GRAPH BLOB,
+ PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
+ FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT
+(
+ EXPERIMENT_ID VARCHAR(255),
+ GATEWAY_NAME VARCHAR(255),
+ EXECUTION_USER VARCHAR(255) NOT NULL,
+ PROJECT_ID VARCHAR(255) NOT NULL,
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ EXPERIMENT_NAME VARCHAR(255) NOT NULL,
+ EXPERIMENT_DESCRIPTION VARCHAR(255),
+ APPLICATION_ID VARCHAR(255),
+ APPLICATION_VERSION VARCHAR(255),
+ WORKFLOW_TEMPLATE_ID VARCHAR(255),
+ WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
+ WORKFLOW_EXECUTION_ID VARCHAR(255),
+ PRIMARY KEY(EXPERIMENT_ID),
+ FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+ EXPERIMENT_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255) NOT NULL,
+ INPUT_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE CLOB,
+ PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+ EXPERIMENT_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255) NOT NULL,
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE CLOB,
+ PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+
+CREATE TABLE WORKFLOW_NODE_DETAIL
+(
+ EXPERIMENT_ID VARCHAR(255) NOT NULL,
+ NODE_INSTANCE_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ NODE_NAME VARCHAR(255) NOT NULL,
+ EXECUTION_UNIT VARCHAR(255) NOT NULL,
+ EXECUTION_UNIT_DATA VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE TASK_DETAIL
+(
+ TASK_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ APPLICATION_ID VARCHAR(255),
+ APPLICATION_VERSION VARCHAR(255),
+ APPLICATION_DEPLOYMENT_ID VARCHAR(255),
+ PRIMARY KEY(TASK_ID),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ERROR_DETAIL
+(
+ ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ JOB_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
+ TRANSIENT_OR_PERSISTENT SMALLINT,
+ ERROR_CATEGORY VARCHAR(255),
+ CORRECTIVE_ACTION VARCHAR(255),
+ ACTIONABLE_GROUP VARCHAR(255),
+ PRIMARY KEY(ERROR_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_INPUT
+(
+ TASK_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255) NOT NULL,
+ INPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE CLOB,
+ PRIMARY KEY(TASK_ID,INPUT_KEY),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_OUTPUT
+(
+ TASK_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255) NOT NULL,
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE CLOB,
+ PRIMARY KEY(TASK_ID,OUTPUT_KEY),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_INPUT
+(
+ NODE_INSTANCE_ID VARCHAR(255),
+ INPUT_KEY VARCHAR(255) NOT NULL,
+ INPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_OUTPUT
+(
+ NODE_INSTANCE_ID VARCHAR(255),
+ OUTPUT_KEY VARCHAR(255) NOT NULL,
+ OUTPUT_KEY_TYPE VARCHAR(255),
+ METADATA VARCHAR(255),
+ VALUE VARCHAR(255),
+ PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE JOB_DETAIL
+(
+ JOB_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ JOB_DESCRIPTION CLOB NOT NULL,
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
+ PRIMARY KEY (TASK_ID, JOB_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE DATA_TRANSFER_DETAIL
+(
+ TRANSFER_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ TRANSFER_DESC CLOB NOT NULL,
+ PRIMARY KEY(TRANSFER_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE STATUS
+(
+ STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ NODE_INSTANCE_ID VARCHAR(255),
+ TRANSFER_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ JOB_ID VARCHAR(255),
+ STATE VARCHAR(255),
+ STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ STATUS_TYPE VARCHAR(255),
+ PRIMARY KEY(STATUS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+ FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE CONFIG_DATA
+(
+ EXPERIMENT_ID VARCHAR(255),
+ AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
+ OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
+ SHARE_EXPERIMENT SMALLINT,
+ PRIMARY KEY(EXPERIMENT_ID)
+);
+
+CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
+(
+ RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ RESOURCE_HOST_ID VARCHAR(255),
+ CPU_COUNT INTEGER,
+ NODE_COUNT INTEGER,
+ NO_OF_THREADS INTEGER,
+ QUEUE_NAME VARCHAR(255),
+ WALLTIME_LIMIT INTEGER,
+ JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ TOTAL_PHYSICAL_MEMORY INTEGER,
+ COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+ PRIMARY KEY(RESOURCE_SCHEDULING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
+(
+ INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ WORKING_DIR_PARENT VARCHAR(255),
+ UNIQUE_WORKING_DIR VARCHAR(255),
+ STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+ CLEAN_AFTER_JOB SMALLINT,
+ PRIMARY KEY(INPUT_DATA_HANDLING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
+(
+ OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ OUTPUT_DATA_DIR VARCHAR(255),
+ DATA_REG_URL VARCHAR (255),
+ PERSIST_OUTPUT_DATA SMALLINT,
+ PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE QOS_PARAM
+(
+ QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+ EXPERIMENT_ID VARCHAR(255),
+ TASK_ID VARCHAR(255),
+ START_EXECUTION_AT VARCHAR(255),
+ EXECUTE_BEFORE VARCHAR(255),
+ NO_OF_RETRIES INTEGER,
+ PRIMARY KEY(QOS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+ FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMMUNITY_USER
+(
+ GATEWAY_NAME VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+ PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+CREATE TABLE CREDENTIALS
+(
+ GATEWAY_ID VARCHAR(256) NOT NULL,
+ TOKEN_ID VARCHAR(256) NOT NULL,
+ CREDENTIAL BLOB NOT NULL,
+ PORTAL_USER_ID VARCHAR(256) NOT NULL,
+ TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
+
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/resources/zoo.cfg
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/resources/zoo.cfg b/modules/orchestrator/orchestrator-service/src/test/resources/zoo.cfg
new file mode 100644
index 0000000..7233cf4
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/resources/zoo.cfg
@@ -0,0 +1,22 @@
+# 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.
+
+tickTime=2000
+initLimit=10
+syncLimit=5
+dataDir=data
+clientPort=2185
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/pom.xml b/modules/orchestrator/pom.xml
index c231d43..6e3f87c 100644
--- a/modules/orchestrator/pom.xml
+++ b/modules/orchestrator/pom.xml
@@ -31,8 +31,8 @@
</activation>
<modules>
<module>orchestrator-core</module>
- <module>airavata-orchestrator-service</module>
- <module>airavata-orchestrator-stubs</module>
+ <module>orchestrator-service</module>
+ <module>orchestrator-client</module>
</modules>
</profile>
</profiles>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/server/pom.xml b/modules/server/pom.xml
index 9b8b024..a204543 100644
--- a/modules/server/pom.xml
+++ b/modules/server/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-service</artifactId>
+ <artifactId>orchestrator-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/workflow-model/workflow-engine/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/pom.xml b/modules/workflow-model/workflow-engine/pom.xml
index 96522e3..1c22c06 100644
--- a/modules/workflow-model/workflow-engine/pom.xml
+++ b/modules/workflow-model/workflow-engine/pom.xml
@@ -232,7 +232,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-stubs</artifactId>
+ <artifactId>orchestrator-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml
index 0afe34f..8919f1d 100644
--- a/modules/xbaya-gui/pom.xml
+++ b/modules/xbaya-gui/pom.xml
@@ -216,7 +216,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-stubs</artifactId>
+ <artifactId>orchestrator-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
[4/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
deleted file mode 100644
index 3fa2946..0000000
--- a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
+++ /dev/null
@@ -1,55 +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.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.orchestrator.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class orchestrator_cpi_serviceConstants {
-
- public static final String ORCHESTRATOR_CPI_VERSION = "0.13.0";
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
deleted file mode 100644
index 009d110..0000000
--- a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
+++ /dev/null
@@ -1,136 +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.
- *
-*/
-
-package org.apache.airavata.orchestrator.sample;
-
-//import org.apache.airavata.client.AiravataAPIFactory;
-//import org.apache.airavata.client.api.AiravataAPI;
-//import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.client.tools.DocumentCreator;
-
-import org.apache.airavata.model.appcatalog.appinterface.DataType;
-import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
-import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
-import org.apache.airavata.model.util.ExperimentModelUtil;
-import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.thrift.TException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class OrchestratorClientSample {
-// private static DocumentCreator documentCreator;
- private static OrchestratorService.Client orchestratorClient;
-// private static Registry registry;
- private static int NUM_CONCURRENT_REQUESTS = 1;
- private static final String DEFAULT_USER = "default.registry.user";
- private static final String DEFAULT_USER_PASSWORD = "default.registry.password";
- private static final String DEFAULT_GATEWAY = "default.registry.gateway";
- private static String sysUser;
- private static String sysUserPwd;
- private static String gateway;
-/*
-
- public static void main(String[] args) {
- try {
- AiravataUtils.setExecutionAsClient();
- sysUser = ClientSettings.getSetting(DEFAULT_USER);
- sysUserPwd = ClientSettings.getSetting(DEFAULT_USER_PASSWORD);
- gateway = ClientSettings.getSetting(DEFAULT_GATEWAY);
- orchestratorClient = OrchestratorClientFactory.createOrchestratorClient("localhost", 8940);
- registry = RegistryFactory.getRegistry(gateway, sysUser, sysUserPwd);
- documentCreator = new DocumentCreator(getAiravataAPI());
- documentCreator.createLocalHostDocs();
- documentCreator.createGramDocs();
- documentCreator.createPBSDocsForOGCE();
- storeExperimentDetail();
- } catch (ApplicationSettingsException e) {
- e.printStackTrace();
- } catch (RegistryException e) {
- e.printStackTrace();
- }
-
- }
-
- private static AiravataAPI getAiravataAPI() {
- AiravataAPI airavataAPI = null;
- try {
- airavataAPI = AiravataAPIFactory.getAPI(gateway, sysUser);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- }
- return airavataAPI;
- }
-*/
-
- public static void storeExperimentDetail() {
- for (int i = 0; i < NUM_CONCURRENT_REQUESTS; i++) {
- Thread thread = new Thread() {
- public void run() {
- List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
- InputDataObjectType input = new InputDataObjectType();
- input.setName("echo_input");
- input.setType(DataType.STRING);
- input.setValue("echo_output=Hello World");
- exInputs.add(input);
-
-
- List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
- OutputDataObjectType output = new OutputDataObjectType();
- output.setName("echo_output");
- output.setType(DataType.STRING);
- output.setValue("");
- exOut.add(output);
-
- Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
- simpleExperiment.setExperimentOutputs(exOut);
-
- ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128");
- scheduling.setResourceHostId("gsissh-trestles");
- UserConfigurationData userConfigurationData = new UserConfigurationData();
- userConfigurationData.setComputationalResourceScheduling(scheduling);
- simpleExperiment.setUserConfigurationData(userConfigurationData);
- String expId = null;
- try {
-// expId = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- try {
- orchestratorClient.launchExperiment(expId, "airavataToken");
- } catch (TException e) {
- e.printStackTrace();
- }
- }
- };
- thread.start();
- try {
- thread.join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-client/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/pom.xml b/modules/orchestrator/orchestrator-client/pom.xml
new file mode 100644
index 0000000..0c439c9
--- /dev/null
+++ b/modules/orchestrator/orchestrator-client/pom.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>orchestrator</artifactId>
+ <groupId>org.apache.airavata</groupId>
+ <version>0.16-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <name>Airavata Orchestrator Client SDK</name>
+ <artifactId>orchestrator-client</artifactId>
+ <packaging>jar</packaging>
+ <url>http://airavata.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>libthrift</artifactId>
+ <version>${thrift.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-data-models</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-model-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-client-configuration</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
new file mode 100644
index 0000000..c2a31cc
--- /dev/null
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.client;
+
+import org.apache.airavata.model.error.AiravataClientConnectException;
+import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+public class OrchestratorClientFactory {
+
+ public static OrchestratorService.Client createOrchestratorClient(String serverHost, int serverPort) throws AiravataClientConnectException{
+ try {
+ TTransport transport = new TSocket(serverHost, serverPort);
+ transport.open();
+ TProtocol protocol = new TBinaryProtocol(transport);
+ return new OrchestratorService.Client(protocol);
+ } catch (TTransportException e) {
+ throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort);
+ }
+ }
+}
[3/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
new file mode 100644
index 0000000..ad3edb3
--- /dev/null
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
@@ -0,0 +1,4669 @@
+ /*
+ * 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.orchestrator.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class OrchestratorService {
+
+ public interface Iface {
+
+ /**
+ * Query orchestrator server to fetch the CPI version
+ */
+ public String getOrchestratorCPIVersion() throws org.apache.thrift.TException;
+
+ /**
+ * * After creating the experiment Data user have the
+ * * experimentID as the handler to the experiment, during the launchExperiment
+ * * We just have to give the experimentID
+ * *
+ * * @param experimentID
+ * * @return sucess/failure
+ * *
+ * *
+ *
+ * @param experimentId
+ * @param airavataCredStoreToken
+ */
+ public boolean launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException;
+
+ /**
+ * * In order to run single applications users should create an associating
+ * * WorkflowNodeDetails and a TaskDetails for it and hand it over for execution
+ * * along with a credential store token for authentication
+ * *
+ * * @param taskId
+ * * @param airavataCredStoreToken
+ * * @return sucess/failure
+ * *
+ * *
+ *
+ * @param taskId
+ * @param airavataCredStoreToken
+ */
+ public boolean launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException;
+
+ /**
+ * *
+ * * Validate funcations which can verify if the experiment is ready to be launced.
+ * *
+ * * @param experimentID
+ * * @return sucess/failure
+ * *
+ * *
+ *
+ * @param experimentId
+ */
+ public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException;
+
+ /**
+ * *
+ * * Terminate the running experiment.
+ * *
+ * * @param experimentID
+ * * @return sucess/failure
+ * *
+ * *
+ *
+ * @param experimentId
+ * @param tokenId
+ */
+ public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException;
+
+ }
+
+ public interface AsyncIface {
+
+ public void getOrchestratorCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void launchExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void launchTask(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ }
+
+ public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+ public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+ public Factory() {}
+ public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+ return new Client(prot);
+ }
+ public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ return new Client(iprot, oprot);
+ }
+ }
+
+ public Client(org.apache.thrift.protocol.TProtocol prot)
+ {
+ super(prot, prot);
+ }
+
+ public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ super(iprot, oprot);
+ }
+
+ public String getOrchestratorCPIVersion() throws org.apache.thrift.TException
+ {
+ send_getOrchestratorCPIVersion();
+ return recv_getOrchestratorCPIVersion();
+ }
+
+ public void send_getOrchestratorCPIVersion() throws org.apache.thrift.TException
+ {
+ getOrchestratorCPIVersion_args args = new getOrchestratorCPIVersion_args();
+ sendBase("getOrchestratorCPIVersion", args);
+ }
+
+ public String recv_getOrchestratorCPIVersion() throws org.apache.thrift.TException
+ {
+ getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
+ receiveBase(result, "getOrchestratorCPIVersion");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOrchestratorCPIVersion failed: unknown result");
+ }
+
+ public boolean launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ send_launchExperiment(experimentId, airavataCredStoreToken);
+ return recv_launchExperiment();
+ }
+
+ public void send_launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ launchExperiment_args args = new launchExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ sendBase("launchExperiment", args);
+ }
+
+ public boolean recv_launchExperiment() throws org.apache.thrift.TException
+ {
+ launchExperiment_result result = new launchExperiment_result();
+ receiveBase(result, "launchExperiment");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchExperiment failed: unknown result");
+ }
+
+ public boolean launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ send_launchTask(taskId, airavataCredStoreToken);
+ return recv_launchTask();
+ }
+
+ public void send_launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ launchTask_args args = new launchTask_args();
+ args.setTaskId(taskId);
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ sendBase("launchTask", args);
+ }
+
+ public boolean recv_launchTask() throws org.apache.thrift.TException
+ {
+ launchTask_result result = new launchTask_result();
+ receiveBase(result, "launchTask");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchTask failed: unknown result");
+ }
+
+ public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
+ {
+ send_validateExperiment(experimentId);
+ return recv_validateExperiment();
+ }
+
+ public void send_validateExperiment(String experimentId) throws org.apache.thrift.TException
+ {
+ validateExperiment_args args = new validateExperiment_args();
+ args.setExperimentId(experimentId);
+ sendBase("validateExperiment", args);
+ }
+
+ public boolean recv_validateExperiment() throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
+ {
+ validateExperiment_result result = new validateExperiment_result();
+ receiveBase(result, "validateExperiment");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.lve != null) {
+ throw result.lve;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "validateExperiment failed: unknown result");
+ }
+
+ public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
+ {
+ send_terminateExperiment(experimentId, tokenId);
+ return recv_terminateExperiment();
+ }
+
+ public void send_terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
+ {
+ terminateExperiment_args args = new terminateExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setTokenId(tokenId);
+ sendBase("terminateExperiment", args);
+ }
+
+ public boolean recv_terminateExperiment() throws org.apache.thrift.TException
+ {
+ terminateExperiment_result result = new terminateExperiment_result();
+ receiveBase(result, "terminateExperiment");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "terminateExperiment failed: unknown result");
+ }
+
+ }
+ public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+ public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+ private org.apache.thrift.async.TAsyncClientManager clientManager;
+ private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+ public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+ this.clientManager = clientManager;
+ this.protocolFactory = protocolFactory;
+ }
+ public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+ return new AsyncClient(protocolFactory, clientManager, transport);
+ }
+ }
+
+ public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+ super(protocolFactory, clientManager, transport);
+ }
+
+ public void getOrchestratorCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getOrchestratorCPIVersion_call method_call = new getOrchestratorCPIVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getOrchestratorCPIVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
+ public getOrchestratorCPIVersion_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOrchestratorCPIVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getOrchestratorCPIVersion_args args = new getOrchestratorCPIVersion_args();
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public String getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_getOrchestratorCPIVersion();
+ }
+ }
+
+ public void launchExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ launchExperiment_call method_call = new launchExperiment_call(experimentId, airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class launchExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String experimentId;
+ private String airavataCredStoreToken;
+ public launchExperiment_call(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.experimentId = experimentId;
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ launchExperiment_args args = new launchExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_launchExperiment();
+ }
+ }
+
+ public void launchTask(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ launchTask_call method_call = new launchTask_call(taskId, airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class launchTask_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String taskId;
+ private String airavataCredStoreToken;
+ public launchTask_call(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.taskId = taskId;
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchTask", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ launchTask_args args = new launchTask_args();
+ args.setTaskId(taskId);
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_launchTask();
+ }
+ }
+
+ public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ validateExperiment_call method_call = new validateExperiment_call(experimentId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class validateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String experimentId;
+ public validateExperiment_call(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.experimentId = experimentId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("validateExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ validateExperiment_args args = new validateExperiment_args();
+ args.setExperimentId(experimentId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_validateExperiment();
+ }
+ }
+
+ public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ terminateExperiment_call method_call = new terminateExperiment_call(experimentId, tokenId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class terminateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String experimentId;
+ private String tokenId;
+ public terminateExperiment_call(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.experimentId = experimentId;
+ this.tokenId = tokenId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("terminateExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ terminateExperiment_args args = new terminateExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setTokenId(tokenId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_terminateExperiment();
+ }
+ }
+
+ }
+
+ public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+ public Processor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+ }
+
+ protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ super(iface, getProcessMap(processMap));
+ }
+
+ private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion());
+ processMap.put("launchExperiment", new launchExperiment());
+ processMap.put("launchTask", new launchTask());
+ processMap.put("validateExperiment", new validateExperiment());
+ processMap.put("terminateExperiment", new terminateExperiment());
+ return processMap;
+ }
+
+ public static class getOrchestratorCPIVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOrchestratorCPIVersion_args> {
+ public getOrchestratorCPIVersion() {
+ super("getOrchestratorCPIVersion");
+ }
+
+ public getOrchestratorCPIVersion_args getEmptyArgsInstance() {
+ return new getOrchestratorCPIVersion_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getOrchestratorCPIVersion_result getResult(I iface, getOrchestratorCPIVersion_args args) throws org.apache.thrift.TException {
+ getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
+ result.success = iface.getOrchestratorCPIVersion();
+ return result;
+ }
+ }
+
+ public static class launchExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchExperiment_args> {
+ public launchExperiment() {
+ super("launchExperiment");
+ }
+
+ public launchExperiment_args getEmptyArgsInstance() {
+ return new launchExperiment_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public launchExperiment_result getResult(I iface, launchExperiment_args args) throws org.apache.thrift.TException {
+ launchExperiment_result result = new launchExperiment_result();
+ result.success = iface.launchExperiment(args.experimentId, args.airavataCredStoreToken);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ public static class launchTask<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchTask_args> {
+ public launchTask() {
+ super("launchTask");
+ }
+
+ public launchTask_args getEmptyArgsInstance() {
+ return new launchTask_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public launchTask_result getResult(I iface, launchTask_args args) throws org.apache.thrift.TException {
+ launchTask_result result = new launchTask_result();
+ result.success = iface.launchTask(args.taskId, args.airavataCredStoreToken);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ public static class validateExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, validateExperiment_args> {
+ public validateExperiment() {
+ super("validateExperiment");
+ }
+
+ public validateExperiment_args getEmptyArgsInstance() {
+ return new validateExperiment_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public validateExperiment_result getResult(I iface, validateExperiment_args args) throws org.apache.thrift.TException {
+ validateExperiment_result result = new validateExperiment_result();
+ try {
+ result.success = iface.validateExperiment(args.experimentId);
+ result.setSuccessIsSet(true);
+ } catch (org.apache.airavata.model.error.LaunchValidationException lve) {
+ result.lve = lve;
+ }
+ return result;
+ }
+ }
+
+ public static class terminateExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, terminateExperiment_args> {
+ public terminateExperiment() {
+ super("terminateExperiment");
+ }
+
+ public terminateExperiment_args getEmptyArgsInstance() {
+ return new terminateExperiment_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public terminateExperiment_result getResult(I iface, terminateExperiment_args args) throws org.apache.thrift.TException {
+ terminateExperiment_result result = new terminateExperiment_result();
+ result.success = iface.terminateExperiment(args.experimentId, args.tokenId);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ }
+
+ public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+ public AsyncProcessor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+ }
+
+ protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ super(iface, getProcessMap(processMap));
+ }
+
+ private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion());
+ processMap.put("launchExperiment", new launchExperiment());
+ processMap.put("launchTask", new launchTask());
+ processMap.put("validateExperiment", new validateExperiment());
+ processMap.put("terminateExperiment", new terminateExperiment());
+ return processMap;
+ }
+
+ public static class getOrchestratorCPIVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getOrchestratorCPIVersion_args, String> {
+ public getOrchestratorCPIVersion() {
+ super("getOrchestratorCPIVersion");
+ }
+
+ public getOrchestratorCPIVersion_args getEmptyArgsInstance() {
+ return new getOrchestratorCPIVersion_args();
+ }
+
+ public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<String>() {
+ public void onComplete(String o) {
+ getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, getOrchestratorCPIVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.getOrchestratorCPIVersion(resultHandler);
+ }
+ }
+
+ public static class launchExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchExperiment_args, Boolean> {
+ public launchExperiment() {
+ super("launchExperiment");
+ }
+
+ public launchExperiment_args getEmptyArgsInstance() {
+ return new launchExperiment_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ launchExperiment_result result = new launchExperiment_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ launchExperiment_result result = new launchExperiment_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, launchExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.launchExperiment(args.experimentId, args.airavataCredStoreToken,resultHandler);
+ }
+ }
+
+ public static class launchTask<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchTask_args, Boolean> {
+ public launchTask() {
+ super("launchTask");
+ }
+
+ public launchTask_args getEmptyArgsInstance() {
+ return new launchTask_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ launchTask_result result = new launchTask_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ launchTask_result result = new launchTask_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, launchTask_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.launchTask(args.taskId, args.airavataCredStoreToken,resultHandler);
+ }
+ }
+
+ public static class validateExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, validateExperiment_args, Boolean> {
+ public validateExperiment() {
+ super("validateExperiment");
+ }
+
+ public validateExperiment_args getEmptyArgsInstance() {
+ return new validateExperiment_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ validateExperiment_result result = new validateExperiment_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ validateExperiment_result result = new validateExperiment_result();
+ if (e instanceof org.apache.airavata.model.error.LaunchValidationException) {
+ result.lve = (org.apache.airavata.model.error.LaunchValidationException) e;
+ result.setLveIsSet(true);
+ msg = result;
+ }
+ else
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, validateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.validateExperiment(args.experimentId,resultHandler);
+ }
+ }
+
+ public static class terminateExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, terminateExperiment_args, Boolean> {
+ public terminateExperiment() {
+ super("terminateExperiment");
+ }
+
+ public terminateExperiment_args getEmptyArgsInstance() {
+ return new terminateExperiment_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ terminateExperiment_result result = new terminateExperiment_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ terminateExperiment_result result = new terminateExperiment_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, terminateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.terminateExperiment(args.experimentId, args.tokenId,resultHandler);
+ }
+ }
+
+ }
+
+ public static class getOrchestratorCPIVersion_args implements org.apache.thrift.TBase<getOrchestratorCPIVersion_args, getOrchestratorCPIVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrchestratorCPIVersion_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrchestratorCPIVersion_args");
+
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getOrchestratorCPIVersion_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getOrchestratorCPIVersion_argsTupleSchemeFactory());
+ }
+
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+;
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrchestratorCPIVersion_args.class, metaDataMap);
+ }
+
+ public getOrchestratorCPIVersion_args() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getOrchestratorCPIVersion_args(getOrchestratorCPIVersion_args other) {
+ }
+
+ public getOrchestratorCPIVersion_args deepCopy() {
+ return new getOrchestratorCPIVersion_args(this);
+ }
+
+ @Override
+ public void clear() {
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getOrchestratorCPIVersion_args)
+ return this.equals((getOrchestratorCPIVersion_args)that);
+ return false;
+ }
+
+ public boolean equals(getOrchestratorCPIVersion_args that) {
+ if (that == null)
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getOrchestratorCPIVersion_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getOrchestratorCPIVersion_args(");
+ boolean first = true;
+
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_argsStandardSchemeFactory implements SchemeFactory {
+ public getOrchestratorCPIVersion_argsStandardScheme getScheme() {
+ return new getOrchestratorCPIVersion_argsStandardScheme();
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_argsStandardScheme extends StandardScheme<getOrchestratorCPIVersion_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getOrchestratorCPIVersion_argsTupleSchemeFactory implements SchemeFactory {
+ public getOrchestratorCPIVersion_argsTupleScheme getScheme() {
+ return new getOrchestratorCPIVersion_argsTupleScheme();
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_argsTupleScheme extends TupleScheme<getOrchestratorCPIVersion_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ }
+ }
+
+ }
+
+ public static class getOrchestratorCPIVersion_result implements org.apache.thrift.TBase<getOrchestratorCPIVersion_result, getOrchestratorCPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrchestratorCPIVersion_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrchestratorCPIVersion_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getOrchestratorCPIVersion_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getOrchestratorCPIVersion_resultTupleSchemeFactory());
+ }
+
+ public String success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrchestratorCPIVersion_result.class, metaDataMap);
+ }
+
+ public getOrchestratorCPIVersion_result() {
+ }
+
+ public getOrchestratorCPIVersion_result(
+ String success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getOrchestratorCPIVersion_result(getOrchestratorCPIVersion_result other) {
+ if (other.isSetSuccess()) {
+ this.success = other.success;
+ }
+ }
+
+ public getOrchestratorCPIVersion_result deepCopy() {
+ return new getOrchestratorCPIVersion_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public String getSuccess() {
+ return this.success;
+ }
+
+ public getOrchestratorCPIVersion_result setSuccess(String success) {
+ this.success = success;
+ return this;
+ }
+
+ public void unsetSuccess() {
+ this.success = null;
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return this.success != null;
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ if (!value) {
+ this.success = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getOrchestratorCPIVersion_result)
+ return this.equals((getOrchestratorCPIVersion_result)that);
+ return false;
+ }
+
+ public boolean equals(getOrchestratorCPIVersion_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true && this.isSetSuccess();
+ boolean that_present_success = true && that.isSetSuccess();
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (!this.success.equals(that.success))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getOrchestratorCPIVersion_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getOrchestratorCPIVersion_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_resultStandardSchemeFactory implements SchemeFactory {
+ public getOrchestratorCPIVersion_resultStandardScheme getScheme() {
+ return new getOrchestratorCPIVersion_resultStandardScheme();
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_resultStandardScheme extends StandardScheme<getOrchestratorCPIVersion_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeString(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getOrchestratorCPIVersion_resultTupleSchemeFactory implements SchemeFactory {
+ public getOrchestratorCPIVersion_resultTupleScheme getScheme() {
+ return new getOrchestratorCPIVersion_resultTupleScheme();
+ }
+ }
+
+ private static class getOrchestratorCPIVersion_resultTupleScheme extends TupleScheme<getOrchestratorCPIVersion_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeString(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class launchExperiment_args implements org.apache.thrift.TBase<launchExperiment_args, launchExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_args");
+
+ private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataCredStoreToken", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new launchExperiment_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchExperiment_argsTupleSchemeFactory());
+ }
+
+ public String experimentId; // required
+ public String airavataCredStoreToken; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ EXPERIMENT_ID((short)1, "experimentId"),
+ AIRAVATA_CRED_STORE_TOKEN((short)2, "airavataCredStoreToken");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // EXPERIMENT_ID
+ return EXPERIMENT_ID;
+ case 2: // AIRAVATA_CRED_STORE_TOKEN
+ return AIRAVATA_CRED_STORE_TOKEN;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.AIRAVATA_CRED_STORE_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("airavataCredStoreToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchExperiment_args.class, metaDataMap);
+ }
+
+ public launchExperiment_args() {
+ }
+
+ public launchExperiment_args(
+ String experimentId,
+ String airavataCredStoreToken)
+ {
+ this();
+ this.experimentId = experimentId;
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public launchExperiment_args(launchExperiment_args other) {
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ if (other.isSetAiravataCredStoreToken()) {
+ this.airavataCredStoreToken = other.airavataCredStoreToken;
+ }
+ }
+
+ public launchExperiment_args deepCopy() {
+ return new launchExperiment_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.experimentId = null;
+ this.airavataCredStoreToken = null;
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public launchExperiment_args setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ return this;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public String getAiravataCredStoreToken() {
+ return this.airavataCredStoreToken;
+ }
+
+ public launchExperiment_args setAiravataCredStoreToken(String airavataCredStoreToken) {
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ return this;
+ }
+
+ public void unsetAiravataCredStoreToken() {
+ this.airavataCredStoreToken = null;
+ }
+
+ /** Returns true if field airavataCredStoreToken is set (has been assigned a value) and false otherwise */
+ public boolean isSetAiravataCredStoreToken() {
+ return this.airavataCredStoreToken != null;
+ }
+
+ public void setAiravataCredStoreTokenIsSet(boolean value) {
+ if (!value) {
+ this.airavataCredStoreToken = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ case AIRAVATA_CRED_STORE_TOKEN:
+ if (value == null) {
+ unsetAiravataCredStoreToken();
+ } else {
+ setAiravataCredStoreToken((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ case AIRAVATA_CRED_STORE_TOKEN:
+ return getAiravataCredStoreToken();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ case AIRAVATA_CRED_STORE_TOKEN:
+ return isSetAiravataCredStoreToken();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof launchExperiment_args)
+ return this.equals((launchExperiment_args)that);
+ return false;
+ }
+
+ public boolean equals(launchExperiment_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ boolean this_present_airavataCredStoreToken = true && this.isSetAiravataCredStoreToken();
+ boolean that_present_airavataCredStoreToken = true && that.isSetAiravataCredStoreToken();
+ if (this_present_airavataCredStoreToken || that_present_airavataCredStoreToken) {
+ if (!(this_present_airavataCredStoreToken && that_present_airavataCredStoreToken))
+ return false;
+ if (!this.airavataCredStoreToken.equals(that.airavataCredStoreToken))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(launchExperiment_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAiravataCredStoreToken()).compareTo(other.isSetAiravataCredStoreToken());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAiravataCredStoreToken()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataCredStoreToken, other.airavataCredStoreToken);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("launchExperiment_args(");
+ boolean first = true;
+
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("airavataCredStoreToken:");
+ if (this.airavataCredStoreToken == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.airavataCredStoreToken);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (experimentId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' was not present! Struct: " + toString());
+ }
+ if (airavataCredStoreToken == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataCredStoreToken' was not present! Struct: " + toString());
+ }
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class launchExperiment_argsStandardSchemeFactory implements SchemeFactory {
+ public launchExperiment_argsStandardScheme getScheme() {
+ return new launchExperiment_argsStandardScheme();
+ }
+ }
+
+ private static class launchExperiment_argsStandardScheme extends StandardScheme<launchExperiment_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // AIRAVATA_CRED_STORE_TOKEN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.airavataCredStoreToken = iprot.readString();
+ struct.setAiravataCredStoreTokenIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.airavataCredStoreToken != null) {
+ oprot.writeFieldBegin(AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC);
+ oprot.writeString(struct.airavataCredStoreToken);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class launchExperiment_argsTupleSchemeFactory implements SchemeFactory {
+ public launchExperiment_argsTupleScheme getScheme() {
+ return new launchExperiment_argsTupleScheme();
+ }
+ }
+
+ private static class launchExperiment_argsTupleScheme extends TupleScheme<launchExperiment_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.experimentId);
+ oprot.writeString(struct.airavataCredStoreToken);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ struct.airavataCredStoreToken = iprot.readString();
+ struct.setAiravataCredStoreTokenIsSet(true);
+ }
+ }
+
+ }
+
+ public static class launchExperiment_result implements org.apache.thrift.TBase<launchExperiment_result, launchExperiment_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new launchExperiment_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchExperiment_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchExperiment_result.class, metaDataMap);
+ }
+
+ public launchExperiment_result() {
+ }
+
+ public launchExperiment_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public launchExperiment_result(launchExperiment_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public launchExperiment_result deepCopy() {
+ return new launchExperiment_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public launchExperiment_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof launchExperiment_result)
+ return this.equals((launchExperiment_result)that);
+ return false;
+ }
+
+ public boolean equals(launchExperiment_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(launchExperiment_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("launchExperiment_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class launchExperiment_resultStandardSchemeFactory implements SchemeFactory {
+ public launchExperiment_resultStandardScheme getScheme() {
+ return new launchExperiment_resultStandardScheme();
+ }
+ }
+
+ private static class launchExperiment_resultStandardScheme extends StandardScheme<launchExperiment_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class launchExperiment_resultTupleSchemeFactory implements SchemeFactory {
+ public launchExperiment_resultTupleScheme getScheme() {
+ return new launchExperiment_resultTupleScheme();
+ }
+ }
+
+ private static class launchExperiment_resultTupleScheme extends TupleScheme<launchExperiment_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+
<TRUNCATED>
[7/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
Renamed orchestrator component nested modules and artifact ids
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/82773c73
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/82773c73
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/82773c73
Branch: refs/heads/moduleRefactor
Commit: 82773c73b7fa2c5f74918575d976235daa7c4660
Parents: 8d160a7
Author: Shameera Rathanyaka <sh...@gmail.com>
Authored: Wed Jun 3 00:46:02 2015 -0400
Committer: Shameera Rathanyaka <sh...@gmail.com>
Committed: Wed Jun 3 00:46:02 2015 -0400
----------------------------------------------------------------------
airavata-api/airavata-api-server/pom.xml | 2 +-
.../orchestrator/generate-orchestrator-stubs.sh | 2 +-
.../java/src/main/assembly/bin-assembly.xml | 4 +-
.../distribution/orchestrator-server/pom.xml | 2 +-
modules/distribution/server/pom.xml | 6 +-
.../airavata-orchestrator-service/pom.xml | 85 -
.../orchestrator/server/OrchestratorServer.java | 160 -
.../server/OrchestratorServerHandler.java | 643 ---
.../airavata/orchestrator/util/Constants.java | 29 -
.../orchestrator/util/DataModelUtils.java | 55 -
.../OrchestratorServerThreadPoolExecutor.java | 56 -
.../src/main/resources/gsissh.properties | 26 -
.../client/OrchestratorClientFactoryTest.java | 90 -
.../orchestrator/client/util/Initialize.java | 330 --
.../src/test/resources/gsissh.properties | 26 -
.../src/test/resources/monitor.properties | 30 -
.../src/test/resources/orchestrator.properties | 26 -
.../src/test/resources/registry-derby.sql | 361 --
.../src/test/resources/zoo.cfg | 22 -
.../airavata-orchestrator-stubs/pom.xml | 60 -
.../client/OrchestratorClientFactory.java | 44 -
.../orchestrator/cpi/OrchestratorService.java | 4669 ------------------
.../cpi/orchestrator_cpi_serviceConstants.java | 55 -
.../sample/OrchestratorClientSample.java | 136 -
.../orchestrator/orchestrator-client/pom.xml | 60 +
.../client/OrchestratorClientFactory.java | 44 +
.../orchestrator/cpi/OrchestratorService.java | 4669 ++++++++++++++++++
.../cpi/orchestrator_cpi_serviceConstants.java | 55 +
.../sample/OrchestratorClientSample.java | 136 +
modules/orchestrator/orchestrator-core/pom.xml | 2 +-
.../orchestrator/orchestrator-service/pom.xml | 85 +
.../orchestrator/server/OrchestratorServer.java | 160 +
.../server/OrchestratorServerHandler.java | 643 +++
.../airavata/orchestrator/util/Constants.java | 29 +
.../orchestrator/util/DataModelUtils.java | 55 +
.../OrchestratorServerThreadPoolExecutor.java | 56 +
.../src/main/resources/gsissh.properties | 26 +
.../client/OrchestratorClientFactoryTest.java | 90 +
.../orchestrator/client/util/Initialize.java | 330 ++
.../src/test/resources/gsissh.properties | 26 +
.../src/test/resources/monitor.properties | 30 +
.../src/test/resources/orchestrator.properties | 26 +
.../src/test/resources/registry-derby.sql | 361 ++
.../src/test/resources/zoo.cfg | 22 +
modules/orchestrator/pom.xml | 4 +-
modules/server/pom.xml | 2 +-
modules/workflow-model/workflow-engine/pom.xml | 2 +-
modules/xbaya-gui/pom.xml | 2 +-
48 files changed, 6917 insertions(+), 6917 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/airavata-api/airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/pom.xml b/airavata-api/airavata-api-server/pom.xml
index 64b436b..6bf3d32 100644
--- a/airavata-api/airavata-api-server/pom.xml
+++ b/airavata-api/airavata-api-server/pom.xml
@@ -63,7 +63,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-stubs</artifactId>
+ <artifactId>orchestrator-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh
----------------------------------------------------------------------
diff --git a/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh b/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh
index b122f02..df526d2 100755
--- a/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh
+++ b/component-interface-descriptions/orchestrator/generate-orchestrator-stubs.sh
@@ -21,7 +21,7 @@
# Global Constants used across the script
REQUIRED_THRIFT_VERSION='0.9.1'
BASE_TARGET_DIR='target'
-ORCHESTRATOR_SERVICE_DIR='../../modules/orchestrator/airavata-orchestrator-stubs/src/main/java'
+ORCHESTRATOR_SERVICE_DIR='../../modules/orchestrator/orchestrator-client/src/main/java'
# The Funcation fail prints error messages on failure and quits the script.
fail() {
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/distribution/client/java/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/client/java/src/main/assembly/bin-assembly.xml b/modules/distribution/client/java/src/main/assembly/bin-assembly.xml
index 4df667f..59976d8 100644
--- a/modules/distribution/client/java/src/main/assembly/bin-assembly.xml
+++ b/modules/distribution/client/java/src/main/assembly/bin-assembly.xml
@@ -106,7 +106,7 @@
<!--<include>com.amazonaws:aws-java-sdk</include> -->
<!--<include>amazon:MapReduce.Service.Client</include> -->
<include>net.java.dev.jets3t:jets3t</include>
- <include>org.apache.airavata:airavata-orchestrator-core:jar
+ <include>org.apache.airavata:orchestrator-core:jar
</include>
<!--<include>org.apache.airavata:airavata-gfac-schema-utils:jar-->
<!--</include>-->
@@ -127,7 +127,7 @@
</include>
<include>org.apache.airavata:gsissh:jar</include>
<include>org.apache.airavata:airavata-model-utils:jar</include>
- <include>org.apache.airavata:airavata-orchestrator-service:jar
+ <include>org.apache.airavata:orchestrator-service:jar
</include>
<include>org.apache.openjpa:openjpa-all:jar</include>
<include>xerces:xercesImpl:jar:2.9.1</include>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/distribution/orchestrator-server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/orchestrator-server/pom.xml b/modules/distribution/orchestrator-server/pom.xml
index a6c44ad..4f39b5f 100644
--- a/modules/distribution/orchestrator-server/pom.xml
+++ b/modules/distribution/orchestrator-server/pom.xml
@@ -138,7 +138,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-service</artifactId>
+ <artifactId>orchestrator-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/distribution/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/server/pom.xml b/modules/distribution/server/pom.xml
index 4aa09f8..fc2df04 100644
--- a/modules/distribution/server/pom.xml
+++ b/modules/distribution/server/pom.xml
@@ -244,7 +244,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-service</artifactId>
+ <artifactId>orchestrator-service</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
@@ -263,7 +263,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-stubs</artifactId>
+ <artifactId>orchestrator-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -273,7 +273,7 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-core</artifactId>
+ <artifactId>orchestrator-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/pom.xml b/modules/orchestrator/airavata-orchestrator-service/pom.xml
deleted file mode 100644
index fc60a17..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/pom.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>orchestrator</artifactId>
- <groupId>org.apache.airavata</groupId>
- <version>0.16-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <name>Airavata Orchestrator Service</name>
- <artifactId>airavata-orchestrator-service</artifactId>
- <packaging>jar</packaging>
- <url>http://airavata.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-credential-store</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>${thrift.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${org.slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-orchestrator-stubs</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-workflow-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>app-catalog-data</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>app-catalog-cpi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-model-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-server-configuration</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- </properties>
-
-</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
deleted file mode 100644
index 78957ac..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
+++ /dev/null
@@ -1,160 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.server;
-
-import java.net.InetSocketAddress;
-
-import org.apache.airavata.common.utils.IServer;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.airavata.orchestrator.util.Constants;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TThreadPoolServer;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TServerTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OrchestratorServer implements IServer{
-
- private final static Logger logger = LoggerFactory.getLogger(OrchestratorServer.class);
- private static final String SERVER_NAME = "Orchestrator Server";
- private static final String SERVER_VERSION = "1.0";
-
- private ServerStatus status;
-
- private TServer server;
-
- public OrchestratorServer() {
- setStatus(ServerStatus.STOPPED);
- }
-
- public void StartOrchestratorServer(OrchestratorService.Processor<OrchestratorServerHandler> orchestratorServerHandlerProcessor)
- throws Exception {
- try {
- final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_PORT,"8940"));
-
- final String serverHost = ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_HOST, null);
-
- TServerTransport serverTransport;
-
- if(serverHost == null){
- serverTransport = new TServerSocket(serverPort);
- }else{
- InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
- serverTransport = new TServerSocket(inetSocketAddress);
- }
-
- //server = new TSimpleServer(
- // new TServer.Args(serverTransport).processor(orchestratorServerHandlerProcessor));
- TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
- options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_MIN_THREADS, "30"));
- server = new TThreadPoolServer(options.processor(orchestratorServerHandlerProcessor));
-
- new Thread() {
- public void run() {
- server.serve();
- setStatus(ServerStatus.STOPPED);
- logger.info("Orchestrator Server Stopped.");
- }
- }.start();
- new Thread() {
- public void run() {
- while(!server.isServing()){
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- break;
- }
- }
- if (server.isServing()){
- setStatus(ServerStatus.STARTED);
- logger.info("Starting Orchestrator Server on Port " + serverPort);
- logger.info("Listening to Orchestrator Clients ....");
- }
- }
- }.start();
- } catch (TTransportException e) {
- logger.error(e.getMessage());
- setStatus(ServerStatus.FAILED);
- }
- }
-
- public static void main(String[] args) {
- try {
- new OrchestratorServer().start();
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- @Override
- public void start() throws Exception {
- setStatus(ServerStatus.STARTING);
- OrchestratorService.Processor<OrchestratorServerHandler> orchestratorService =
- new OrchestratorService.Processor<OrchestratorServerHandler>(new OrchestratorServerHandler());
- StartOrchestratorServer(orchestratorService);
- }
-
- @Override
- public void stop() throws Exception {
- if (server!=null && server.isServing()){
- setStatus(ServerStatus.STOPING);
- server.stop();
- }
-
- }
-
- @Override
- public void restart() throws Exception {
- stop();
- start();
- }
-
- @Override
- public void configure() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public ServerStatus getStatus() throws Exception {
- return status;
- }
-
- private void setStatus(ServerStatus stat){
- status=stat;
- status.updateTime();
- }
-
- @Override
- public String getName() {
- return SERVER_NAME;
- }
-
- @Override
- public String getVersion() {
- return SERVER_VERSION;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
deleted file mode 100644
index 4ef9dbc..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ /dev/null
@@ -1,643 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.server;
-
-import org.airavata.appcatalog.cpi.AppCatalog;
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.airavata.appcatalog.cpi.ComputeResource;
-import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
-import org.apache.aiaravata.application.catalog.data.resources.AbstractResource;
-import org.apache.airavata.common.exception.AiravataException;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.logger.AiravataLogger;
-import org.apache.airavata.common.logger.AiravataLoggerFactory;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.AiravataZKUtils;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.credential.store.store.CredentialReader;
-import org.apache.airavata.gfac.core.scheduler.HostScheduler;
-import org.apache.airavata.gfac.core.utils.GFacUtils;
-import org.apache.airavata.messaging.core.MessageContext;
-import org.apache.airavata.messaging.core.MessageHandler;
-import org.apache.airavata.messaging.core.MessagingConstants;
-import org.apache.airavata.messaging.core.Publisher;
-import org.apache.airavata.messaging.core.PublisherFactory;
-import org.apache.airavata.messaging.core.impl.RabbitMQProcessConsumer;
-import org.apache.airavata.messaging.core.impl.RabbitMQProcessPublisher;
-import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
-import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
-import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.error.LaunchValidationException;
-import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
-import org.apache.airavata.model.messaging.event.MessageType;
-import org.apache.airavata.model.messaging.event.ProcessSubmitEvent;
-import org.apache.airavata.model.util.ExecutionType;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
-import org.apache.airavata.model.workspace.experiment.TaskDetails;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-import org.apache.airavata.model.workspace.experiment.TaskStatus;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
-import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
-import org.apache.airavata.orchestrator.util.DataModelUtils;
-import org.apache.airavata.orchestrator.util.OrchestratorServerThreadPoolExecutor;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.Registry;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
-import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
-import org.apache.airavata.workflow.core.WorkflowEnactmentService;
-import org.apache.thrift.TBase;
-import org.apache.thrift.TException;
-
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class OrchestratorServerHandler implements OrchestratorService.Iface {
- private static AiravataLogger log = AiravataLoggerFactory .getLogger(OrchestratorServerHandler.class);
- private SimpleOrchestratorImpl orchestrator = null;
- private Registry registry;
- private static Integer mutex = new Integer(-1);
- private String airavataUserName;
- private String gatewayName;
- private Publisher publisher;
- private RabbitMQProcessConsumer rabbitMQProcessConsumer;
- private RabbitMQProcessPublisher rabbitMQProcessPublisher;
-
- /**
- * Query orchestrator server to fetch the CPI version
- */
- public String getOrchestratorCPIVersion() throws TException {
- return orchestrator_cpi_serviceConstants.ORCHESTRATOR_CPI_VERSION;
- }
-
- public OrchestratorServerHandler() throws OrchestratorException{
- // registering with zk
- try {
- publisher = PublisherFactory.createActivityPublisher();
- String zkhostPort = AiravataZKUtils.getZKhostPort();
- String airavataServerHostPort = ServerSettings
- .getSetting(Constants.ORCHESTRATOR_SERVER_HOST)
- + ":"
- + ServerSettings
- .getSetting(Constants.ORCHESTRATOR_SERVER_PORT);
-
-// setGatewayName(ServerSettings.getDefaultUserGateway());
- setAiravataUserName(ServerSettings.getDefaultUser());
- } catch (AiravataException e) {
- log.error(e.getMessage(), e);
- throw new OrchestratorException("Error while initializing orchestrator service", e);
- }
- // orchestrator init
- try {
- // first constructing the monitorManager and orchestrator, then fill
- // the required properties
- orchestrator = new SimpleOrchestratorImpl();
- registry = RegistryFactory.getDefaultRegistry();
- orchestrator.initialize();
- orchestrator.getOrchestratorContext().setPublisher(this.publisher);
- startProcessConsumer();
- } catch (OrchestratorException e) {
- log.error(e.getMessage(), e);
- throw new OrchestratorException("Error while initializing orchestrator service", e);
- } catch (RegistryException e) {
- log.error(e.getMessage(), e);
- throw new OrchestratorException("Error while initializing orchestrator service", e);
- }
- }
-
- private void startProcessConsumer() throws OrchestratorException {
- try {
- rabbitMQProcessConsumer = new RabbitMQProcessConsumer();
- ProcessConsumer processConsumer = new ProcessConsumer();
- Thread thread = new Thread(processConsumer);
- thread.start();
-
- } catch (AiravataException e) {
- throw new OrchestratorException("Error while starting process consumer", e);
- }
-
- }
-
- /**
- * * After creating the experiment Data user have the * experimentID as the
- * handler to the experiment, during the launchExperiment * We just have to
- * give the experimentID * * @param experimentID * @return sucess/failure *
- * *
- *
- * @param experimentId
- */
- public boolean launchExperiment(String experimentId, String token) throws TException {
- Experiment experiment = null; // this will inside the bottom catch statement
- try {
- experiment = (Experiment) registry.get(
- RegistryModelType.EXPERIMENT, experimentId);
- if (experiment == null) {
- log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {} ", experimentId);
- return false;
- }
- CredentialReader credentialReader = GFacUtils.getCredentialReader();
- String gatewayId = null;
- if (credentialReader != null) {
- try {
- gatewayId = credentialReader.getGatewayID(token);
- } catch (Exception e) {
- log.error(e.getLocalizedMessage());
- }
- }
- if (gatewayId == null) {
- gatewayId = ServerSettings.getDefaultUserGateway();
- log.info("Couldn't identify the gateway Id using the credential token, Use default gateway Id");
-// throw new AiravataException("Couldn't identify the gateway Id using the credential token");
- }
- ExecutionType executionType = DataModelUtils.getExecutionType(gatewayId, experiment);
- if (executionType == ExecutionType.SINGLE_APP) {
- //its an single application execution experiment
- log.debugId(experimentId, "Launching single application experiment {}.", experimentId);
- OrchestratorServerThreadPoolExecutor.getCachedThreadPool().execute(new SingleAppExperimentRunner(experimentId, token));
- } else if (executionType == ExecutionType.WORKFLOW) {
- //its a workflow execution experiment
- log.debugId(experimentId, "Launching workflow experiment {}.", experimentId);
- launchWorkflowExperiment(experimentId, token);
- } else {
- log.errorId(experimentId, "Couldn't identify experiment type, experiment {} is neither single application nor workflow.", experimentId);
- throw new TException("Experiment '" + experimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId());
- }
- } catch (Exception e) {
- throw new TException("Experiment '" + experimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId(), e);
- }
- return true;
- }
-
- /**
- * This method will validate the experiment before launching, if is failed
- * we do not run the launch in airavata thrift service (only if validation
- * is enabled
- *
- * @param experimentId
- * @return
- * @throws TException
- */
- public boolean validateExperiment(String experimentId) throws TException,
- LaunchValidationException {
- // TODO: Write the Orchestrator implementaion
- try {
- List<TaskDetails> tasks = orchestrator.createTasks(experimentId);
- if (tasks.size() > 1) {
- log.info("There are multiple tasks for this experiment, So Orchestrator will launch multiple Jobs");
- }
- List<String> ids = registry.getIds(
- RegistryModelType.WORKFLOW_NODE_DETAIL,
- WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
- for (String workflowNodeId : ids) {
- WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
- .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
- workflowNodeId);
- List<Object> taskDetailList = registry.get(
- RegistryModelType.TASK_DETAIL,
- TaskDetailConstants.NODE_ID, workflowNodeId);
- for (Object o : taskDetailList) {
- TaskDetails taskID = (TaskDetails) o;
- // iterate through all the generated tasks and performs the
- // job submisssion+monitoring
- Experiment experiment = (Experiment) registry.get(
- RegistryModelType.EXPERIMENT, experimentId);
- if (experiment == null) {
- log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}.",
- experimentId);
- return false;
- }
- return orchestrator.validateExperiment(experiment,
- workflowNodeDetail, taskID).isSetValidationState();
- }
- }
-
- } catch (OrchestratorException e) {
- log.errorId(experimentId, "Error while validating experiment", e);
- throw new TException(e);
- } catch (RegistryException e) {
- log.errorId(experimentId, "Error while validating experiment", e);
- throw new TException(e);
- }
- return false;
- }
-
- /**
- * This can be used to cancel a running experiment and store the status to
- * terminated in registry
- *
- * @param experimentId
- * @return
- * @throws TException
- */
- public boolean terminateExperiment(String experimentId, String tokenId) throws TException {
- log.infoId(experimentId, "Experiment: {} is cancelling !!!!!", experimentId);
- return validateStatesAndCancel(experimentId, tokenId);
- }
-
- private String getAiravataUserName() {
- return airavataUserName;
- }
-
- private String getGatewayName() {
- return gatewayName;
- }
-
- public void setAiravataUserName(String airavataUserName) {
- this.airavataUserName = airavataUserName;
- }
-
- public void setGatewayName(String gatewayName) {
- this.gatewayName = gatewayName;
- }
-
- @Override
- public boolean launchTask(String taskId, String airavataCredStoreToken) throws TException {
- try {
- TaskDetails taskData = (TaskDetails) registry.get(
- RegistryModelType.TASK_DETAIL, taskId);
- String applicationId = taskData.getApplicationId();
- if (applicationId == null) {
- log.errorId(taskId, "Application id shouldn't be null.");
- throw new OrchestratorException("Error executing the job, application id shouldn't be null.");
- }
- ApplicationDeploymentDescription applicationDeploymentDescription = getAppDeployment(taskData, applicationId);
- taskData.setApplicationDeploymentId(applicationDeploymentDescription.getAppDeploymentId());
- registry.update(RegistryModelType.TASK_DETAIL, taskData,taskData.getTaskID());
- List<Object> workflowNodeDetailList = registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL,
- org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants.TASK_LIST, taskData);
- if (workflowNodeDetailList != null
- && workflowNodeDetailList.size() > 0) {
- List<Object> experimentList = registry.get(RegistryModelType.EXPERIMENT,
- org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.ExperimentConstants.WORKFLOW_NODE_LIST,
- (WorkflowNodeDetails) workflowNodeDetailList.get(0));
- if (experimentList != null && experimentList.size() > 0) {
- return orchestrator
- .launchExperiment(
- (Experiment) experimentList.get(0),
- (WorkflowNodeDetails) workflowNodeDetailList
- .get(0), taskData,airavataCredStoreToken);
- }
- }
- } catch (Exception e) {
- log.errorId(taskId, "Error while launching task ", e);
- throw new TException(e);
- }
- log.infoId(taskId, "No experiment found associated in task {}", taskId);
- return false;
- }
-
- private ApplicationDeploymentDescription getAppDeployment(
- TaskDetails taskData, String applicationId)
- throws AppCatalogException, OrchestratorException,
- ClassNotFoundException, ApplicationSettingsException,
- InstantiationException, IllegalAccessException {
- AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
- String selectedModuleId = getModuleId(appCatalog, applicationId);
- ApplicationDeploymentDescription applicationDeploymentDescription = getAppDeployment(
- appCatalog, taskData, selectedModuleId);
- return applicationDeploymentDescription;
- }
-
- private ApplicationDeploymentDescription getAppDeployment(
- AppCatalog appCatalog, TaskDetails taskData, String selectedModuleId)
- throws AppCatalogException, ClassNotFoundException,
- ApplicationSettingsException, InstantiationException,
- IllegalAccessException {
- Map<String, String> moduleIdFilter = new HashMap<String, String>();
- moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, selectedModuleId);
- if (taskData.getTaskScheduling()!=null && taskData.getTaskScheduling().getResourceHostId() != null) {
- moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID, taskData.getTaskScheduling().getResourceHostId());
- }
- List<ApplicationDeploymentDescription> applicationDeployements = appCatalog.getApplicationDeployment().getApplicationDeployements(moduleIdFilter);
- Map<ComputeResourceDescription, ApplicationDeploymentDescription> deploymentMap = new HashMap<ComputeResourceDescription, ApplicationDeploymentDescription>();
- ComputeResource computeResource = appCatalog.getComputeResource();
- for (ApplicationDeploymentDescription deploymentDescription : applicationDeployements) {
- deploymentMap.put(computeResource.getComputeResource(deploymentDescription.getComputeHostId()),deploymentDescription);
- }
- List<ComputeResourceDescription> computeHostList = Arrays.asList(deploymentMap.keySet().toArray(new ComputeResourceDescription[]{}));
- Class<? extends HostScheduler> aClass = Class.forName(
- ServerSettings.getHostScheduler()).asSubclass(
- HostScheduler.class);
- HostScheduler hostScheduler = aClass.newInstance();
- ComputeResourceDescription ComputeResourceDescription = hostScheduler.schedule(computeHostList);
- ApplicationDeploymentDescription applicationDeploymentDescription = deploymentMap.get(ComputeResourceDescription);
- return applicationDeploymentDescription;
- }
-
- private String getModuleId(AppCatalog appCatalog, String applicationId)
- throws AppCatalogException, OrchestratorException {
- ApplicationInterfaceDescription applicationInterface = appCatalog.getApplicationInterface().getApplicationInterface(applicationId);
- List<String> applicationModules = applicationInterface.getApplicationModules();
- if (applicationModules.size()==0){
- throw new OrchestratorException(
- "No modules defined for application "
- + applicationId);
- }
-// AiravataAPI airavataAPI = getAiravataAPI();
- String selectedModuleId=applicationModules.get(0);
- return selectedModuleId;
- }
-
- private boolean validateStatesAndCancel(String experimentId, String tokenId)throws TException{
- try {
- Experiment experiment = (Experiment) registry.get(
- RegistryModelType.EXPERIMENT, experimentId);
- log.info("Waiting for zookeeper to connect to the server");
- synchronized (mutex){
- mutex.wait(5000);
- }
- if (experiment == null) {
- log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}.", experimentId);
- throw new OrchestratorException("Error retrieving the Experiment by the given experimentID: " + experimentId);
- }
- ExperimentState experimentState = experiment.getExperimentStatus().getExperimentState();
- if (isCancelValid(experimentState)){
- ExperimentStatus status = new ExperimentStatus();
- status.setExperimentState(ExperimentState.CANCELING);
- status.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- experiment.setExperimentStatus(status);
- registry.update(RegistryModelType.EXPERIMENT, experiment,
- experimentId);
-
- List<String> ids = registry.getIds(
- RegistryModelType.WORKFLOW_NODE_DETAIL,
- WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
- for (String workflowNodeId : ids) {
- WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
- .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
- workflowNodeId);
- int value = workflowNodeDetail.getWorkflowNodeStatus().getWorkflowNodeState().getValue();
- if ( value> 1 && value < 7) { // we skip the unknown state
- log.error(workflowNodeDetail.getNodeName() + " Workflow Node status cannot mark as cancelled, because " +
- "current status is " + workflowNodeDetail.getWorkflowNodeStatus().getWorkflowNodeState().toString());
- continue; // this continue is very useful not to process deeper loops if the upper layers have non-cancel states
- } else {
- WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
- workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.CANCELING);
- workflowNodeStatus.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- workflowNodeDetail.setWorkflowNodeStatus(workflowNodeStatus);
- registry.update(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeDetail,
- workflowNodeId);
- }
- List<Object> taskDetailList = registry.get(
- RegistryModelType.TASK_DETAIL,
- TaskDetailConstants.NODE_ID, workflowNodeId);
- for (Object o : taskDetailList) {
- TaskDetails taskDetails = (TaskDetails) o;
- TaskStatus taskStatus = ((TaskDetails) o).getTaskStatus();
- if (taskStatus.getExecutionState().getValue() > 7 && taskStatus.getExecutionState().getValue()<12) {
- log.error(((TaskDetails) o).getTaskID() + " Task status cannot mark as cancelled, because " +
- "current task state is " + ((TaskDetails) o).getTaskStatus().getExecutionState().toString());
- continue;// this continue is very useful not to process deeper loops if the upper layers have non-cancel states
- } else {
- taskStatus.setExecutionState(TaskState.CANCELING);
- taskStatus.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- taskDetails.setTaskStatus(taskStatus);
- registry.update(RegistryModelType.TASK_DETAIL, o,
- taskDetails.getTaskID());
- }
- orchestrator.cancelExperiment(experiment,
- workflowNodeDetail, taskDetails, tokenId);
- // Status update should be done at the monitor
- }
- }
- }else {
- if (isCancelAllowed(experimentState)){
- // when experiment status is < 3 no jobDetails object is created,
- // so we don't have to worry, we simply have to change the status and stop the execution
- ExperimentStatus status = new ExperimentStatus();
- status.setExperimentState(ExperimentState.CANCELED);
- status.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- experiment.setExperimentStatus(status);
- registry.update(RegistryModelType.EXPERIMENT, experiment,
- experimentId);
- List<String> ids = registry.getIds(
- RegistryModelType.WORKFLOW_NODE_DETAIL,
- WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
- for (String workflowNodeId : ids) {
- WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
- .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
- workflowNodeId);
- WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
- workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.CANCELED);
- workflowNodeStatus.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- workflowNodeDetail.setWorkflowNodeStatus(workflowNodeStatus);
- registry.update(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeDetail,
- workflowNodeId);
- List<Object> taskDetailList = registry.get(
- RegistryModelType.TASK_DETAIL,
- TaskDetailConstants.NODE_ID, workflowNodeId);
- for (Object o : taskDetailList) {
- TaskDetails taskDetails = (TaskDetails) o;
- TaskStatus taskStatus = ((TaskDetails) o).getTaskStatus();
- taskStatus.setExecutionState(TaskState.CANCELED);
- taskStatus.setTimeOfStateChange(Calendar.getInstance()
- .getTimeInMillis());
- taskDetails.setTaskStatus(taskStatus);
- registry.update(RegistryModelType.TASK_DETAIL, o,
- taskDetails);
- }
- }
- }else {
- log.errorId(experimentId, "Unable to mark experiment as Cancelled, current state {} doesn't allow to cancel the experiment {}.",
- experiment.getExperimentStatus().getExperimentState().toString(), experimentId);
- throw new OrchestratorException("Unable to mark experiment as Cancelled, because current state is: "
- + experiment.getExperimentStatus().getExperimentState().toString());
- }
- }
- log.info("Experiment: " + experimentId + " is cancelled !!!!!");
- } catch (Exception e) {
- throw new TException(e);
- }
- return true;
- }
-
- private boolean isCancelValid(ExperimentState state){
- switch (state) {
- case LAUNCHED:
- case EXECUTING:
- case CANCELING:
- return true;
- default:
- return false;
- }
- }
-
- private boolean isCancelAllowed(ExperimentState state){
- switch (state) {
- case CREATED:
- case VALIDATED:
- case SCHEDULED:
- return true;
- default:
- return false;
- }
- }
-
- private void launchWorkflowExperiment(String experimentId, String airavataCredStoreToken) throws TException {
- try {
- WorkflowEnactmentService.getInstance().
- submitWorkflow(experimentId, airavataCredStoreToken, getGatewayName(), getRabbitMQProcessPublisher());
- } catch (Exception e) {
- log.error("Error while launching workflow", e);
- }
- }
-
- public synchronized RabbitMQProcessPublisher getRabbitMQProcessPublisher() throws Exception {
- if (rabbitMQProcessPublisher == null) {
- rabbitMQProcessPublisher = new RabbitMQProcessPublisher();
- }
- return rabbitMQProcessPublisher;
- }
-
-
- private class SingleAppExperimentRunner implements Runnable {
-
- String experimentId;
- String airavataCredStoreToken;
- public SingleAppExperimentRunner(String experimentId,String airavataCredStoreToken){
- this.experimentId = experimentId;
- this.airavataCredStoreToken = airavataCredStoreToken;
- }
- @Override
- public void run() {
- try {
- launchSingleAppExperiment();
- } catch (TException e) {
- e.printStackTrace();
- }
- }
-
- private boolean launchSingleAppExperiment() throws TException {
- Experiment experiment = null;
- try {
- List<String> ids = registry.getIds(RegistryModelType.WORKFLOW_NODE_DETAIL, WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
- for (String workflowNodeId : ids) {
-// WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeId);
- List<Object> taskDetailList = registry.get(RegistryModelType.TASK_DETAIL, TaskDetailConstants.NODE_ID, workflowNodeId);
- for (Object o : taskDetailList) {
- TaskDetails taskData = (TaskDetails) o;
- //iterate through all the generated tasks and performs the job submisssion+monitoring
- experiment = (Experiment) registry.get(RegistryModelType.EXPERIMENT, experimentId);
- if (experiment == null) {
- log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}", experimentId);
- return false;
- }
- String gatewayId = null;
- CredentialReader credentialReader = GFacUtils.getCredentialReader();
- if (credentialReader != null) {
- try {
- gatewayId = credentialReader.getGatewayID(airavataCredStoreToken);
- } catch (Exception e) {
- log.error(e.getLocalizedMessage());
- }
- }
- if (gatewayId == null || gatewayId.isEmpty()) {
- gatewayId = ServerSettings.getDefaultUserGateway();
- }
- ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.LAUNCHED,
- experimentId,
- gatewayId);
- String messageId = AiravataUtils.getId("EXPERIMENT");
- MessageContext messageContext = new MessageContext(event, MessageType.EXPERIMENT, messageId, gatewayId);
- messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
- publisher.publish(messageContext);
- registry.update(RegistryModelType.TASK_DETAIL, taskData, taskData.getTaskID());
- //launching the experiment
- launchTask(taskData.getTaskID(), airavataCredStoreToken);
- }
- }
-
- } catch (Exception e) {
- // Here we really do not have to do much because only potential failure can happen
- // is in gfac, if there are errors in gfac, it will handle the experiment/task/job statuses
- // We might get failures in registry access before submitting the jobs to gfac, in that case we
- // leave the status of these as created.
- ExperimentStatus status = new ExperimentStatus();
- status.setExperimentState(ExperimentState.FAILED);
- status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
- experiment.setExperimentStatus(status);
- try {
- registry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
- } catch (RegistryException e1) {
- log.errorId(experimentId, "Error while updating experiment status to " + status.toString(), e);
- throw new TException(e);
- }
- log.errorId(experimentId, "Error while updating task status, hence updated experiment status to " + status.toString(), e);
- throw new TException(e);
- }
- return true;
- }
- }
-
- private class ProcessConsumer implements Runnable, MessageHandler{
-
-
- @Override
- public void run() {
- try {
- rabbitMQProcessConsumer.listen(this);
- } catch (AiravataException e) {
- log.error("Error while listen to the RabbitMQProcessConsumer");
- }
- }
-
- @Override
- public Map<String, Object> getProperties() {
- Map<String, Object> props = new HashMap<String, Object>();
- props.put(MessagingConstants.RABBIT_QUEUE, RabbitMQProcessPublisher.PROCESS);
- props.put(MessagingConstants.RABBIT_ROUTING_KEY, RabbitMQProcessPublisher.PROCESS);
- return props;
- }
-
- @Override
- public void onMessage(MessageContext msgCtx) {
- TBase event = msgCtx.getEvent();
- if (event instanceof ProcessSubmitEvent) {
- ProcessSubmitEvent processSubmitEvent = (ProcessSubmitEvent) event;
- try {
- launchTask(processSubmitEvent.getTaskId(), processSubmitEvent.getCredentialToken());
- } catch (TException e) {
- log.error("Error while launching task : " + processSubmitEvent.getTaskId());
- }
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
deleted file mode 100644
index f9833e9..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
+++ /dev/null
@@ -1,29 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.util;
-
-public class Constants {
- public static final String ORCHESTRATOT_SERVER_PORT = "orchestrator.server.port";
- public static final String ORCHESTRATOT_SERVER_HOST = "orchestrator.server.host";
- public static final String ORCHESTRATOT_SERVER_MIN_THREADS = "orchestrator.server.min.threads";
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
deleted file mode 100644
index da11a59..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
+++ /dev/null
@@ -1,55 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.util;
-
-import java.util.List;
-
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.airavata.appcatalog.cpi.ApplicationInterface;
-import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
-import org.apache.airavata.model.util.ExecutionType;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DataModelUtils {
-
- private final static Logger logger = LoggerFactory.getLogger(DataModelUtils.class);
- public static ExecutionType getExecutionType(String gatewayId, Experiment experiment){
- try {
- ApplicationInterface applicationInterface = AppCatalogFactory.getAppCatalog().getApplicationInterface();
- List<String> allApplicationInterfaceIds = applicationInterface.getAllApplicationInterfaceIds();
- String applicationId = experiment.getApplicationId();
- if (allApplicationInterfaceIds.contains(applicationId)){
- return ExecutionType.SINGLE_APP;
- } else {
- List<String> allWorkflows = AppCatalogFactory.getAppCatalog().getWorkflowCatalog().getAllWorkflows(gatewayId);
- if (allWorkflows.contains(applicationId)){
- return ExecutionType.WORKFLOW;
- }
- }
- } catch (AppCatalogException e) {
- logger.error(e.getMessage(), e);
- }
- return ExecutionType.UNKNOWN;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
deleted file mode 100644
index 1730998..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
+++ /dev/null
@@ -1,56 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.util;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.logger.AiravataLogger;
-import org.apache.airavata.common.logger.AiravataLoggerFactory;
-import org.apache.airavata.common.utils.ServerSettings;
-
-public class OrchestratorServerThreadPoolExecutor {
- private final static AiravataLogger logger = AiravataLoggerFactory.getLogger(OrchestratorServerThreadPoolExecutor.class);
- public static final String AIRAVATA_SERVER_THREAD_POOL_SIZE = "airavata.server.thread.pool.size";
-
- private static ExecutorService threadPool;
-
- public static ExecutorService getCachedThreadPool() {
- if(threadPool ==null){
- threadPool = Executors.newCachedThreadPool();
- }
- return threadPool;
- }
-
- public static ExecutorService getFixedThreadPool() {
- if(threadPool ==null){
- try {
- threadPool = Executors.newFixedThreadPool(Integer.parseInt(ServerSettings.getSetting(AIRAVATA_SERVER_THREAD_POOL_SIZE)));
- } catch (ApplicationSettingsException e) {
- logger.error("Error reading " + AIRAVATA_SERVER_THREAD_POOL_SIZE+ " property");
- }
- }
- return threadPool;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/main/resources/gsissh.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/resources/gsissh.properties b/modules/orchestrator/airavata-orchestrator-service/src/main/resources/gsissh.properties
deleted file mode 100644
index 3fdf76d..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/resources/gsissh.properties
+++ /dev/null
@@ -1,26 +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.
-#
-
-###########################################################################
-# Specifies system level configurations as a key/value pairs.
-###########################################################################
-
-StrictHostKeyChecking=no
-ssh.session.timeout=360000
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
deleted file mode 100644
index 18168c7..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
+++ /dev/null
@@ -1,90 +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.
- *
-*/
-
-package org.apache.airavata.orchestrator.client;
-
-//import org.apache.airavata.client.AiravataAPIFactory;
-//import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.client.tools.DocumentCreator;
-//import org.apache.airavata.client.tools.DocumentCreatorNew;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.AiravataZKUtils;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.error.AiravataClientConnectException;
-import org.apache.airavata.orchestrator.client.util.Initialize;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.airavata.orchestrator.server.OrchestratorServer;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.Registry;
-import org.apache.zookeeper.server.ServerCnxnFactory;
-import org.junit.Test;
-
-public class OrchestratorClientFactoryTest {
-/* private DocumentCreatorNew documentCreator;
- private OrchestratorService.Client orchestratorClient;
- private Registry registry;
- private int NUM_CONCURRENT_REQUESTS = 1;
- Initialize initialize;
- OrchestratorServer service;
- private static ServerCnxnFactory cnxnFactory;
-
- @Test
- public void setUp() {
- AiravataUtils.setExecutionAsServer();
- initialize = new Initialize("registry-derby.sql");
- initialize.initializeDB();
- System.setProperty(Constants.ZOOKEEPER_SERVER_PORT,"2185");
- AiravataZKUtils.startEmbeddedZK(cnxnFactory);
-
- try {
- service = (new OrchestratorServer());
- service.start();
- registry = RegistryFactory.getDefaultRegistry();
- documentCreator = new DocumentCreatorNew(getAiravataClient());
- documentCreator.createLocalHostDocs();
- } catch (Exception e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- AiravataUtils.setExecutionAsServer();
- try {
- service.stop();
- } catch (Exception e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
-
- }
-
- private Airavata.Client getAiravataClient() {
- Airavata.Client client = null;
- try {
- client = AiravataClientFactory.createAiravataClient("localhost", 8930);
- } catch (AiravataClientConnectException e) {
- e.printStackTrace();
- }
- return client;
- }
-
- private void storeDescriptors() {
-
- }*/
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java b/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
deleted file mode 100644
index c827fc4..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
+++ /dev/null
@@ -1,330 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.client.util;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.resources.*;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.derby.drda.NetworkServerControl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.InetAddress;
-import java.sql.*;
-import java.util.StringTokenizer;
-
-public class Initialize {
- private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
- public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
- public String scriptName = "registry-derby.sql";
- private NetworkServerControl server;
- private static final String delimiter = ";";
- public static final String PERSISTANT_DATA = "Configuration";
-
- public Initialize(String scriptName) {
- this.scriptName = scriptName;
- }
-
- public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
- if (suffix.length() > buffer.length()) {
- return false;
- }
- // this loop is done on purpose to avoid memory allocation performance
- // problems on various JDKs
- // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
- // implementation is ok though does allocation/copying
- // StringBuffer.toString().endsWith() does massive memory
- // allocation/copying on JDK 1.5
- // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
- int endIndex = suffix.length() - 1;
- int bufferIndex = buffer.length() - 1;
- while (endIndex >= 0) {
- if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
- return false;
- }
- bufferIndex--;
- endIndex--;
- }
- return true;
- }
-
- private static boolean isServerStarted(NetworkServerControl server, int ntries)
- {
- for (int i = 1; i <= ntries; i ++)
- {
- try {
- Thread.sleep(500);
- server.ping();
- return true;
- }
- catch (Exception e) {
- if (i == ntries)
- return false;
- }
- }
- return false;
- }
-
- public void initializeDB() throws SQLException{
- String jdbcUrl = null;
- String jdbcUser = null;
- String jdbcPassword = null;
- try{
- jdbcUrl = ServerSettings.getSetting("registry.jdbc.url");
- jdbcUser = ServerSettings.getSetting("registry.jdbc.user");
- jdbcPassword = ServerSettings.getSetting("registry.jdbc.password");
- jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
- } catch (ApplicationSettingsException e) {
- logger.error("Unable to read properties", e);
- }
- startDerbyInServerMode();
- if(!isServerStarted(server, 20)){
- throw new RuntimeException("Derby server cound not started within five seconds...");
- }
-
- Connection conn = null;
- try {
- Class.forName(Utils.getJDBCDriver()).newInstance();
- conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
- if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
- executeSQLScript(conn);
- logger.info("New Database created for Registry");
- } else {
- logger.debug("Database already created for Registry!");
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- throw new RuntimeException("Database failure", e);
- } finally {
- try {
- if (conn != null){
- if (!conn.getAutoCommit()) {
- conn.commit();
- }
- conn.close();
- }
- } catch (SQLException e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- try{
- GatewayResource gatewayResource = new GatewayResource();
- gatewayResource.setGatewayId(ServerSettings.getSetting("default.registry.gateway"));
- gatewayResource.setGatewayName(ServerSettings.getSetting("default.registry.gateway"));
- gatewayResource.setDomain("test-domain");
- gatewayResource.setEmailAddress("test-email");
- gatewayResource.save();
-
- UserResource userResource = new UserResource();
- userResource.setUserName(ServerSettings.getSetting("default.registry.user"));
- userResource.setPassword(ServerSettings.getSetting("default.registry.password"));
- userResource.save();
-
- WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
- workerResource.setUser(userResource.getUserName());
- workerResource.save();
-
- ProjectResource projectResource = (ProjectResource)workerResource.create(ResourceType.PROJECT);
- projectResource.setGatewayId(gatewayResource.getGatewayId());
- projectResource.setId("default");
- projectResource.setName("default");
- projectResource.setWorker(workerResource);
- projectResource.save();
-
-
- } catch (ApplicationSettingsException e) {
- logger.error("Unable to read properties", e);
- throw new SQLException(e.getMessage(), e);
- } catch (RegistryException e) {
- logger.error("Unable to save data to registry", e);
- throw new SQLException(e.getMessage(), e);
- }
- }
-
- public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
- try {
- System.out.println("Running a query to test the database tables existence.");
- // check whether the tables are already created with a query
- Statement statement = null;
- try {
- statement = conn.createStatement();
- ResultSet rs = statement.executeQuery("select * from " + tableName);
- if (rs != null) {
- rs.close();
- }
- } finally {
- try {
- if (statement != null) {
- statement.close();
- }
- } catch (SQLException e) {
- return false;
- }
- }
- } catch (SQLException e) {
- return false;
- }
-
- return true;
- }
-
- private void executeSQLScript(Connection conn) throws Exception {
- StringBuffer sql = new StringBuffer();
- BufferedReader reader = null;
- try{
-
- InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName);
- reader = new BufferedReader(new InputStreamReader(inputStream));
- String line;
- while ((line = reader.readLine()) != null) {
- line = line.trim();
- if (line.startsWith("//")) {
- continue;
- }
- if (line.startsWith("--")) {
- continue;
- }
- StringTokenizer st = new StringTokenizer(line);
- if (st.hasMoreTokens()) {
- String token = st.nextToken();
- if ("REM".equalsIgnoreCase(token)) {
- continue;
- }
- }
- sql.append(" ").append(line);
-
- // SQL defines "--" as a comment to EOL
- // and in Oracle it may contain a hint
- // so we cannot just remove it, instead we must end it
- if (line.indexOf("--") >= 0) {
- sql.append("\n");
- }
- if ((checkStringBufferEndsWith(sql, delimiter))) {
- executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
- sql.replace(0, sql.length(), "");
- }
- }
- // Catch any statements not followed by ;
- if (sql.length() > 0) {
- executeSQL(sql.toString(), conn);
- }
- }catch (IOException e){
- logger.error("Error occurred while executing SQL script for creating Airavata database", e);
- throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
- }finally {
- if (reader != null) {
- reader.close();
- }
-
- }
-
- }
-
- private static void executeSQL(String sql, Connection conn) throws Exception {
- // Check and ignore empty statements
- if ("".equals(sql.trim())) {
- return;
- }
-
- Statement statement = null;
- try {
- logger.debug("SQL : " + sql);
-
- boolean ret;
- int updateCount = 0, updateCountTotal = 0;
- statement = conn.createStatement();
- ret = statement.execute(sql);
- updateCount = statement.getUpdateCount();
- do {
- if (!ret) {
- if (updateCount != -1) {
- updateCountTotal += updateCount;
- }
- }
- ret = statement.getMoreResults();
- if (ret) {
- updateCount = statement.getUpdateCount();
- }
- } while (ret);
-
- logger.debug(sql + " : " + updateCountTotal + " rows affected");
-
- SQLWarning warning = conn.getWarnings();
- while (warning != null) {
- logger.warn(warning + " sql warning");
- warning = warning.getNextWarning();
- }
- conn.clearWarnings();
- } catch (SQLException e) {
- if (e.getSQLState().equals("X0Y32")) {
- // eliminating the table already exception for the derby
- // database
- logger.info("Table Already Exists", e);
- } else {
- throw new Exception("Error occurred while executing : " + sql, e);
- }
- } finally {
- if (statement != null) {
- try {
- statement.close();
- } catch (SQLException e) {
- logger.error("Error occurred while closing result set.", e);
- }
- }
- }
- }
-
- private void startDerbyInServerMode() {
- try {
- System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
- server = new NetworkServerControl(InetAddress.getByName(Utils.getHost()),
- 20000,
- Utils.getJDBCUser(), Utils.getJDBCPassword());
- java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
- server.start(consoleWriter);
- } catch (IOException e) {
- logger.error("Unable to start Apache derby in the server mode! Check whether " +
- "specified port is available");
- } catch (Exception e) {
- logger.error("Unable to start Apache derby in the server mode! Check whether " +
- "specified port is available");
- }
-
- }
-
- public void stopDerbyServer() throws SQLException{
- try {
- server.shutdown();
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- throw new SQLException("Error while stopping derby server", e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/resources/gsissh.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/gsissh.properties b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/gsissh.properties
deleted file mode 100644
index 3fdf76d..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/gsissh.properties
+++ /dev/null
@@ -1,26 +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.
-#
-
-###########################################################################
-# Specifies system level configurations as a key/value pairs.
-###########################################################################
-
-StrictHostKeyChecking=no
-ssh.session.timeout=360000
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
deleted file mode 100644
index 7f0299a..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/monitor.properties
+++ /dev/null
@@ -1,30 +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.
-#
-
-primaryMonitor=org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
-secondaryMonitor=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor
-amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
-connection.name=xsede_private
-trusted.certificate.location=/Users/chathuri/dev/airavata/cert/certificates
-certificate.path=/Users/chathuri/dev/airavata/cert/certificates
-myproxy.server=myproxy.teragrid.org
-myproxy.user=ogce
-myproxy.password=
-myproxy.life=3600
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/resources/orchestrator.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/orchestrator.properties b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/orchestrator.properties
deleted file mode 100644
index e84c429..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/orchestrator.properties
+++ /dev/null
@@ -1,26 +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.
-#
-job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
-job.validators=org.apache.airavata.orchestrator.core.validator.impl.BatchQueueValidator
-submitter.interval=10000
-threadpool.size=0
-start.submitter=true
-embedded.mode=true
-enable.validation=false
[6/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
deleted file mode 100644
index 9ed5ca9..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/registry-derby.sql
+++ /dev/null
@@ -1,361 +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.
- *
- */
-CREATE TABLE GATEWAY
-(
- GATEWAY_NAME VARCHAR(255),
- OWNER VARCHAR(255),
- PRIMARY KEY (GATEWAY_NAME)
-);
-
-CREATE TABLE CONFIGURATION
-(
- CONFIG_KEY VARCHAR(255),
- CONFIG_VAL VARCHAR(255),
- EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- CATEGORY_ID VARCHAR (255),
- 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');
-
-CREATE TABLE USERS
-(
- USER_NAME VARCHAR(255),
- PASSWORD VARCHAR(255),
- PRIMARY KEY(USER_NAME)
-);
-
-CREATE TABLE GATEWAY_WORKER
-(
- GATEWAY_NAME VARCHAR(255),
- USER_NAME VARCHAR(255),
- PRIMARY KEY (GATEWAY_NAME, USER_NAME),
- FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PROJECT
-(
- GATEWAY_NAME VARCHAR(255),
- USER_NAME VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255),
- PROJECT_NAME VARCHAR(255) NOT NULL,
- DESCRIPTION VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (PROJECT_ID),
- FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PROJECT_USER
-(
- PROJECT_ID VARCHAR(255),
- USER_NAME VARCHAR(255),
- PRIMARY KEY (PROJECT_ID,USER_NAME),
- FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PUBLISHED_WORKFLOW
-(
- GATEWAY_NAME VARCHAR(255),
- CREATED_USER VARCHAR(255),
- PUBLISH_WORKFLOW_NAME VARCHAR(255),
- VERSION VARCHAR(255),
- PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- PATH VARCHAR (255),
- WORKFLOW_CONTENT BLOB,
- PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
- FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
- FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE USER_WORKFLOW
-(
- GATEWAY_NAME VARCHAR(255),
- OWNER VARCHAR(255),
- TEMPLATE_NAME VARCHAR(255),
- LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT TIMESTAMP,
- PATH VARCHAR (255),
- WORKFLOW_GRAPH BLOB,
- PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
- FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
- FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT
-(
- EXPERIMENT_ID VARCHAR(255),
- GATEWAY_NAME VARCHAR(255),
- EXECUTION_USER VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255) NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- EXPERIMENT_NAME VARCHAR(255) NOT NULL,
- EXPERIMENT_DESCRIPTION VARCHAR(255),
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- WORKFLOW_TEMPLATE_ID VARCHAR(255),
- WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
- WORKFLOW_EXECUTION_ID VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID),
- FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
- FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
- FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_INPUT
-(
- EXPERIMENT_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- INPUT_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE CLOB,
- PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_OUTPUT
-(
- EXPERIMENT_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- OUTPUT_KEY_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE CLOB,
- PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-
-CREATE TABLE WORKFLOW_NODE_DETAIL
-(
- EXPERIMENT_ID VARCHAR(255) NOT NULL,
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- NODE_NAME VARCHAR(255) NOT NULL,
- EXECUTION_UNIT VARCHAR(255) NOT NULL,
- EXECUTION_UNIT_DATA VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE TASK_DETAIL
-(
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- APPLICATION_DEPLOYMENT_ID VARCHAR(255),
- PRIMARY KEY(TASK_ID),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ERROR_DETAIL
-(
- ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- ACTUAL_ERROR_MESSAGE CLOB,
- USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
- TRANSIENT_OR_PERSISTENT SMALLINT,
- ERROR_CATEGORY VARCHAR(255),
- CORRECTIVE_ACTION VARCHAR(255),
- ACTIONABLE_GROUP VARCHAR(255),
- PRIMARY KEY(ERROR_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_INPUT
-(
- TASK_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- INPUT_KEY_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE CLOB,
- PRIMARY KEY(TASK_ID,INPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_OUTPUT
-(
- TASK_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- OUTPUT_KEY_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE CLOB,
- PRIMARY KEY(TASK_ID,OUTPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_INPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- INPUT_KEY_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_OUTPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- OUTPUT_KEY_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE JOB_DETAIL
-(
- JOB_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_DESCRIPTION CLOB NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
- PRIMARY KEY (TASK_ID, JOB_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE DATA_TRANSFER_DETAIL
-(
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- TRANSFER_DESC CLOB NOT NULL,
- PRIMARY KEY(TRANSFER_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE STATUS
-(
- STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- STATE VARCHAR(255),
- STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- STATUS_TYPE VARCHAR(255),
- PRIMARY KEY(STATUS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
- FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE CONFIG_DATA
-(
- EXPERIMENT_ID VARCHAR(255),
- AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
- OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
- SHARE_EXPERIMENT SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID)
-);
-
-CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
-(
- RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- RESOURCE_HOST_ID VARCHAR(255),
- CPU_COUNT INTEGER,
- NODE_COUNT INTEGER,
- NO_OF_THREADS INTEGER,
- QUEUE_NAME VARCHAR(255),
- WALLTIME_LIMIT INTEGER,
- JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- TOTAL_PHYSICAL_MEMORY INTEGER,
- COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
- PRIMARY KEY(RESOURCE_SCHEDULING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
-(
- INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- WORKING_DIR_PARENT VARCHAR(255),
- UNIQUE_WORKING_DIR VARCHAR(255),
- STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
- CLEAN_AFTER_JOB SMALLINT,
- PRIMARY KEY(INPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
-(
- OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- OUTPUT_DATA_DIR VARCHAR(255),
- DATA_REG_URL VARCHAR (255),
- PERSIST_OUTPUT_DATA SMALLINT,
- PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE QOS_PARAM
-(
- QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- START_EXECUTION_AT VARCHAR(255),
- EXECUTE_BEFORE VARCHAR(255),
- NO_OF_RETRIES INTEGER,
- PRIMARY KEY(QOS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE COMMUNITY_USER
-(
- GATEWAY_NAME VARCHAR(256) NOT NULL,
- COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
- PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-CREATE TABLE CREDENTIALS
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- CREDENTIAL BLOB NOT NULL,
- PORTAL_USER_ID VARCHAR(256) NOT NULL,
- TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-service/src/test/resources/zoo.cfg
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/zoo.cfg b/modules/orchestrator/airavata-orchestrator-service/src/test/resources/zoo.cfg
deleted file mode 100644
index 7233cf4..0000000
--- a/modules/orchestrator/airavata-orchestrator-service/src/test/resources/zoo.cfg
+++ /dev/null
@@ -1,22 +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.
-
-tickTime=2000
-initLimit=10
-syncLimit=5
-dataDir=data
-clientPort=2185
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/pom.xml b/modules/orchestrator/airavata-orchestrator-stubs/pom.xml
deleted file mode 100644
index 4ae7392..0000000
--- a/modules/orchestrator/airavata-orchestrator-stubs/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>orchestrator</artifactId>
- <groupId>org.apache.airavata</groupId>
- <version>0.16-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <name>Airavata Orchestrator Client SDK</name>
- <artifactId>airavata-orchestrator-stubs</artifactId>
- <packaging>jar</packaging>
- <url>http://airavata.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>${thrift.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${org.slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-data-models</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-model-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-client-configuration</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- </properties>
-
-</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
deleted file mode 100644
index c2a31cc..0000000
--- a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-
-package org.apache.airavata.orchestrator.client;
-
-import org.apache.airavata.model.error.AiravataClientConnectException;
-import org.apache.airavata.orchestrator.cpi.OrchestratorService;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-public class OrchestratorClientFactory {
-
- public static OrchestratorService.Client createOrchestratorClient(String serverHost, int serverPort) throws AiravataClientConnectException{
- try {
- TTransport transport = new TSocket(serverHost, serverPort);
- transport.open();
- TProtocol protocol = new TBinaryProtocol(transport);
- return new OrchestratorService.Client(protocol);
- } catch (TTransportException e) {
- throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort);
- }
- }
-}
[5/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
deleted file mode 100644
index ad3edb3..0000000
--- a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
+++ /dev/null
@@ -1,4669 +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.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.orchestrator.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class OrchestratorService {
-
- public interface Iface {
-
- /**
- * Query orchestrator server to fetch the CPI version
- */
- public String getOrchestratorCPIVersion() throws org.apache.thrift.TException;
-
- /**
- * * After creating the experiment Data user have the
- * * experimentID as the handler to the experiment, during the launchExperiment
- * * We just have to give the experimentID
- * *
- * * @param experimentID
- * * @return sucess/failure
- * *
- * *
- *
- * @param experimentId
- * @param airavataCredStoreToken
- */
- public boolean launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException;
-
- /**
- * * In order to run single applications users should create an associating
- * * WorkflowNodeDetails and a TaskDetails for it and hand it over for execution
- * * along with a credential store token for authentication
- * *
- * * @param taskId
- * * @param airavataCredStoreToken
- * * @return sucess/failure
- * *
- * *
- *
- * @param taskId
- * @param airavataCredStoreToken
- */
- public boolean launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException;
-
- /**
- * *
- * * Validate funcations which can verify if the experiment is ready to be launced.
- * *
- * * @param experimentID
- * * @return sucess/failure
- * *
- * *
- *
- * @param experimentId
- */
- public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException;
-
- /**
- * *
- * * Terminate the running experiment.
- * *
- * * @param experimentID
- * * @return sucess/failure
- * *
- * *
- *
- * @param experimentId
- * @param tokenId
- */
- public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- public void getOrchestratorCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void launchExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void launchTask(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public static class Client extends org.apache.thrift.TServiceClient implements Iface {
- public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
- public Factory() {}
- public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
- return new Client(prot);
- }
- public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- return new Client(iprot, oprot);
- }
- }
-
- public Client(org.apache.thrift.protocol.TProtocol prot)
- {
- super(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- super(iprot, oprot);
- }
-
- public String getOrchestratorCPIVersion() throws org.apache.thrift.TException
- {
- send_getOrchestratorCPIVersion();
- return recv_getOrchestratorCPIVersion();
- }
-
- public void send_getOrchestratorCPIVersion() throws org.apache.thrift.TException
- {
- getOrchestratorCPIVersion_args args = new getOrchestratorCPIVersion_args();
- sendBase("getOrchestratorCPIVersion", args);
- }
-
- public String recv_getOrchestratorCPIVersion() throws org.apache.thrift.TException
- {
- getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
- receiveBase(result, "getOrchestratorCPIVersion");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOrchestratorCPIVersion failed: unknown result");
- }
-
- public boolean launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException
- {
- send_launchExperiment(experimentId, airavataCredStoreToken);
- return recv_launchExperiment();
- }
-
- public void send_launchExperiment(String experimentId, String airavataCredStoreToken) throws org.apache.thrift.TException
- {
- launchExperiment_args args = new launchExperiment_args();
- args.setExperimentId(experimentId);
- args.setAiravataCredStoreToken(airavataCredStoreToken);
- sendBase("launchExperiment", args);
- }
-
- public boolean recv_launchExperiment() throws org.apache.thrift.TException
- {
- launchExperiment_result result = new launchExperiment_result();
- receiveBase(result, "launchExperiment");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchExperiment failed: unknown result");
- }
-
- public boolean launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException
- {
- send_launchTask(taskId, airavataCredStoreToken);
- return recv_launchTask();
- }
-
- public void send_launchTask(String taskId, String airavataCredStoreToken) throws org.apache.thrift.TException
- {
- launchTask_args args = new launchTask_args();
- args.setTaskId(taskId);
- args.setAiravataCredStoreToken(airavataCredStoreToken);
- sendBase("launchTask", args);
- }
-
- public boolean recv_launchTask() throws org.apache.thrift.TException
- {
- launchTask_result result = new launchTask_result();
- receiveBase(result, "launchTask");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchTask failed: unknown result");
- }
-
- public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
- {
- send_validateExperiment(experimentId);
- return recv_validateExperiment();
- }
-
- public void send_validateExperiment(String experimentId) throws org.apache.thrift.TException
- {
- validateExperiment_args args = new validateExperiment_args();
- args.setExperimentId(experimentId);
- sendBase("validateExperiment", args);
- }
-
- public boolean recv_validateExperiment() throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException
- {
- validateExperiment_result result = new validateExperiment_result();
- receiveBase(result, "validateExperiment");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.lve != null) {
- throw result.lve;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "validateExperiment failed: unknown result");
- }
-
- public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
- {
- send_terminateExperiment(experimentId, tokenId);
- return recv_terminateExperiment();
- }
-
- public void send_terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
- {
- terminateExperiment_args args = new terminateExperiment_args();
- args.setExperimentId(experimentId);
- args.setTokenId(tokenId);
- sendBase("terminateExperiment", args);
- }
-
- public boolean recv_terminateExperiment() throws org.apache.thrift.TException
- {
- terminateExperiment_result result = new terminateExperiment_result();
- receiveBase(result, "terminateExperiment");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "terminateExperiment failed: unknown result");
- }
-
- }
- public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
- public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
- private org.apache.thrift.async.TAsyncClientManager clientManager;
- private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
- public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
- this.clientManager = clientManager;
- this.protocolFactory = protocolFactory;
- }
- public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
- return new AsyncClient(protocolFactory, clientManager, transport);
- }
- }
-
- public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
- super(protocolFactory, clientManager, transport);
- }
-
- public void getOrchestratorCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getOrchestratorCPIVersion_call method_call = new getOrchestratorCPIVersion_call(resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getOrchestratorCPIVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
- public getOrchestratorCPIVersion_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOrchestratorCPIVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getOrchestratorCPIVersion_args args = new getOrchestratorCPIVersion_args();
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public String getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getOrchestratorCPIVersion();
- }
- }
-
- public void launchExperiment(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- launchExperiment_call method_call = new launchExperiment_call(experimentId, airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class launchExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String experimentId;
- private String airavataCredStoreToken;
- public launchExperiment_call(String experimentId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.experimentId = experimentId;
- this.airavataCredStoreToken = airavataCredStoreToken;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
- launchExperiment_args args = new launchExperiment_args();
- args.setExperimentId(experimentId);
- args.setAiravataCredStoreToken(airavataCredStoreToken);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_launchExperiment();
- }
- }
-
- public void launchTask(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- launchTask_call method_call = new launchTask_call(taskId, airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class launchTask_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String taskId;
- private String airavataCredStoreToken;
- public launchTask_call(String taskId, String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.taskId = taskId;
- this.airavataCredStoreToken = airavataCredStoreToken;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchTask", org.apache.thrift.protocol.TMessageType.CALL, 0));
- launchTask_args args = new launchTask_args();
- args.setTaskId(taskId);
- args.setAiravataCredStoreToken(airavataCredStoreToken);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_launchTask();
- }
- }
-
- public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- validateExperiment_call method_call = new validateExperiment_call(experimentId, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class validateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String experimentId;
- public validateExperiment_call(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.experimentId = experimentId;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("validateExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
- validateExperiment_args args = new validateExperiment_args();
- args.setExperimentId(experimentId);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_validateExperiment();
- }
- }
-
- public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- terminateExperiment_call method_call = new terminateExperiment_call(experimentId, tokenId, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class terminateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String experimentId;
- private String tokenId;
- public terminateExperiment_call(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.experimentId = experimentId;
- this.tokenId = tokenId;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("terminateExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
- terminateExperiment_args args = new terminateExperiment_args();
- args.setExperimentId(experimentId);
- args.setTokenId(tokenId);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_terminateExperiment();
- }
- }
-
- }
-
- public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
- }
-
- protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion());
- processMap.put("launchExperiment", new launchExperiment());
- processMap.put("launchTask", new launchTask());
- processMap.put("validateExperiment", new validateExperiment());
- processMap.put("terminateExperiment", new terminateExperiment());
- return processMap;
- }
-
- public static class getOrchestratorCPIVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOrchestratorCPIVersion_args> {
- public getOrchestratorCPIVersion() {
- super("getOrchestratorCPIVersion");
- }
-
- public getOrchestratorCPIVersion_args getEmptyArgsInstance() {
- return new getOrchestratorCPIVersion_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getOrchestratorCPIVersion_result getResult(I iface, getOrchestratorCPIVersion_args args) throws org.apache.thrift.TException {
- getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
- result.success = iface.getOrchestratorCPIVersion();
- return result;
- }
- }
-
- public static class launchExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchExperiment_args> {
- public launchExperiment() {
- super("launchExperiment");
- }
-
- public launchExperiment_args getEmptyArgsInstance() {
- return new launchExperiment_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public launchExperiment_result getResult(I iface, launchExperiment_args args) throws org.apache.thrift.TException {
- launchExperiment_result result = new launchExperiment_result();
- result.success = iface.launchExperiment(args.experimentId, args.airavataCredStoreToken);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- public static class launchTask<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchTask_args> {
- public launchTask() {
- super("launchTask");
- }
-
- public launchTask_args getEmptyArgsInstance() {
- return new launchTask_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public launchTask_result getResult(I iface, launchTask_args args) throws org.apache.thrift.TException {
- launchTask_result result = new launchTask_result();
- result.success = iface.launchTask(args.taskId, args.airavataCredStoreToken);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- public static class validateExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, validateExperiment_args> {
- public validateExperiment() {
- super("validateExperiment");
- }
-
- public validateExperiment_args getEmptyArgsInstance() {
- return new validateExperiment_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public validateExperiment_result getResult(I iface, validateExperiment_args args) throws org.apache.thrift.TException {
- validateExperiment_result result = new validateExperiment_result();
- try {
- result.success = iface.validateExperiment(args.experimentId);
- result.setSuccessIsSet(true);
- } catch (org.apache.airavata.model.error.LaunchValidationException lve) {
- result.lve = lve;
- }
- return result;
- }
- }
-
- public static class terminateExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, terminateExperiment_args> {
- public terminateExperiment() {
- super("terminateExperiment");
- }
-
- public terminateExperiment_args getEmptyArgsInstance() {
- return new terminateExperiment_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public terminateExperiment_result getResult(I iface, terminateExperiment_args args) throws org.apache.thrift.TException {
- terminateExperiment_result result = new terminateExperiment_result();
- result.success = iface.terminateExperiment(args.experimentId, args.tokenId);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- }
-
- public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
- public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
- }
-
- protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion());
- processMap.put("launchExperiment", new launchExperiment());
- processMap.put("launchTask", new launchTask());
- processMap.put("validateExperiment", new validateExperiment());
- processMap.put("terminateExperiment", new terminateExperiment());
- return processMap;
- }
-
- public static class getOrchestratorCPIVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getOrchestratorCPIVersion_args, String> {
- public getOrchestratorCPIVersion() {
- super("getOrchestratorCPIVersion");
- }
-
- public getOrchestratorCPIVersion_args getEmptyArgsInstance() {
- return new getOrchestratorCPIVersion_args();
- }
-
- public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<String>() {
- public void onComplete(String o) {
- getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- getOrchestratorCPIVersion_result result = new getOrchestratorCPIVersion_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, getOrchestratorCPIVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
- iface.getOrchestratorCPIVersion(resultHandler);
- }
- }
-
- public static class launchExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchExperiment_args, Boolean> {
- public launchExperiment() {
- super("launchExperiment");
- }
-
- public launchExperiment_args getEmptyArgsInstance() {
- return new launchExperiment_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- launchExperiment_result result = new launchExperiment_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- launchExperiment_result result = new launchExperiment_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, launchExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.launchExperiment(args.experimentId, args.airavataCredStoreToken,resultHandler);
- }
- }
-
- public static class launchTask<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchTask_args, Boolean> {
- public launchTask() {
- super("launchTask");
- }
-
- public launchTask_args getEmptyArgsInstance() {
- return new launchTask_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- launchTask_result result = new launchTask_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- launchTask_result result = new launchTask_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, launchTask_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.launchTask(args.taskId, args.airavataCredStoreToken,resultHandler);
- }
- }
-
- public static class validateExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, validateExperiment_args, Boolean> {
- public validateExperiment() {
- super("validateExperiment");
- }
-
- public validateExperiment_args getEmptyArgsInstance() {
- return new validateExperiment_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- validateExperiment_result result = new validateExperiment_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- validateExperiment_result result = new validateExperiment_result();
- if (e instanceof org.apache.airavata.model.error.LaunchValidationException) {
- result.lve = (org.apache.airavata.model.error.LaunchValidationException) e;
- result.setLveIsSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, validateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.validateExperiment(args.experimentId,resultHandler);
- }
- }
-
- public static class terminateExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, terminateExperiment_args, Boolean> {
- public terminateExperiment() {
- super("terminateExperiment");
- }
-
- public terminateExperiment_args getEmptyArgsInstance() {
- return new terminateExperiment_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- terminateExperiment_result result = new terminateExperiment_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- terminateExperiment_result result = new terminateExperiment_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, terminateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.terminateExperiment(args.experimentId, args.tokenId,resultHandler);
- }
- }
-
- }
-
- public static class getOrchestratorCPIVersion_args implements org.apache.thrift.TBase<getOrchestratorCPIVersion_args, getOrchestratorCPIVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrchestratorCPIVersion_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrchestratorCPIVersion_args");
-
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getOrchestratorCPIVersion_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getOrchestratorCPIVersion_argsTupleSchemeFactory());
- }
-
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-;
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrchestratorCPIVersion_args.class, metaDataMap);
- }
-
- public getOrchestratorCPIVersion_args() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getOrchestratorCPIVersion_args(getOrchestratorCPIVersion_args other) {
- }
-
- public getOrchestratorCPIVersion_args deepCopy() {
- return new getOrchestratorCPIVersion_args(this);
- }
-
- @Override
- public void clear() {
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getOrchestratorCPIVersion_args)
- return this.equals((getOrchestratorCPIVersion_args)that);
- return false;
- }
-
- public boolean equals(getOrchestratorCPIVersion_args that) {
- if (that == null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(getOrchestratorCPIVersion_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getOrchestratorCPIVersion_args(");
- boolean first = true;
-
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getOrchestratorCPIVersion_argsStandardSchemeFactory implements SchemeFactory {
- public getOrchestratorCPIVersion_argsStandardScheme getScheme() {
- return new getOrchestratorCPIVersion_argsStandardScheme();
- }
- }
-
- private static class getOrchestratorCPIVersion_argsStandardScheme extends StandardScheme<getOrchestratorCPIVersion_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getOrchestratorCPIVersion_argsTupleSchemeFactory implements SchemeFactory {
- public getOrchestratorCPIVersion_argsTupleScheme getScheme() {
- return new getOrchestratorCPIVersion_argsTupleScheme();
- }
- }
-
- private static class getOrchestratorCPIVersion_argsTupleScheme extends TupleScheme<getOrchestratorCPIVersion_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- }
- }
-
- }
-
- public static class getOrchestratorCPIVersion_result implements org.apache.thrift.TBase<getOrchestratorCPIVersion_result, getOrchestratorCPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrchestratorCPIVersion_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrchestratorCPIVersion_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getOrchestratorCPIVersion_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getOrchestratorCPIVersion_resultTupleSchemeFactory());
- }
-
- public String success; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrchestratorCPIVersion_result.class, metaDataMap);
- }
-
- public getOrchestratorCPIVersion_result() {
- }
-
- public getOrchestratorCPIVersion_result(
- String success)
- {
- this();
- this.success = success;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getOrchestratorCPIVersion_result(getOrchestratorCPIVersion_result other) {
- if (other.isSetSuccess()) {
- this.success = other.success;
- }
- }
-
- public getOrchestratorCPIVersion_result deepCopy() {
- return new getOrchestratorCPIVersion_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- }
-
- public String getSuccess() {
- return this.success;
- }
-
- public getOrchestratorCPIVersion_result setSuccess(String success) {
- this.success = success;
- return this;
- }
-
- public void unsetSuccess() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return this.success != null;
- }
-
- public void setSuccessIsSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return getSuccess();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getOrchestratorCPIVersion_result)
- return this.equals((getOrchestratorCPIVersion_result)that);
- return false;
- }
-
- public boolean equals(getOrchestratorCPIVersion_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.isSetSuccess();
- boolean that_present_success = true && that.isSetSuccess();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(getOrchestratorCPIVersion_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getOrchestratorCPIVersion_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getOrchestratorCPIVersion_resultStandardSchemeFactory implements SchemeFactory {
- public getOrchestratorCPIVersion_resultStandardScheme getScheme() {
- return new getOrchestratorCPIVersion_resultStandardScheme();
- }
- }
-
- private static class getOrchestratorCPIVersion_resultStandardScheme extends StandardScheme<getOrchestratorCPIVersion_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.success = iprot.readString();
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeString(struct.success);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getOrchestratorCPIVersion_resultTupleSchemeFactory implements SchemeFactory {
- public getOrchestratorCPIVersion_resultTupleScheme getScheme() {
- return new getOrchestratorCPIVersion_resultTupleScheme();
- }
- }
-
- private static class getOrchestratorCPIVersion_resultTupleScheme extends TupleScheme<getOrchestratorCPIVersion_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetSuccess()) {
- oprot.writeString(struct.success);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getOrchestratorCPIVersion_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.success = iprot.readString();
- struct.setSuccessIsSet(true);
- }
- }
- }
-
- }
-
- public static class launchExperiment_args implements org.apache.thrift.TBase<launchExperiment_args, launchExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_args");
-
- private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataCredStoreToken", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new launchExperiment_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new launchExperiment_argsTupleSchemeFactory());
- }
-
- public String experimentId; // required
- public String airavataCredStoreToken; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- EXPERIMENT_ID((short)1, "experimentId"),
- AIRAVATA_CRED_STORE_TOKEN((short)2, "airavataCredStoreToken");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // EXPERIMENT_ID
- return EXPERIMENT_ID;
- case 2: // AIRAVATA_CRED_STORE_TOKEN
- return AIRAVATA_CRED_STORE_TOKEN;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.AIRAVATA_CRED_STORE_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("airavataCredStoreToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchExperiment_args.class, metaDataMap);
- }
-
- public launchExperiment_args() {
- }
-
- public launchExperiment_args(
- String experimentId,
- String airavataCredStoreToken)
- {
- this();
- this.experimentId = experimentId;
- this.airavataCredStoreToken = airavataCredStoreToken;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public launchExperiment_args(launchExperiment_args other) {
- if (other.isSetExperimentId()) {
- this.experimentId = other.experimentId;
- }
- if (other.isSetAiravataCredStoreToken()) {
- this.airavataCredStoreToken = other.airavataCredStoreToken;
- }
- }
-
- public launchExperiment_args deepCopy() {
- return new launchExperiment_args(this);
- }
-
- @Override
- public void clear() {
- this.experimentId = null;
- this.airavataCredStoreToken = null;
- }
-
- public String getExperimentId() {
- return this.experimentId;
- }
-
- public launchExperiment_args setExperimentId(String experimentId) {
- this.experimentId = experimentId;
- return this;
- }
-
- public void unsetExperimentId() {
- this.experimentId = null;
- }
-
- /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
- public boolean isSetExperimentId() {
- return this.experimentId != null;
- }
-
- public void setExperimentIdIsSet(boolean value) {
- if (!value) {
- this.experimentId = null;
- }
- }
-
- public String getAiravataCredStoreToken() {
- return this.airavataCredStoreToken;
- }
-
- public launchExperiment_args setAiravataCredStoreToken(String airavataCredStoreToken) {
- this.airavataCredStoreToken = airavataCredStoreToken;
- return this;
- }
-
- public void unsetAiravataCredStoreToken() {
- this.airavataCredStoreToken = null;
- }
-
- /** Returns true if field airavataCredStoreToken is set (has been assigned a value) and false otherwise */
- public boolean isSetAiravataCredStoreToken() {
- return this.airavataCredStoreToken != null;
- }
-
- public void setAiravataCredStoreTokenIsSet(boolean value) {
- if (!value) {
- this.airavataCredStoreToken = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EXPERIMENT_ID:
- if (value == null) {
- unsetExperimentId();
- } else {
- setExperimentId((String)value);
- }
- break;
-
- case AIRAVATA_CRED_STORE_TOKEN:
- if (value == null) {
- unsetAiravataCredStoreToken();
- } else {
- setAiravataCredStoreToken((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EXPERIMENT_ID:
- return getExperimentId();
-
- case AIRAVATA_CRED_STORE_TOKEN:
- return getAiravataCredStoreToken();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case EXPERIMENT_ID:
- return isSetExperimentId();
- case AIRAVATA_CRED_STORE_TOKEN:
- return isSetAiravataCredStoreToken();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof launchExperiment_args)
- return this.equals((launchExperiment_args)that);
- return false;
- }
-
- public boolean equals(launchExperiment_args that) {
- if (that == null)
- return false;
-
- boolean this_present_experimentId = true && this.isSetExperimentId();
- boolean that_present_experimentId = true && that.isSetExperimentId();
- if (this_present_experimentId || that_present_experimentId) {
- if (!(this_present_experimentId && that_present_experimentId))
- return false;
- if (!this.experimentId.equals(that.experimentId))
- return false;
- }
-
- boolean this_present_airavataCredStoreToken = true && this.isSetAiravataCredStoreToken();
- boolean that_present_airavataCredStoreToken = true && that.isSetAiravataCredStoreToken();
- if (this_present_airavataCredStoreToken || that_present_airavataCredStoreToken) {
- if (!(this_present_airavataCredStoreToken && that_present_airavataCredStoreToken))
- return false;
- if (!this.airavataCredStoreToken.equals(that.airavataCredStoreToken))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(launchExperiment_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetExperimentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAiravataCredStoreToken()).compareTo(other.isSetAiravataCredStoreToken());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAiravataCredStoreToken()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataCredStoreToken, other.airavataCredStoreToken);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("launchExperiment_args(");
- boolean first = true;
-
- sb.append("experimentId:");
- if (this.experimentId == null) {
- sb.append("null");
- } else {
- sb.append(this.experimentId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("airavataCredStoreToken:");
- if (this.airavataCredStoreToken == null) {
- sb.append("null");
- } else {
- sb.append(this.airavataCredStoreToken);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (experimentId == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' was not present! Struct: " + toString());
- }
- if (airavataCredStoreToken == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataCredStoreToken' was not present! Struct: " + toString());
- }
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class launchExperiment_argsStandardSchemeFactory implements SchemeFactory {
- public launchExperiment_argsStandardScheme getScheme() {
- return new launchExperiment_argsStandardScheme();
- }
- }
-
- private static class launchExperiment_argsStandardScheme extends StandardScheme<launchExperiment_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // EXPERIMENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // AIRAVATA_CRED_STORE_TOKEN
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.airavataCredStoreToken = iprot.readString();
- struct.setAiravataCredStoreTokenIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.experimentId != null) {
- oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
- oprot.writeString(struct.experimentId);
- oprot.writeFieldEnd();
- }
- if (struct.airavataCredStoreToken != null) {
- oprot.writeFieldBegin(AIRAVATA_CRED_STORE_TOKEN_FIELD_DESC);
- oprot.writeString(struct.airavataCredStoreToken);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class launchExperiment_argsTupleSchemeFactory implements SchemeFactory {
- public launchExperiment_argsTupleScheme getScheme() {
- return new launchExperiment_argsTupleScheme();
- }
- }
-
- private static class launchExperiment_argsTupleScheme extends TupleScheme<launchExperiment_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.experimentId);
- oprot.writeString(struct.airavataCredStoreToken);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- struct.airavataCredStoreToken = iprot.readString();
- struct.setAiravataCredStoreTokenIsSet(true);
- }
- }
-
- }
-
- public static class launchExperiment_result implements org.apache.thrift.TBase<launchExperiment_result, launchExperiment_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new launchExperiment_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new launchExperiment_resultTupleSchemeFactory());
- }
-
- public boolean success; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- private static final int __SUCCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchExperiment_result.class, metaDataMap);
- }
-
- public launchExperiment_result() {
- }
-
- public launchExperiment_result(
- boolean success)
- {
- this();
- this.success = success;
- setSuccessIsSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public launchExperiment_result(launchExperiment_result other) {
- __isset_bitfield = other.__isset_bitfield;
- this.success = other.success;
- }
-
- public launchExperiment_result deepCopy() {
- return new launchExperiment_result(this);
- }
-
- @Override
- public void clear() {
- setSuccessIsSet(false);
- this.success = false;
- }
-
- public boolean isSuccess() {
- return this.success;
- }
-
- public launchExperiment_result setSuccess(boolean success) {
- this.success = success;
- setSuccessIsSet(true);
- return this;
- }
-
- public void unsetSuccess() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
- }
-
- public void setSuccessIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((Boolean)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return Boolean.valueOf(isSuccess());
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof launchExperiment_result)
- return this.equals((launchExperiment_result)that);
- return false;
- }
-
- public boolean equals(launchExperiment_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true;
- boolean that_present_success = true;
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (this.success != that.success)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(launchExperiment_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("launchExperiment_result(");
- boolean first = true;
-
- sb.append("success:");
- sb.append(this.success);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class launchExperiment_resultStandardSchemeFactory implements SchemeFactory {
- public launchExperiment_resultStandardScheme getScheme() {
- return new launchExperiment_resultStandardScheme();
- }
- }
-
- private static class launchExperiment_resultStandardScheme extends StandardScheme<launchExperiment_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.isSetSuccess()) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeBool(struct.success);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class launchExperiment_resultTupleSchemeFactory implements SchemeFactory {
- public launchExperiment_resultTupleScheme getScheme() {
- return new launchExperiment_resultTupleScheme();
- }
- }
-
- private static class launchExperiment_resultTupleScheme extends TupleScheme<launchExperiment_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
-
<TRUNCATED>
[2/7] airavata git commit: Renamed orchestrator component nested
modules and artifact ids
Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
new file mode 100644
index 0000000..3fa2946
--- /dev/null
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java
@@ -0,0 +1,55 @@
+ /*
+ * 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.orchestrator.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class orchestrator_cpi_serviceConstants {
+
+ public static final String ORCHESTRATOR_CPI_VERSION = "0.13.0";
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
new file mode 100644
index 0000000..009d110
--- /dev/null
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+package org.apache.airavata.orchestrator.sample;
+
+//import org.apache.airavata.client.AiravataAPIFactory;
+//import org.apache.airavata.client.api.AiravataAPI;
+//import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+//import org.apache.airavata.client.tools.DocumentCreator;
+
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.util.ExperimentModelUtil;
+import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
+import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.thrift.TException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OrchestratorClientSample {
+// private static DocumentCreator documentCreator;
+ private static OrchestratorService.Client orchestratorClient;
+// private static Registry registry;
+ private static int NUM_CONCURRENT_REQUESTS = 1;
+ private static final String DEFAULT_USER = "default.registry.user";
+ private static final String DEFAULT_USER_PASSWORD = "default.registry.password";
+ private static final String DEFAULT_GATEWAY = "default.registry.gateway";
+ private static String sysUser;
+ private static String sysUserPwd;
+ private static String gateway;
+/*
+
+ public static void main(String[] args) {
+ try {
+ AiravataUtils.setExecutionAsClient();
+ sysUser = ClientSettings.getSetting(DEFAULT_USER);
+ sysUserPwd = ClientSettings.getSetting(DEFAULT_USER_PASSWORD);
+ gateway = ClientSettings.getSetting(DEFAULT_GATEWAY);
+ orchestratorClient = OrchestratorClientFactory.createOrchestratorClient("localhost", 8940);
+ registry = RegistryFactory.getRegistry(gateway, sysUser, sysUserPwd);
+ documentCreator = new DocumentCreator(getAiravataAPI());
+ documentCreator.createLocalHostDocs();
+ documentCreator.createGramDocs();
+ documentCreator.createPBSDocsForOGCE();
+ storeExperimentDetail();
+ } catch (ApplicationSettingsException e) {
+ e.printStackTrace();
+ } catch (RegistryException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private static AiravataAPI getAiravataAPI() {
+ AiravataAPI airavataAPI = null;
+ try {
+ airavataAPI = AiravataAPIFactory.getAPI(gateway, sysUser);
+ } catch (AiravataAPIInvocationException e) {
+ e.printStackTrace();
+ }
+ return airavataAPI;
+ }
+*/
+
+ public static void storeExperimentDetail() {
+ for (int i = 0; i < NUM_CONCURRENT_REQUESTS; i++) {
+ Thread thread = new Thread() {
+ public void run() {
+ List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
+ InputDataObjectType input = new InputDataObjectType();
+ input.setName("echo_input");
+ input.setType(DataType.STRING);
+ input.setValue("echo_output=Hello World");
+ exInputs.add(input);
+
+
+ List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
+ OutputDataObjectType output = new OutputDataObjectType();
+ output.setName("echo_output");
+ output.setType(DataType.STRING);
+ output.setValue("");
+ exOut.add(output);
+
+ Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
+ simpleExperiment.setExperimentOutputs(exOut);
+
+ ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+ scheduling.setResourceHostId("gsissh-trestles");
+ UserConfigurationData userConfigurationData = new UserConfigurationData();
+ userConfigurationData.setComputationalResourceScheduling(scheduling);
+ simpleExperiment.setUserConfigurationData(userConfigurationData);
+ String expId = null;
+ try {
+// expId = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try {
+ orchestratorClient.launchExperiment(expId, "airavataToken");
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ thread.start();
+ try {
+ thread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/pom.xml b/modules/orchestrator/orchestrator-core/pom.xml
index e7984b4..80543df 100644
--- a/modules/orchestrator/orchestrator-core/pom.xml
+++ b/modules/orchestrator/orchestrator-core/pom.xml
@@ -18,7 +18,7 @@ the License. -->
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>airavata-orchestrator-core</artifactId>
+ <artifactId>orchestrator-core</artifactId>
<packaging>jar</packaging>
<name>Airavata Orchestrator Core</name>
<url>http://airavata.apache.org/</url>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/pom.xml b/modules/orchestrator/orchestrator-service/pom.xml
new file mode 100644
index 0000000..a3f47c7
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/pom.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>orchestrator</artifactId>
+ <groupId>org.apache.airavata</groupId>
+ <version>0.16-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <name>Airavata Orchestrator Service</name>
+ <artifactId>orchestrator-service</artifactId>
+ <packaging>jar</packaging>
+ <url>http://airavata.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-credential-store</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>libthrift</artifactId>
+ <version>${thrift.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>orchestrator-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>orchestrator-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-workflow-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>app-catalog-data</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>app-catalog-cpi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-model-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-server-configuration</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
new file mode 100644
index 0000000..78957ac
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java
@@ -0,0 +1,160 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.server;
+
+import java.net.InetSocketAddress;
+
+import org.apache.airavata.common.utils.IServer;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.airavata.orchestrator.util.Constants;
+import org.apache.thrift.server.TServer;
+import org.apache.thrift.server.TThreadPoolServer;
+import org.apache.thrift.transport.TServerSocket;
+import org.apache.thrift.transport.TServerTransport;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OrchestratorServer implements IServer{
+
+ private final static Logger logger = LoggerFactory.getLogger(OrchestratorServer.class);
+ private static final String SERVER_NAME = "Orchestrator Server";
+ private static final String SERVER_VERSION = "1.0";
+
+ private ServerStatus status;
+
+ private TServer server;
+
+ public OrchestratorServer() {
+ setStatus(ServerStatus.STOPPED);
+ }
+
+ public void StartOrchestratorServer(OrchestratorService.Processor<OrchestratorServerHandler> orchestratorServerHandlerProcessor)
+ throws Exception {
+ try {
+ final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_PORT,"8940"));
+
+ final String serverHost = ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_HOST, null);
+
+ TServerTransport serverTransport;
+
+ if(serverHost == null){
+ serverTransport = new TServerSocket(serverPort);
+ }else{
+ InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
+ serverTransport = new TServerSocket(inetSocketAddress);
+ }
+
+ //server = new TSimpleServer(
+ // new TServer.Args(serverTransport).processor(orchestratorServerHandlerProcessor));
+ TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
+ options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_MIN_THREADS, "30"));
+ server = new TThreadPoolServer(options.processor(orchestratorServerHandlerProcessor));
+
+ new Thread() {
+ public void run() {
+ server.serve();
+ setStatus(ServerStatus.STOPPED);
+ logger.info("Orchestrator Server Stopped.");
+ }
+ }.start();
+ new Thread() {
+ public void run() {
+ while(!server.isServing()){
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+ if (server.isServing()){
+ setStatus(ServerStatus.STARTED);
+ logger.info("Starting Orchestrator Server on Port " + serverPort);
+ logger.info("Listening to Orchestrator Clients ....");
+ }
+ }
+ }.start();
+ } catch (TTransportException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ }
+ }
+
+ public static void main(String[] args) {
+ try {
+ new OrchestratorServer().start();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public void start() throws Exception {
+ setStatus(ServerStatus.STARTING);
+ OrchestratorService.Processor<OrchestratorServerHandler> orchestratorService =
+ new OrchestratorService.Processor<OrchestratorServerHandler>(new OrchestratorServerHandler());
+ StartOrchestratorServer(orchestratorService);
+ }
+
+ @Override
+ public void stop() throws Exception {
+ if (server!=null && server.isServing()){
+ setStatus(ServerStatus.STOPING);
+ server.stop();
+ }
+
+ }
+
+ @Override
+ public void restart() throws Exception {
+ stop();
+ start();
+ }
+
+ @Override
+ public void configure() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public ServerStatus getStatus() throws Exception {
+ return status;
+ }
+
+ private void setStatus(ServerStatus stat){
+ status=stat;
+ status.updateTime();
+ }
+
+ @Override
+ public String getName() {
+ return SERVER_NAME;
+ }
+
+ @Override
+ public String getVersion() {
+ return SERVER_VERSION;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
new file mode 100644
index 0000000..4ef9dbc
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -0,0 +1,643 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.server;
+
+import org.airavata.appcatalog.cpi.AppCatalog;
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.airavata.appcatalog.cpi.ComputeResource;
+import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
+import org.apache.aiaravata.application.catalog.data.resources.AbstractResource;
+import org.apache.airavata.common.exception.AiravataException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.logger.AiravataLogger;
+import org.apache.airavata.common.logger.AiravataLoggerFactory;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.AiravataZKUtils;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credential.store.store.CredentialReader;
+import org.apache.airavata.gfac.core.scheduler.HostScheduler;
+import org.apache.airavata.gfac.core.utils.GFacUtils;
+import org.apache.airavata.messaging.core.MessageContext;
+import org.apache.airavata.messaging.core.MessageHandler;
+import org.apache.airavata.messaging.core.MessagingConstants;
+import org.apache.airavata.messaging.core.Publisher;
+import org.apache.airavata.messaging.core.PublisherFactory;
+import org.apache.airavata.messaging.core.impl.RabbitMQProcessConsumer;
+import org.apache.airavata.messaging.core.impl.RabbitMQProcessPublisher;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+import org.apache.airavata.model.error.LaunchValidationException;
+import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
+import org.apache.airavata.model.messaging.event.MessageType;
+import org.apache.airavata.model.messaging.event.ProcessSubmitEvent;
+import org.apache.airavata.model.util.ExecutionType;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.ExperimentState;
+import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
+import org.apache.airavata.model.workspace.experiment.TaskDetails;
+import org.apache.airavata.model.workspace.experiment.TaskState;
+import org.apache.airavata.model.workspace.experiment.TaskStatus;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
+import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
+import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
+import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
+import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
+import org.apache.airavata.orchestrator.util.DataModelUtils;
+import org.apache.airavata.orchestrator.util.OrchestratorServerThreadPoolExecutor;
+import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
+import org.apache.airavata.registry.cpi.Registry;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.RegistryModelType;
+import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
+import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
+import org.apache.airavata.workflow.core.WorkflowEnactmentService;
+import org.apache.thrift.TBase;
+import org.apache.thrift.TException;
+
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class OrchestratorServerHandler implements OrchestratorService.Iface {
+ private static AiravataLogger log = AiravataLoggerFactory .getLogger(OrchestratorServerHandler.class);
+ private SimpleOrchestratorImpl orchestrator = null;
+ private Registry registry;
+ private static Integer mutex = new Integer(-1);
+ private String airavataUserName;
+ private String gatewayName;
+ private Publisher publisher;
+ private RabbitMQProcessConsumer rabbitMQProcessConsumer;
+ private RabbitMQProcessPublisher rabbitMQProcessPublisher;
+
+ /**
+ * Query orchestrator server to fetch the CPI version
+ */
+ public String getOrchestratorCPIVersion() throws TException {
+ return orchestrator_cpi_serviceConstants.ORCHESTRATOR_CPI_VERSION;
+ }
+
+ public OrchestratorServerHandler() throws OrchestratorException{
+ // registering with zk
+ try {
+ publisher = PublisherFactory.createActivityPublisher();
+ String zkhostPort = AiravataZKUtils.getZKhostPort();
+ String airavataServerHostPort = ServerSettings
+ .getSetting(Constants.ORCHESTRATOR_SERVER_HOST)
+ + ":"
+ + ServerSettings
+ .getSetting(Constants.ORCHESTRATOR_SERVER_PORT);
+
+// setGatewayName(ServerSettings.getDefaultUserGateway());
+ setAiravataUserName(ServerSettings.getDefaultUser());
+ } catch (AiravataException e) {
+ log.error(e.getMessage(), e);
+ throw new OrchestratorException("Error while initializing orchestrator service", e);
+ }
+ // orchestrator init
+ try {
+ // first constructing the monitorManager and orchestrator, then fill
+ // the required properties
+ orchestrator = new SimpleOrchestratorImpl();
+ registry = RegistryFactory.getDefaultRegistry();
+ orchestrator.initialize();
+ orchestrator.getOrchestratorContext().setPublisher(this.publisher);
+ startProcessConsumer();
+ } catch (OrchestratorException e) {
+ log.error(e.getMessage(), e);
+ throw new OrchestratorException("Error while initializing orchestrator service", e);
+ } catch (RegistryException e) {
+ log.error(e.getMessage(), e);
+ throw new OrchestratorException("Error while initializing orchestrator service", e);
+ }
+ }
+
+ private void startProcessConsumer() throws OrchestratorException {
+ try {
+ rabbitMQProcessConsumer = new RabbitMQProcessConsumer();
+ ProcessConsumer processConsumer = new ProcessConsumer();
+ Thread thread = new Thread(processConsumer);
+ thread.start();
+
+ } catch (AiravataException e) {
+ throw new OrchestratorException("Error while starting process consumer", e);
+ }
+
+ }
+
+ /**
+ * * After creating the experiment Data user have the * experimentID as the
+ * handler to the experiment, during the launchExperiment * We just have to
+ * give the experimentID * * @param experimentID * @return sucess/failure *
+ * *
+ *
+ * @param experimentId
+ */
+ public boolean launchExperiment(String experimentId, String token) throws TException {
+ Experiment experiment = null; // this will inside the bottom catch statement
+ try {
+ experiment = (Experiment) registry.get(
+ RegistryModelType.EXPERIMENT, experimentId);
+ if (experiment == null) {
+ log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {} ", experimentId);
+ return false;
+ }
+ CredentialReader credentialReader = GFacUtils.getCredentialReader();
+ String gatewayId = null;
+ if (credentialReader != null) {
+ try {
+ gatewayId = credentialReader.getGatewayID(token);
+ } catch (Exception e) {
+ log.error(e.getLocalizedMessage());
+ }
+ }
+ if (gatewayId == null) {
+ gatewayId = ServerSettings.getDefaultUserGateway();
+ log.info("Couldn't identify the gateway Id using the credential token, Use default gateway Id");
+// throw new AiravataException("Couldn't identify the gateway Id using the credential token");
+ }
+ ExecutionType executionType = DataModelUtils.getExecutionType(gatewayId, experiment);
+ if (executionType == ExecutionType.SINGLE_APP) {
+ //its an single application execution experiment
+ log.debugId(experimentId, "Launching single application experiment {}.", experimentId);
+ OrchestratorServerThreadPoolExecutor.getCachedThreadPool().execute(new SingleAppExperimentRunner(experimentId, token));
+ } else if (executionType == ExecutionType.WORKFLOW) {
+ //its a workflow execution experiment
+ log.debugId(experimentId, "Launching workflow experiment {}.", experimentId);
+ launchWorkflowExperiment(experimentId, token);
+ } else {
+ log.errorId(experimentId, "Couldn't identify experiment type, experiment {} is neither single application nor workflow.", experimentId);
+ throw new TException("Experiment '" + experimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId());
+ }
+ } catch (Exception e) {
+ throw new TException("Experiment '" + experimentId + "' launch failed. Unable to figureout execution type for application " + experiment.getApplicationId(), e);
+ }
+ return true;
+ }
+
+ /**
+ * This method will validate the experiment before launching, if is failed
+ * we do not run the launch in airavata thrift service (only if validation
+ * is enabled
+ *
+ * @param experimentId
+ * @return
+ * @throws TException
+ */
+ public boolean validateExperiment(String experimentId) throws TException,
+ LaunchValidationException {
+ // TODO: Write the Orchestrator implementaion
+ try {
+ List<TaskDetails> tasks = orchestrator.createTasks(experimentId);
+ if (tasks.size() > 1) {
+ log.info("There are multiple tasks for this experiment, So Orchestrator will launch multiple Jobs");
+ }
+ List<String> ids = registry.getIds(
+ RegistryModelType.WORKFLOW_NODE_DETAIL,
+ WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
+ for (String workflowNodeId : ids) {
+ WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
+ .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
+ workflowNodeId);
+ List<Object> taskDetailList = registry.get(
+ RegistryModelType.TASK_DETAIL,
+ TaskDetailConstants.NODE_ID, workflowNodeId);
+ for (Object o : taskDetailList) {
+ TaskDetails taskID = (TaskDetails) o;
+ // iterate through all the generated tasks and performs the
+ // job submisssion+monitoring
+ Experiment experiment = (Experiment) registry.get(
+ RegistryModelType.EXPERIMENT, experimentId);
+ if (experiment == null) {
+ log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}.",
+ experimentId);
+ return false;
+ }
+ return orchestrator.validateExperiment(experiment,
+ workflowNodeDetail, taskID).isSetValidationState();
+ }
+ }
+
+ } catch (OrchestratorException e) {
+ log.errorId(experimentId, "Error while validating experiment", e);
+ throw new TException(e);
+ } catch (RegistryException e) {
+ log.errorId(experimentId, "Error while validating experiment", e);
+ throw new TException(e);
+ }
+ return false;
+ }
+
+ /**
+ * This can be used to cancel a running experiment and store the status to
+ * terminated in registry
+ *
+ * @param experimentId
+ * @return
+ * @throws TException
+ */
+ public boolean terminateExperiment(String experimentId, String tokenId) throws TException {
+ log.infoId(experimentId, "Experiment: {} is cancelling !!!!!", experimentId);
+ return validateStatesAndCancel(experimentId, tokenId);
+ }
+
+ private String getAiravataUserName() {
+ return airavataUserName;
+ }
+
+ private String getGatewayName() {
+ return gatewayName;
+ }
+
+ public void setAiravataUserName(String airavataUserName) {
+ this.airavataUserName = airavataUserName;
+ }
+
+ public void setGatewayName(String gatewayName) {
+ this.gatewayName = gatewayName;
+ }
+
+ @Override
+ public boolean launchTask(String taskId, String airavataCredStoreToken) throws TException {
+ try {
+ TaskDetails taskData = (TaskDetails) registry.get(
+ RegistryModelType.TASK_DETAIL, taskId);
+ String applicationId = taskData.getApplicationId();
+ if (applicationId == null) {
+ log.errorId(taskId, "Application id shouldn't be null.");
+ throw new OrchestratorException("Error executing the job, application id shouldn't be null.");
+ }
+ ApplicationDeploymentDescription applicationDeploymentDescription = getAppDeployment(taskData, applicationId);
+ taskData.setApplicationDeploymentId(applicationDeploymentDescription.getAppDeploymentId());
+ registry.update(RegistryModelType.TASK_DETAIL, taskData,taskData.getTaskID());
+ List<Object> workflowNodeDetailList = registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL,
+ org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants.TASK_LIST, taskData);
+ if (workflowNodeDetailList != null
+ && workflowNodeDetailList.size() > 0) {
+ List<Object> experimentList = registry.get(RegistryModelType.EXPERIMENT,
+ org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.ExperimentConstants.WORKFLOW_NODE_LIST,
+ (WorkflowNodeDetails) workflowNodeDetailList.get(0));
+ if (experimentList != null && experimentList.size() > 0) {
+ return orchestrator
+ .launchExperiment(
+ (Experiment) experimentList.get(0),
+ (WorkflowNodeDetails) workflowNodeDetailList
+ .get(0), taskData,airavataCredStoreToken);
+ }
+ }
+ } catch (Exception e) {
+ log.errorId(taskId, "Error while launching task ", e);
+ throw new TException(e);
+ }
+ log.infoId(taskId, "No experiment found associated in task {}", taskId);
+ return false;
+ }
+
+ private ApplicationDeploymentDescription getAppDeployment(
+ TaskDetails taskData, String applicationId)
+ throws AppCatalogException, OrchestratorException,
+ ClassNotFoundException, ApplicationSettingsException,
+ InstantiationException, IllegalAccessException {
+ AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
+ String selectedModuleId = getModuleId(appCatalog, applicationId);
+ ApplicationDeploymentDescription applicationDeploymentDescription = getAppDeployment(
+ appCatalog, taskData, selectedModuleId);
+ return applicationDeploymentDescription;
+ }
+
+ private ApplicationDeploymentDescription getAppDeployment(
+ AppCatalog appCatalog, TaskDetails taskData, String selectedModuleId)
+ throws AppCatalogException, ClassNotFoundException,
+ ApplicationSettingsException, InstantiationException,
+ IllegalAccessException {
+ Map<String, String> moduleIdFilter = new HashMap<String, String>();
+ moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, selectedModuleId);
+ if (taskData.getTaskScheduling()!=null && taskData.getTaskScheduling().getResourceHostId() != null) {
+ moduleIdFilter.put(AbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID, taskData.getTaskScheduling().getResourceHostId());
+ }
+ List<ApplicationDeploymentDescription> applicationDeployements = appCatalog.getApplicationDeployment().getApplicationDeployements(moduleIdFilter);
+ Map<ComputeResourceDescription, ApplicationDeploymentDescription> deploymentMap = new HashMap<ComputeResourceDescription, ApplicationDeploymentDescription>();
+ ComputeResource computeResource = appCatalog.getComputeResource();
+ for (ApplicationDeploymentDescription deploymentDescription : applicationDeployements) {
+ deploymentMap.put(computeResource.getComputeResource(deploymentDescription.getComputeHostId()),deploymentDescription);
+ }
+ List<ComputeResourceDescription> computeHostList = Arrays.asList(deploymentMap.keySet().toArray(new ComputeResourceDescription[]{}));
+ Class<? extends HostScheduler> aClass = Class.forName(
+ ServerSettings.getHostScheduler()).asSubclass(
+ HostScheduler.class);
+ HostScheduler hostScheduler = aClass.newInstance();
+ ComputeResourceDescription ComputeResourceDescription = hostScheduler.schedule(computeHostList);
+ ApplicationDeploymentDescription applicationDeploymentDescription = deploymentMap.get(ComputeResourceDescription);
+ return applicationDeploymentDescription;
+ }
+
+ private String getModuleId(AppCatalog appCatalog, String applicationId)
+ throws AppCatalogException, OrchestratorException {
+ ApplicationInterfaceDescription applicationInterface = appCatalog.getApplicationInterface().getApplicationInterface(applicationId);
+ List<String> applicationModules = applicationInterface.getApplicationModules();
+ if (applicationModules.size()==0){
+ throw new OrchestratorException(
+ "No modules defined for application "
+ + applicationId);
+ }
+// AiravataAPI airavataAPI = getAiravataAPI();
+ String selectedModuleId=applicationModules.get(0);
+ return selectedModuleId;
+ }
+
+ private boolean validateStatesAndCancel(String experimentId, String tokenId)throws TException{
+ try {
+ Experiment experiment = (Experiment) registry.get(
+ RegistryModelType.EXPERIMENT, experimentId);
+ log.info("Waiting for zookeeper to connect to the server");
+ synchronized (mutex){
+ mutex.wait(5000);
+ }
+ if (experiment == null) {
+ log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}.", experimentId);
+ throw new OrchestratorException("Error retrieving the Experiment by the given experimentID: " + experimentId);
+ }
+ ExperimentState experimentState = experiment.getExperimentStatus().getExperimentState();
+ if (isCancelValid(experimentState)){
+ ExperimentStatus status = new ExperimentStatus();
+ status.setExperimentState(ExperimentState.CANCELING);
+ status.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ experiment.setExperimentStatus(status);
+ registry.update(RegistryModelType.EXPERIMENT, experiment,
+ experimentId);
+
+ List<String> ids = registry.getIds(
+ RegistryModelType.WORKFLOW_NODE_DETAIL,
+ WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
+ for (String workflowNodeId : ids) {
+ WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
+ .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
+ workflowNodeId);
+ int value = workflowNodeDetail.getWorkflowNodeStatus().getWorkflowNodeState().getValue();
+ if ( value> 1 && value < 7) { // we skip the unknown state
+ log.error(workflowNodeDetail.getNodeName() + " Workflow Node status cannot mark as cancelled, because " +
+ "current status is " + workflowNodeDetail.getWorkflowNodeStatus().getWorkflowNodeState().toString());
+ continue; // this continue is very useful not to process deeper loops if the upper layers have non-cancel states
+ } else {
+ WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
+ workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.CANCELING);
+ workflowNodeStatus.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ workflowNodeDetail.setWorkflowNodeStatus(workflowNodeStatus);
+ registry.update(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeDetail,
+ workflowNodeId);
+ }
+ List<Object> taskDetailList = registry.get(
+ RegistryModelType.TASK_DETAIL,
+ TaskDetailConstants.NODE_ID, workflowNodeId);
+ for (Object o : taskDetailList) {
+ TaskDetails taskDetails = (TaskDetails) o;
+ TaskStatus taskStatus = ((TaskDetails) o).getTaskStatus();
+ if (taskStatus.getExecutionState().getValue() > 7 && taskStatus.getExecutionState().getValue()<12) {
+ log.error(((TaskDetails) o).getTaskID() + " Task status cannot mark as cancelled, because " +
+ "current task state is " + ((TaskDetails) o).getTaskStatus().getExecutionState().toString());
+ continue;// this continue is very useful not to process deeper loops if the upper layers have non-cancel states
+ } else {
+ taskStatus.setExecutionState(TaskState.CANCELING);
+ taskStatus.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ taskDetails.setTaskStatus(taskStatus);
+ registry.update(RegistryModelType.TASK_DETAIL, o,
+ taskDetails.getTaskID());
+ }
+ orchestrator.cancelExperiment(experiment,
+ workflowNodeDetail, taskDetails, tokenId);
+ // Status update should be done at the monitor
+ }
+ }
+ }else {
+ if (isCancelAllowed(experimentState)){
+ // when experiment status is < 3 no jobDetails object is created,
+ // so we don't have to worry, we simply have to change the status and stop the execution
+ ExperimentStatus status = new ExperimentStatus();
+ status.setExperimentState(ExperimentState.CANCELED);
+ status.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ experiment.setExperimentStatus(status);
+ registry.update(RegistryModelType.EXPERIMENT, experiment,
+ experimentId);
+ List<String> ids = registry.getIds(
+ RegistryModelType.WORKFLOW_NODE_DETAIL,
+ WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
+ for (String workflowNodeId : ids) {
+ WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry
+ .get(RegistryModelType.WORKFLOW_NODE_DETAIL,
+ workflowNodeId);
+ WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
+ workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.CANCELED);
+ workflowNodeStatus.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ workflowNodeDetail.setWorkflowNodeStatus(workflowNodeStatus);
+ registry.update(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeDetail,
+ workflowNodeId);
+ List<Object> taskDetailList = registry.get(
+ RegistryModelType.TASK_DETAIL,
+ TaskDetailConstants.NODE_ID, workflowNodeId);
+ for (Object o : taskDetailList) {
+ TaskDetails taskDetails = (TaskDetails) o;
+ TaskStatus taskStatus = ((TaskDetails) o).getTaskStatus();
+ taskStatus.setExecutionState(TaskState.CANCELED);
+ taskStatus.setTimeOfStateChange(Calendar.getInstance()
+ .getTimeInMillis());
+ taskDetails.setTaskStatus(taskStatus);
+ registry.update(RegistryModelType.TASK_DETAIL, o,
+ taskDetails);
+ }
+ }
+ }else {
+ log.errorId(experimentId, "Unable to mark experiment as Cancelled, current state {} doesn't allow to cancel the experiment {}.",
+ experiment.getExperimentStatus().getExperimentState().toString(), experimentId);
+ throw new OrchestratorException("Unable to mark experiment as Cancelled, because current state is: "
+ + experiment.getExperimentStatus().getExperimentState().toString());
+ }
+ }
+ log.info("Experiment: " + experimentId + " is cancelled !!!!!");
+ } catch (Exception e) {
+ throw new TException(e);
+ }
+ return true;
+ }
+
+ private boolean isCancelValid(ExperimentState state){
+ switch (state) {
+ case LAUNCHED:
+ case EXECUTING:
+ case CANCELING:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ private boolean isCancelAllowed(ExperimentState state){
+ switch (state) {
+ case CREATED:
+ case VALIDATED:
+ case SCHEDULED:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ private void launchWorkflowExperiment(String experimentId, String airavataCredStoreToken) throws TException {
+ try {
+ WorkflowEnactmentService.getInstance().
+ submitWorkflow(experimentId, airavataCredStoreToken, getGatewayName(), getRabbitMQProcessPublisher());
+ } catch (Exception e) {
+ log.error("Error while launching workflow", e);
+ }
+ }
+
+ public synchronized RabbitMQProcessPublisher getRabbitMQProcessPublisher() throws Exception {
+ if (rabbitMQProcessPublisher == null) {
+ rabbitMQProcessPublisher = new RabbitMQProcessPublisher();
+ }
+ return rabbitMQProcessPublisher;
+ }
+
+
+ private class SingleAppExperimentRunner implements Runnable {
+
+ String experimentId;
+ String airavataCredStoreToken;
+ public SingleAppExperimentRunner(String experimentId,String airavataCredStoreToken){
+ this.experimentId = experimentId;
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+ @Override
+ public void run() {
+ try {
+ launchSingleAppExperiment();
+ } catch (TException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private boolean launchSingleAppExperiment() throws TException {
+ Experiment experiment = null;
+ try {
+ List<String> ids = registry.getIds(RegistryModelType.WORKFLOW_NODE_DETAIL, WorkflowNodeConstants.EXPERIMENT_ID, experimentId);
+ for (String workflowNodeId : ids) {
+// WorkflowNodeDetails workflowNodeDetail = (WorkflowNodeDetails) registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeId);
+ List<Object> taskDetailList = registry.get(RegistryModelType.TASK_DETAIL, TaskDetailConstants.NODE_ID, workflowNodeId);
+ for (Object o : taskDetailList) {
+ TaskDetails taskData = (TaskDetails) o;
+ //iterate through all the generated tasks and performs the job submisssion+monitoring
+ experiment = (Experiment) registry.get(RegistryModelType.EXPERIMENT, experimentId);
+ if (experiment == null) {
+ log.errorId(experimentId, "Error retrieving the Experiment by the given experimentID: {}", experimentId);
+ return false;
+ }
+ String gatewayId = null;
+ CredentialReader credentialReader = GFacUtils.getCredentialReader();
+ if (credentialReader != null) {
+ try {
+ gatewayId = credentialReader.getGatewayID(airavataCredStoreToken);
+ } catch (Exception e) {
+ log.error(e.getLocalizedMessage());
+ }
+ }
+ if (gatewayId == null || gatewayId.isEmpty()) {
+ gatewayId = ServerSettings.getDefaultUserGateway();
+ }
+ ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.LAUNCHED,
+ experimentId,
+ gatewayId);
+ String messageId = AiravataUtils.getId("EXPERIMENT");
+ MessageContext messageContext = new MessageContext(event, MessageType.EXPERIMENT, messageId, gatewayId);
+ messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+ publisher.publish(messageContext);
+ registry.update(RegistryModelType.TASK_DETAIL, taskData, taskData.getTaskID());
+ //launching the experiment
+ launchTask(taskData.getTaskID(), airavataCredStoreToken);
+ }
+ }
+
+ } catch (Exception e) {
+ // Here we really do not have to do much because only potential failure can happen
+ // is in gfac, if there are errors in gfac, it will handle the experiment/task/job statuses
+ // We might get failures in registry access before submitting the jobs to gfac, in that case we
+ // leave the status of these as created.
+ ExperimentStatus status = new ExperimentStatus();
+ status.setExperimentState(ExperimentState.FAILED);
+ status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
+ experiment.setExperimentStatus(status);
+ try {
+ registry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
+ } catch (RegistryException e1) {
+ log.errorId(experimentId, "Error while updating experiment status to " + status.toString(), e);
+ throw new TException(e);
+ }
+ log.errorId(experimentId, "Error while updating task status, hence updated experiment status to " + status.toString(), e);
+ throw new TException(e);
+ }
+ return true;
+ }
+ }
+
+ private class ProcessConsumer implements Runnable, MessageHandler{
+
+
+ @Override
+ public void run() {
+ try {
+ rabbitMQProcessConsumer.listen(this);
+ } catch (AiravataException e) {
+ log.error("Error while listen to the RabbitMQProcessConsumer");
+ }
+ }
+
+ @Override
+ public Map<String, Object> getProperties() {
+ Map<String, Object> props = new HashMap<String, Object>();
+ props.put(MessagingConstants.RABBIT_QUEUE, RabbitMQProcessPublisher.PROCESS);
+ props.put(MessagingConstants.RABBIT_ROUTING_KEY, RabbitMQProcessPublisher.PROCESS);
+ return props;
+ }
+
+ @Override
+ public void onMessage(MessageContext msgCtx) {
+ TBase event = msgCtx.getEvent();
+ if (event instanceof ProcessSubmitEvent) {
+ ProcessSubmitEvent processSubmitEvent = (ProcessSubmitEvent) event;
+ try {
+ launchTask(processSubmitEvent.getTaskId(), processSubmitEvent.getCredentialToken());
+ } catch (TException e) {
+ log.error("Error while launching task : " + processSubmitEvent.getTaskId());
+ }
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
new file mode 100644
index 0000000..f9833e9
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/Constants.java
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.util;
+
+public class Constants {
+ public static final String ORCHESTRATOT_SERVER_PORT = "orchestrator.server.port";
+ public static final String ORCHESTRATOT_SERVER_HOST = "orchestrator.server.host";
+ public static final String ORCHESTRATOT_SERVER_MIN_THREADS = "orchestrator.server.min.threads";
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
new file mode 100644
index 0000000..da11a59
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/DataModelUtils.java
@@ -0,0 +1,55 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.util;
+
+import java.util.List;
+
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.airavata.appcatalog.cpi.ApplicationInterface;
+import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
+import org.apache.airavata.model.util.ExecutionType;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataModelUtils {
+
+ private final static Logger logger = LoggerFactory.getLogger(DataModelUtils.class);
+ public static ExecutionType getExecutionType(String gatewayId, Experiment experiment){
+ try {
+ ApplicationInterface applicationInterface = AppCatalogFactory.getAppCatalog().getApplicationInterface();
+ List<String> allApplicationInterfaceIds = applicationInterface.getAllApplicationInterfaceIds();
+ String applicationId = experiment.getApplicationId();
+ if (allApplicationInterfaceIds.contains(applicationId)){
+ return ExecutionType.SINGLE_APP;
+ } else {
+ List<String> allWorkflows = AppCatalogFactory.getAppCatalog().getWorkflowCatalog().getAllWorkflows(gatewayId);
+ if (allWorkflows.contains(applicationId)){
+ return ExecutionType.WORKFLOW;
+ }
+ }
+ } catch (AppCatalogException e) {
+ logger.error(e.getMessage(), e);
+ }
+ return ExecutionType.UNKNOWN;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
new file mode 100644
index 0000000..1730998
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorServerThreadPoolExecutor.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.util;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.logger.AiravataLogger;
+import org.apache.airavata.common.logger.AiravataLoggerFactory;
+import org.apache.airavata.common.utils.ServerSettings;
+
+public class OrchestratorServerThreadPoolExecutor {
+ private final static AiravataLogger logger = AiravataLoggerFactory.getLogger(OrchestratorServerThreadPoolExecutor.class);
+ public static final String AIRAVATA_SERVER_THREAD_POOL_SIZE = "airavata.server.thread.pool.size";
+
+ private static ExecutorService threadPool;
+
+ public static ExecutorService getCachedThreadPool() {
+ if(threadPool ==null){
+ threadPool = Executors.newCachedThreadPool();
+ }
+ return threadPool;
+ }
+
+ public static ExecutorService getFixedThreadPool() {
+ if(threadPool ==null){
+ try {
+ threadPool = Executors.newFixedThreadPool(Integer.parseInt(ServerSettings.getSetting(AIRAVATA_SERVER_THREAD_POOL_SIZE)));
+ } catch (ApplicationSettingsException e) {
+ logger.error("Error reading " + AIRAVATA_SERVER_THREAD_POOL_SIZE+ " property");
+ }
+ }
+ return threadPool;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/main/resources/gsissh.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/resources/gsissh.properties b/modules/orchestrator/orchestrator-service/src/main/resources/gsissh.properties
new file mode 100644
index 0000000..3fdf76d
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/resources/gsissh.properties
@@ -0,0 +1,26 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+# Specifies system level configurations as a key/value pairs.
+###########################################################################
+
+StrictHostKeyChecking=no
+ssh.session.timeout=360000
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java b/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
new file mode 100644
index 0000000..18168c7
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactoryTest.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+package org.apache.airavata.orchestrator.client;
+
+//import org.apache.airavata.client.AiravataAPIFactory;
+//import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+//import org.apache.airavata.client.tools.DocumentCreator;
+//import org.apache.airavata.client.tools.DocumentCreatorNew;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.AiravataZKUtils;
+import org.apache.airavata.common.utils.Constants;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.model.error.AiravataClientConnectException;
+import org.apache.airavata.orchestrator.client.util.Initialize;
+import org.apache.airavata.orchestrator.cpi.OrchestratorService;
+import org.apache.airavata.orchestrator.server.OrchestratorServer;
+import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
+import org.apache.airavata.registry.cpi.Registry;
+import org.apache.zookeeper.server.ServerCnxnFactory;
+import org.junit.Test;
+
+public class OrchestratorClientFactoryTest {
+/* private DocumentCreatorNew documentCreator;
+ private OrchestratorService.Client orchestratorClient;
+ private Registry registry;
+ private int NUM_CONCURRENT_REQUESTS = 1;
+ Initialize initialize;
+ OrchestratorServer service;
+ private static ServerCnxnFactory cnxnFactory;
+
+ @Test
+ public void setUp() {
+ AiravataUtils.setExecutionAsServer();
+ initialize = new Initialize("registry-derby.sql");
+ initialize.initializeDB();
+ System.setProperty(Constants.ZOOKEEPER_SERVER_PORT,"2185");
+ AiravataZKUtils.startEmbeddedZK(cnxnFactory);
+
+ try {
+ service = (new OrchestratorServer());
+ service.start();
+ registry = RegistryFactory.getDefaultRegistry();
+ documentCreator = new DocumentCreatorNew(getAiravataClient());
+ documentCreator.createLocalHostDocs();
+ } catch (Exception e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ AiravataUtils.setExecutionAsServer();
+ try {
+ service.stop();
+ } catch (Exception e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ }
+
+ private Airavata.Client getAiravataClient() {
+ Airavata.Client client = null;
+ try {
+ client = AiravataClientFactory.createAiravataClient("localhost", 8930);
+ } catch (AiravataClientConnectException e) {
+ e.printStackTrace();
+ }
+ return client;
+ }
+
+ private void storeDescriptors() {
+
+ }*/
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java b/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
new file mode 100644
index 0000000..c827fc4
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/java/org/apache/airavata/orchestrator/client/util/Initialize.java
@@ -0,0 +1,330 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.orchestrator.client.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+public class Initialize {
+ private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
+ public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+ public String scriptName = "registry-derby.sql";
+ private NetworkServerControl server;
+ private static final String delimiter = ";";
+ public static final String PERSISTANT_DATA = "Configuration";
+
+ public Initialize(String scriptName) {
+ this.scriptName = scriptName;
+ }
+
+ public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+ if (suffix.length() > buffer.length()) {
+ return false;
+ }
+ // this loop is done on purpose to avoid memory allocation performance
+ // problems on various JDKs
+ // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+ // implementation is ok though does allocation/copying
+ // StringBuffer.toString().endsWith() does massive memory
+ // allocation/copying on JDK 1.5
+ // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+ int endIndex = suffix.length() - 1;
+ int bufferIndex = buffer.length() - 1;
+ while (endIndex >= 0) {
+ if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+ return false;
+ }
+ bufferIndex--;
+ endIndex--;
+ }
+ return true;
+ }
+
+ private static boolean isServerStarted(NetworkServerControl server, int ntries)
+ {
+ for (int i = 1; i <= ntries; i ++)
+ {
+ try {
+ Thread.sleep(500);
+ server.ping();
+ return true;
+ }
+ catch (Exception e) {
+ if (i == ntries)
+ return false;
+ }
+ }
+ return false;
+ }
+
+ public void initializeDB() throws SQLException{
+ String jdbcUrl = null;
+ String jdbcUser = null;
+ String jdbcPassword = null;
+ try{
+ jdbcUrl = ServerSettings.getSetting("registry.jdbc.url");
+ jdbcUser = ServerSettings.getSetting("registry.jdbc.user");
+ jdbcPassword = ServerSettings.getSetting("registry.jdbc.password");
+ jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+ } catch (ApplicationSettingsException e) {
+ logger.error("Unable to read properties", e);
+ }
+ startDerbyInServerMode();
+ if(!isServerStarted(server, 20)){
+ throw new RuntimeException("Derby server cound not started within five seconds...");
+ }
+
+ Connection conn = null;
+ try {
+ Class.forName(Utils.getJDBCDriver()).newInstance();
+ conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
+ if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
+ executeSQLScript(conn);
+ logger.info("New Database created for Registry");
+ } else {
+ logger.debug("Database already created for Registry!");
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ throw new RuntimeException("Database failure", e);
+ } finally {
+ try {
+ if (conn != null){
+ if (!conn.getAutoCommit()) {
+ conn.commit();
+ }
+ conn.close();
+ }
+ } catch (SQLException e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ try{
+ GatewayResource gatewayResource = new GatewayResource();
+ gatewayResource.setGatewayId(ServerSettings.getSetting("default.registry.gateway"));
+ gatewayResource.setGatewayName(ServerSettings.getSetting("default.registry.gateway"));
+ gatewayResource.setDomain("test-domain");
+ gatewayResource.setEmailAddress("test-email");
+ gatewayResource.save();
+
+ UserResource userResource = new UserResource();
+ userResource.setUserName(ServerSettings.getSetting("default.registry.user"));
+ userResource.setPassword(ServerSettings.getSetting("default.registry.password"));
+ userResource.save();
+
+ WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
+ workerResource.setUser(userResource.getUserName());
+ workerResource.save();
+
+ ProjectResource projectResource = (ProjectResource)workerResource.create(ResourceType.PROJECT);
+ projectResource.setGatewayId(gatewayResource.getGatewayId());
+ projectResource.setId("default");
+ projectResource.setName("default");
+ projectResource.setWorker(workerResource);
+ projectResource.save();
+
+
+ } catch (ApplicationSettingsException e) {
+ logger.error("Unable to read properties", e);
+ throw new SQLException(e.getMessage(), e);
+ } catch (RegistryException e) {
+ logger.error("Unable to save data to registry", e);
+ throw new SQLException(e.getMessage(), e);
+ }
+ }
+
+ public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+ try {
+ System.out.println("Running a query to test the database tables existence.");
+ // check whether the tables are already created with a query
+ Statement statement = null;
+ try {
+ statement = conn.createStatement();
+ ResultSet rs = statement.executeQuery("select * from " + tableName);
+ if (rs != null) {
+ rs.close();
+ }
+ } finally {
+ try {
+ if (statement != null) {
+ statement.close();
+ }
+ } catch (SQLException e) {
+ return false;
+ }
+ }
+ } catch (SQLException e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private void executeSQLScript(Connection conn) throws Exception {
+ StringBuffer sql = new StringBuffer();
+ BufferedReader reader = null;
+ try{
+
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName);
+ reader = new BufferedReader(new InputStreamReader(inputStream));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith("//")) {
+ continue;
+ }
+ if (line.startsWith("--")) {
+ continue;
+ }
+ StringTokenizer st = new StringTokenizer(line);
+ if (st.hasMoreTokens()) {
+ String token = st.nextToken();
+ if ("REM".equalsIgnoreCase(token)) {
+ continue;
+ }
+ }
+ sql.append(" ").append(line);
+
+ // SQL defines "--" as a comment to EOL
+ // and in Oracle it may contain a hint
+ // so we cannot just remove it, instead we must end it
+ if (line.indexOf("--") >= 0) {
+ sql.append("\n");
+ }
+ if ((checkStringBufferEndsWith(sql, delimiter))) {
+ executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+ sql.replace(0, sql.length(), "");
+ }
+ }
+ // Catch any statements not followed by ;
+ if (sql.length() > 0) {
+ executeSQL(sql.toString(), conn);
+ }
+ }catch (IOException e){
+ logger.error("Error occurred while executing SQL script for creating Airavata database", e);
+ throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
+ }finally {
+ if (reader != null) {
+ reader.close();
+ }
+
+ }
+
+ }
+
+ private static void executeSQL(String sql, Connection conn) throws Exception {
+ // Check and ignore empty statements
+ if ("".equals(sql.trim())) {
+ return;
+ }
+
+ Statement statement = null;
+ try {
+ logger.debug("SQL : " + sql);
+
+ boolean ret;
+ int updateCount = 0, updateCountTotal = 0;
+ statement = conn.createStatement();
+ ret = statement.execute(sql);
+ updateCount = statement.getUpdateCount();
+ do {
+ if (!ret) {
+ if (updateCount != -1) {
+ updateCountTotal += updateCount;
+ }
+ }
+ ret = statement.getMoreResults();
+ if (ret) {
+ updateCount = statement.getUpdateCount();
+ }
+ } while (ret);
+
+ logger.debug(sql + " : " + updateCountTotal + " rows affected");
+
+ SQLWarning warning = conn.getWarnings();
+ while (warning != null) {
+ logger.warn(warning + " sql warning");
+ warning = warning.getNextWarning();
+ }
+ conn.clearWarnings();
+ } catch (SQLException e) {
+ if (e.getSQLState().equals("X0Y32")) {
+ // eliminating the table already exception for the derby
+ // database
+ logger.info("Table Already Exists", e);
+ } else {
+ throw new Exception("Error occurred while executing : " + sql, e);
+ }
+ } finally {
+ if (statement != null) {
+ try {
+ statement.close();
+ } catch (SQLException e) {
+ logger.error("Error occurred while closing result set.", e);
+ }
+ }
+ }
+ }
+
+ private void startDerbyInServerMode() {
+ try {
+ System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+ server = new NetworkServerControl(InetAddress.getByName(Utils.getHost()),
+ 20000,
+ Utils.getJDBCUser(), Utils.getJDBCPassword());
+ java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+ server.start(consoleWriter);
+ } catch (IOException e) {
+ logger.error("Unable to start Apache derby in the server mode! Check whether " +
+ "specified port is available");
+ } catch (Exception e) {
+ logger.error("Unable to start Apache derby in the server mode! Check whether " +
+ "specified port is available");
+ }
+
+ }
+
+ public void stopDerbyServer() throws SQLException{
+ try {
+ server.shutdown();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ throw new SQLException("Error while stopping derby server", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/resources/gsissh.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/resources/gsissh.properties b/modules/orchestrator/orchestrator-service/src/test/resources/gsissh.properties
new file mode 100644
index 0000000..3fdf76d
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/resources/gsissh.properties
@@ -0,0 +1,26 @@
+#
+#
+# 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.
+#
+
+###########################################################################
+# Specifies system level configurations as a key/value pairs.
+###########################################################################
+
+StrictHostKeyChecking=no
+ssh.session.timeout=360000
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/resources/monitor.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/resources/monitor.properties b/modules/orchestrator/orchestrator-service/src/test/resources/monitor.properties
new file mode 100644
index 0000000..7f0299a
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/resources/monitor.properties
@@ -0,0 +1,30 @@
+#
+#
+# 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.
+#
+
+primaryMonitor=org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor
+secondaryMonitor=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor
+amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
+connection.name=xsede_private
+trusted.certificate.location=/Users/chathuri/dev/airavata/cert/certificates
+certificate.path=/Users/chathuri/dev/airavata/cert/certificates
+myproxy.server=myproxy.teragrid.org
+myproxy.user=ogce
+myproxy.password=
+myproxy.life=3600
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/82773c73/modules/orchestrator/orchestrator-service/src/test/resources/orchestrator.properties
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/test/resources/orchestrator.properties b/modules/orchestrator/orchestrator-service/src/test/resources/orchestrator.properties
new file mode 100644
index 0000000..e84c429
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/test/resources/orchestrator.properties
@@ -0,0 +1,26 @@
+#
+#
+# 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.
+#
+job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
+job.validators=org.apache.airavata.orchestrator.core.validator.impl.BatchQueueValidator
+submitter.interval=10000
+threadpool.size=0
+start.submitter=true
+embedded.mode=true
+enable.validation=false