You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2015/03/17 02:44:17 UTC
[1/3] airavata-sandbox git commit: mock api to test multi-plexing -
AIRAVATA-1629
Repository: airavata-sandbox
Updated Branches:
refs/heads/master ec6ba29a8 -> 62ad0a537
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-server/pom.xml b/airavata-mock-multiplexed-api/mock-airavata-api-server/pom.xml
new file mode 100644
index 0000000..b547989
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-server/pom.xml
@@ -0,0 +1,46 @@
+<?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>mock-airavata-api</artifactId>
+ <groupId>org.apache.airavata</groupId>
+ <version>0.15-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <name>Airavata API Server</name>
+ <artifactId>mock-airavata-api-server</artifactId>
+ <packaging>jar</packaging>
+ <url>http://airavata.apache.org/</url>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>mock-airavata-api-stubs</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>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/MockAiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/MockAiravataAPIServer.java b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/MockAiravataAPIServer.java
new file mode 100644
index 0000000..4d465f7
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/MockAiravataAPIServer.java
@@ -0,0 +1,328 @@
+/*
+ *
+ * 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.api.server;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.Random;
+
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.server.handler.AiravataServerHandler;
+import org.apache.airavata.api.server.util.AppCatalogInitUtil;
+import org.apache.airavata.api.server.util.Constants;
+import org.apache.airavata.api.server.util.RegistryInitUtil;
+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.IServer;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.model.error.AiravataErrorType;
+import org.apache.airavata.model.error.AiravataSystemException;
+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.apache.zookeeper.*;
+import org.apache.zookeeper.data.Stat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AiravataAPIServer implements IServer, Watcher{
+
+ private final static Logger logger = LoggerFactory.getLogger(AiravataAPIServer.class);
+ private static final String SERVER_NAME = "Airavata API Server";
+ private static final String SERVER_VERSION = "1.0";
+ private ZooKeeper zk;
+ private static Integer mutex = -1;
+
+ private ServerStatus status;
+
+ private TServer server;
+
+ public AiravataAPIServer() {
+ setStatus(ServerStatus.STOPPED);
+ }
+
+ public void startAiravataServer(Airavata.Processor<Airavata.Iface> airavataAPIServer) throws AiravataSystemException {
+ try {
+ AiravataUtils.setExecutionAsServer();
+ RegistryInitUtil.initializeDB();
+ AppCatalogInitUtil.initializeDB();
+ final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.API_SERVER_PORT,"8930"));
+ final String serverHost = ServerSettings.getSetting(Constants.API_SERVER_HOST, null);
+
+ TServerTransport serverTransport;
+
+ if(serverHost == null){
+ serverTransport = new TServerSocket(serverPort);
+ }else{
+ InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
+ serverTransport = new TServerSocket(inetSocketAddress);
+ }
+
+ TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
+ options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.API_SERVER_MIN_THREADS, "50"));
+ server = new TThreadPoolServer(options.processor(airavataAPIServer));
+ new Thread() {
+ public void run() {
+ server.serve();
+ RegistryInitUtil.stopDerbyInServerMode();
+ setStatus(ServerStatus.STOPPED);
+ logger.info("Airavata API 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 Airavata API Server on Port " + serverPort);
+ logger.info("Listening to Airavata Clients ....");
+ }
+ }
+ }.start();
+ storeServerConfig();
+ } catch (TTransportException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ }
+ }
+
+ public void storeServerConfig() throws AiravataSystemException{
+ try {
+ String zkhostPort = AiravataZKUtils.getZKhostPort();
+ String airavataServerHostPort = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_HOST)
+ + ":" + ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_PORT);
+ String experimentCatalogJDBCURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.REGISTRY_JDBC_URL);
+ String appCatalogJDBCURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.APPCATALOG_JDBC_URL);
+ String rabbitMqBrokerURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.RABBITMQ_BROKER_URL);
+ String rabbitMqExchange = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.RABBITMQ_EXCHANGE);
+ String rabbitMq = rabbitMqBrokerURL + File.separator + rabbitMqExchange;
+ zk = new ZooKeeper(zkhostPort, 6000, this); // no watcher is required, this will only use to store some data
+ String apiServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_API_SERVER_NODE, "/airavata-server");
+ String OrchServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_ORCHESTRATOR_SERVER_NODE, "/orchestrator-server");
+ String gfacServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_SERVER_NODE, "/gfac-server");
+ String gfacExperiments = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_EXPERIMENT_NODE, "/gfac-experiments");
+ String experimentCatalog = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_EXPERIMENT_CATALOG, "/experiment-catalog");
+ String appCatalog = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_APPCATALOG, "/app-catalog");
+ String rabbitMQ = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_RABBITMQ, "/rabbitMq");
+ Stat zkStat = zk.exists(experimentCatalog, false);
+ if (zkStat == null) {
+ zk.create(experimentCatalog, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ }
+ String exCatalogInstantNode = experimentCatalog + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
+ zkStat = zk.exists(exCatalogInstantNode, false);
+ if (zkStat == null) {
+ zk.create(exCatalogInstantNode,
+ experimentCatalogJDBCURL.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.EPHEMERAL); // other component will watch these childeren creation deletion to monitor the status of the node
+ logger.info("Successfully created experiment-catalog node");
+ }
+ zkStat = zk.exists(appCatalog, false);
+ if (zkStat == null) {
+ zk.create(appCatalog, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ }
+ String appCatalogInstantNode = appCatalog + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
+ zkStat = zk.exists(appCatalogInstantNode, false);
+ if (zkStat == null) {
+ zk.create(appCatalogInstantNode,
+ appCatalogJDBCURL.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.EPHEMERAL); // other component will watch these childeren creation deletion to monitor the status of the node
+ logger.info("Successfully created app-catalog node");
+ }
+ if (getStatus().equals(ServerStatus.STARTED)) {
+ zkStat = zk.exists(apiServer, false);
+ if (zkStat == null) {
+ zk.create(apiServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ }
+ String instantNode = apiServer + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
+ zkStat = zk.exists(instantNode, false);
+ if (zkStat == null) {
+ zk.create(instantNode,
+ airavataServerHostPort.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.EPHEMERAL); // other component will watch these childeren creation deletion to monitor the status of the node
+ logger.info("Successfully created airavata-server node");
+ }
+
+ zkStat = zk.exists(OrchServer, false);
+ if (zkStat == null) {
+ zk.create(OrchServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ logger.info("Successfully created orchestrator-server node");
+ }
+ zkStat = zk.exists(gfacServer, false);
+ if (zkStat == null) {
+ zk.create(gfacServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ logger.info("Successfully created gfac-server node");
+ }
+ zkStat = zk.exists(gfacServer, false);
+ if (zkStat == null) {
+ zk.create(gfacExperiments, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ logger.info("Successfully created gfac-server node");
+ }
+ zkStat = zk.exists(rabbitMQ, false);
+ if (zkStat == null) {
+ zk.create(rabbitMQ, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ }
+ if (ServerSettings.isRabbitMqPublishEnabled()) {
+ String rabbitMqInstantNode = rabbitMQ + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
+ zkStat = zk.exists(rabbitMqInstantNode, false);
+ if (zkStat == null) {
+ zk.create(rabbitMqInstantNode,
+ rabbitMq.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
+ CreateMode.EPHEMERAL); // other component will watch these childeren creation deletion to monitor the status of the node
+ logger.info("Successfully created rabbitMQ node");
+ }
+ }
+ logger.info("Finished starting ZK: " + zk);
+ }
+ } catch (ApplicationSettingsException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ } catch (IOException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ } catch (InterruptedException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ } catch (KeeperException e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ setStatus(ServerStatus.FAILED);
+ RegistryInitUtil.stopDerbyInServerMode();
+ throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+ }
+ }
+
+ public static void main(String[] args) {
+ try {
+ AiravataAPIServer server = new AiravataAPIServer();
+ server.start();
+ } catch (Exception e) {
+ logger.error("Error while initializing Airavata API server", e);
+ }
+ }
+
+ @Override
+ public void start() throws Exception {
+ setStatus(ServerStatus.STARTING);
+ Airavata.Processor<Airavata.Iface> airavataAPIServer =
+ new Airavata.Processor<Airavata.Iface>(new AiravataServerHandler());
+ startAiravataServer(airavataAPIServer);
+ }
+
+ @Override
+ public void stop() throws Exception {
+ if (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;
+ }
+
+ @Override
+ synchronized public void process(WatchedEvent watchedEvent) {
+ synchronized (mutex) {
+ Event.KeeperState state = watchedEvent.getState();
+ logger.info(state.name());
+ switch(state){
+ case SyncConnected:
+ mutex.notify();
+ case Expired:case Disconnected:
+ try {
+ mutex = -1;
+ zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
+ synchronized (mutex) {
+ mutex.wait(); // waiting for the syncConnected event
+ }
+ storeServerConfig();
+ } catch (IOException e) {
+ logger.error("Error while synchronizing with zookeeper", e);
+ } catch (ApplicationSettingsException e) {
+ logger.error("Error while synchronizing with zookeeper", e);
+ } catch (InterruptedException e) {
+ logger.error("Error while synchronizing with zookeeper", e);
+ } catch (AiravataSystemException e) {
+ logger.error("Error while synchronizing with zookeeper", e);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/generate-thrift-stubs.sh
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/generate-thrift-stubs.sh b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/generate-thrift-stubs.sh
new file mode 100755
index 0000000..3744494
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/generate-thrift-stubs.sh
@@ -0,0 +1,269 @@
+#! /usr/bin/env bash
+
+# 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.
+
+# This script will regenerate the thrift code for Airavata Server Skeletons, Client Stubs and Data Model java beans.
+
+show_usage() {
+ echo -e "Usage: $0 [Languague to generate stubs]"
+ echo ""
+ echo "options:"
+ echo -e "\tjava Generate/Update Java Stubs"
+ echo -e "\tphp Generate/Update PHP Stubs"
+ echo -e "\tcpp Generate/Update C++ Stubs"
+ echo -e "\tpython Generate/Update Python Stubs."
+ echo -e "\tall Generate/Update all stubs (Java, PHP, C++, Python)."
+ echo -e "\t-h[elp] Print the usage options of this script"
+}
+
+if [ $# -lt 1 ]
+then
+ show_usage
+ exit 1
+fi
+
+if [[ $1 == "-h" ||$1 == "--help" ]]
+then
+ show_usage
+ exit 0
+fi
+
+# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
+# Verify is thrift is installed, is in the path is at a specified version.
+
+REQUIRED_THRIFT_VERSION='0.9.2'
+
+VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l)
+if [ "$VERSION" -ne 1 ] ; then
+ echo -e "ERROR:\t Apache Thrift version ${REQUIRED_THRIFT_VERSION} is required."
+ echo -e "It is either not installed or is not in the path"
+ exit 1
+fi
+
+# Global Constants used across the script
+BASE_TARGET_DIR='target'
+DATAMODEL_SRC_DIR='airavata-data-models/src/main/java'
+JAVA_API_SDK_DIR='../mock-airavata-api-java-stubs/src/main/java'
+CPP_SDK_DIR='airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/'
+PHP_SDK_DIR='airavata-client-sdks/airavata-php-sdk/src/main/resources/lib'
+
+# Initialize the thrift arguments.
+# Since most of the Airavata API and Data Models have includes, use recursive option by default.
+# Generate all the files in target directory
+THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+# Ensure the required target directories exists, if not create.
+mkdir -p ${BASE_TARGET_DIR}
+
+# The Function fail prints error messages on failure and quits the script.
+fail() {
+ echo $@
+ exit 1
+}
+
+# The function add_license_header adds the ASF V2 license header to all java files within the specified generated
+# directory. The function also adds suppress all warnings annotation to all public classes and enum's
+# To Call:
+# add_license_header $generated_code_directory
+add_license_header() {
+
+ # Fetch the generated code directory passed as the argument
+ GENERATED_CODE_DIR=$1
+
+ # For all generated thrift code, add the suppress all warnings annotation
+ # NOTE: In order to save the original file as a backup, use sed -i.orig in place of sed -i ''
+ find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /'
+ find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /'
+
+ # For each source file within the generated directory, add the ASF V2 LICENSE header
+ FILE_SUFFIXES=(.php .java .h .cpp)
+ for file in "${FILE_SUFFIXES[@]}"; do
+ for f in $(find ${GENERATED_CODE_DIR} -name "*$file"); do
+ cat - ${f} >${f}-with-license <<EOF
+/**
+ * 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.
+ */
+
+EOF
+ mv ${f}-with-license ${f}
+ done
+ done
+}
+
+# The function compares every generated java file with the one in specified existing source location. If the comparison
+# shows a difference, then it replaces with the newly generated file (with added license header).
+# To Call:
+# copy_changed_files $generated_code_directory $existing_source_directory
+copy_changed_files() {
+
+ # Read all the function arguments
+ GENERATED_CODE_DIR=$1
+ WORKSPACE_SRC_DIR=$2
+
+ echo "Generated sources are in ${GENERATED_CODE_DIR}"
+ echo "Destination workspace is in ${WORKSPACE_SRC_DIR}"
+
+ # Check if the newly generated files exist in the targeted workspace, if not copy. Only changed files will be synced.
+ # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied.
+ rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR}
+}
+
+#######################################
+# Generate/Update Java Stubs #
+#######################################
+
+generate_java_stubs() {
+
+ #Java Beans generation directory
+ #JAVA_BEAN_GEN_DIR=${BASE_TARGET_DIR}/gen-javabean
+
+ # As a precaution remove and previously generated files if exists
+ #rm -rf ${JAVA_BEAN_GEN_DIR}
+
+ # Generate the Airavata Data Model using thrift Java Beans generator. This will take generate the classes in bean style
+ # with members being private and setters returning voids.
+ # The airavataDataModel.thrift includes rest of data models.
+ #thrift ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/airavataDataModel.thrift || fail unable to generate java bean thrift classes on base data model
+
+ #thrift ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/appCatalogModels.thrift || fail unable to generate java bean thrift classes on app catalog data models
+
+ #thrift ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/workflowDataModel.thrift || fail unable to generate java bean thrift classes on app workflow data models
+
+ # For the generated java beans add the ASF V2 License header
+ #add_license_header $JAVA_BEAN_GEN_DIR
+
+ # Compare the newly generated beans with existing sources and replace the changed ones.
+ #copy_changed_files ${JAVA_BEAN_GEN_DIR} ${DATAMODEL_SRC_DIR}
+
+ ###############################################################################
+ # Generate/Update source used by Airavata Server Skeletons & Java Client Stubs #
+ # JAVA server and client both use generated api-boilerplate-code #
+ ###############################################################################
+
+ #Java generation directory
+ JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
+
+ # As a precaution remove and previously generated files if exists
+ rm -rf ${JAVA_GEN_DIR}
+
+ # Using thrift Java generator, generate the java classes based on Airavata API. This
+ # The airavataAPI.thrift includes rest of data models.
+ thrift ${THRIFT_ARGS} --gen java mock-credential-management-api.thrift || fail unable to generate java thrift classes on AiravataAPI
+
+ #thrift ${THRIFT_ARGS} --gen java ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate java thrift classes on WorkflowAPI
+
+ # For the generated java classes add the ASF V2 License header
+ add_license_header $JAVA_GEN_DIR
+
+ # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
+ # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models.
+ copy_changed_files ${JAVA_GEN_DIR}/org/apache/airavata/api ${JAVA_API_SDK_DIR}/org/apache/airavata/api
+
+ echo "Successfully generated new sources, compared against exiting code and replaced the changed files"
+}
+
+####################################
+# Generate/Update C++ Client Stubs #
+####################################
+
+generate_cpp_stubs() {
+
+ #CPP generation directory
+ CPP_GEN_DIR=${BASE_TARGET_DIR}/gen-cpp
+
+ # As a precaution remove and previously generated files if exists
+ rm -rf ${CPP_GEN_DIR}
+
+ # Using thrift Java generator, generate the java classes based on Airavata API. This
+ # The airavataAPI.thrift includes rest of data models.
+ #thrift ${THRIFT_ARGS} --gen cpp ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate C++ thrift classes
+
+ #thrift ${THRIFT_ARGS} --gen cpp ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate C++ thrift classes for WorkflowAPI
+ # For the generated CPP classes add the ASF V2 License header
+ add_license_header $CPP_GEN_DIR
+
+ # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
+ # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models.
+ copy_changed_files ${CPP_GEN_DIR} ${CPP_SDK_DIR}
+
+}
+
+####################################
+# Generate/Update PHP Stubs #
+####################################
+
+generate_cpp_stubs() {
+
+ #PHP generation directory
+ PHP_GEN_DIR=${BASE_TARGET_DIR}/gen-php
+
+ # As a precaution remove and previously generated files if exists
+ rm -rf ${PHP_GEN_DIR}
+
+ # Using thrift Java generator, generate the java classes based on Airavata API. This
+ # The airavataAPI.thrift includes rest of data models.
+ #thrift ${THRIFT_ARGS} --gen php:autoload ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate PHP thrift classes
+
+ #thrift ${THRIFT_ARGS} --gen php:autoload ${THRIFT_IDL_DIR}/workflowAPI.thrift || fail unable to generate PHP thrift classes for WorkflowAPI
+ # For the generated java classes add the ASF V2 License header
+ ## TODO Write PHP license parser
+
+ # Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
+ # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models.
+ copy_changed_files ${PHP_GEN_DIR} ${PHP_SDK_DIR}
+
+ ####################
+ # Cleanup and Exit #
+ ####################
+ # CleanUp: Delete the base target build directory
+ #rm -rf ${BASE_TARGET_DIR}
+
+}
+
+for arg in "$@"
+do
+ case "$arg" in
+ all) echo "Generate all stubs (Java, PHP, C++, Python) Stubs"
+ ;;
+ java) echo "Generating Java Stubs"
+ generate_java_stubs
+ ;;
+ php) echo "Generate PHP Stubs"
+ ;;
+ cpp) echo "Generate C++ Stubs"
+ ;;
+ python) echo "Generate Python Stubs"
+ ;;
+ *) echo "Invalid or unsupported option"
+ show_usage
+ exit 1
+ ;;
+ esac
+done
+
+exit 0
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-appcatalog-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-appcatalog-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-appcatalog-api.thrift
new file mode 100644
index 0000000..ce60864
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-appcatalog-api.thrift
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ *
+*/
+
+/**
+ * Mock Application Catalog API
+*/
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-application-execution-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-application-execution-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-application-execution-api.thrift
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-credential-management-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-credential-management-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-credential-management-api.thrift
new file mode 100644
index 0000000..a5f6b84
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-credential-management-api.thrift
@@ -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.
+ *
+*/
+
+/**
+ * Mock Credential Store API
+*/
+
+namespace java org.apache.airavata.api.credentials
+namespace php Airavata.API.Credentials
+namespace cpp apache.airavata.api.credentials
+namespace perl ApacheAiravataAPICredentials
+namespace py apache.airavata.api.credentials
+namespace js ApacheAiravataAPICredentials
+
+service CredentialManagementService {
+
+ /**
+ * Generate and Register SSH Key Pair with Airavata Credential Store.
+ *
+ * @param gatewayId
+ * The identifier for the requested gateway.
+ *
+ * @param userName
+ * The User for which the credential should be registered. For community accounts, this user is the name of the
+ * community user name. For computational resources, this user name need not be the same user name on resoruces.
+ *
+ * @return airavataCredStoreToken
+ * An SSH Key pair is generated and stored in the credential store and associated with users or community account
+ * belonging to a gateway.
+ *
+ **/
+
+ string generateAndRegisterSSHKeys (1: required string gatewayId, 2: required string userName)
+
+ string getSSHPubKey (1: required string airavataCredStoreToken)
+
+ map<string, string> getAllUserSSHPubKeys (1: required string userName)
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-data-manegement-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-data-manegement-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-data-manegement-api.thrift
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-gateway-management-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-gateway-management-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-gateway-management-api.thrift
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-workflow-execution-api.thrift
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-workflow-execution-api.thrift b/airavata-mock-multiplexed-api/mock-api-interface-descriptions/mock-workflow-execution-api.thrift
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/pom.xml b/airavata-mock-multiplexed-api/pom.xml
new file mode 100644
index 0000000..ee314bd
--- /dev/null
+++ b/airavata-mock-multiplexed-api/pom.xml
@@ -0,0 +1,164 @@
+<?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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>14</version>
+ </parent>
+
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-mock-api</artifactId>
+ <packaging>pom</packaging>
+ <name>Airavata Mock API</name>
+ <version>0.15-SNAPSHOT</version>
+
+ <url>http://airavata.apache.org/</url>
+ <inceptionYear>2011</inceptionYear>
+
+ <scm>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/airavata-sandbox.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/airavata-sandbox.git</developerConnection>
+ <url> https://git-wip-us.apache.org/repos/asf?p=airavata-sandbox.git</url>
+ <tag>HEAD</tag>
+ </scm>
+
+ <mailingLists>
+
+ <mailingList>
+ <name>Airavata Developer List</name>
+ <subscribe>dev-subscribe@airavata.apache.org</subscribe>
+ <unsubscribe>dev-unsubscribe@airavata.apache.org</unsubscribe>
+ <post>mailto:dev@airavata.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/airavata-dev/</archive>
+ </mailingList>
+
+ <mailingList>
+ <name>Airavata Users List</name>
+ <subscribe>users-subscribe@airavata.apache.org</subscribe>
+ <unsubscribe>users-unsubscribe@airavata.apache.org</unsubscribe>
+ <post>mailto:users@airavata.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/airavata-users/</archive>
+ </mailingList>
+
+ </mailingLists>
+
+ <issueManagement>
+ <url>https://issues.apache.org/jira/browse/AIRAVATA</url>
+ </issueManagement>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <org.slf4j.version>1.7.6</org.slf4j.version>
+ <log4j.version>1.2.16</log4j.version>
+ <surefire.version>2.12</surefire.version>
+ <junit.version>4.7</junit.version>
+ <thrift.version>0.9.2</thrift.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://repository.apache.org/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ <repository>
+ <id>central</id>
+ <name>Maven Central</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>mock-airavata-api-java-stubs</module>
+ <module>mock-airavata-api-server</module>
+ </modules>
+ </profile>
+
+
+ </profiles>
+
+
+</project>
[2/3] airavata-sandbox git commit: mock api to test multi-plexing -
AIRAVATA-1629
Posted by sm...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/credentials/CredentialManagementService.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/credentials/CredentialManagementService.java b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/credentials/CredentialManagementService.java
new file mode 100644
index 0000000..7e4215a
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/credentials/CredentialManagementService.java
@@ -0,0 +1,2854 @@
+/**
+ * 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.2)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.api.credentials;
+
+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 javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-3-16")
+@SuppressWarnings("all") public class CredentialManagementService {
+
+ public interface Iface {
+
+ /**
+ * Generate and Register SSH Key Pair with Airavata Credential Store.
+ *
+ * @param gatewayId
+ * The identifier for the requested gateway.
+ *
+ * @param userName
+ * The User for which the credential should be registered. For community accounts, this user is the name of the
+ * community user name. For computational resources, this user name need not be the same user name on resoruces.
+ *
+ * @return airavataCredStoreToken
+ * An SSH Key pair is generated and stored in the credential store and associated with users or community account
+ * belonging to a gateway.
+ *
+ *
+ *
+ * @param gatewayId
+ * @param userName
+ */
+ public String generateAndRegisterSSHKeys(String gatewayId, String userName) throws org.apache.thrift.TException;
+
+ public String getSSHPubKey(String airavataCredStoreToken) throws org.apache.thrift.TException;
+
+ public Map<String,String> getAllUserSSHPubKeys(String userName) throws org.apache.thrift.TException;
+
+ }
+
+ public interface AsyncIface {
+
+ public void generateAndRegisterSSHKeys(String gatewayId, String userName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void getSSHPubKey(String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void getAllUserSSHPubKeys(String userName, 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 generateAndRegisterSSHKeys(String gatewayId, String userName) throws org.apache.thrift.TException
+ {
+ send_generateAndRegisterSSHKeys(gatewayId, userName);
+ return recv_generateAndRegisterSSHKeys();
+ }
+
+ public void send_generateAndRegisterSSHKeys(String gatewayId, String userName) throws org.apache.thrift.TException
+ {
+ generateAndRegisterSSHKeys_args args = new generateAndRegisterSSHKeys_args();
+ args.setGatewayId(gatewayId);
+ args.setUserName(userName);
+ sendBase("generateAndRegisterSSHKeys", args);
+ }
+
+ public String recv_generateAndRegisterSSHKeys() throws org.apache.thrift.TException
+ {
+ generateAndRegisterSSHKeys_result result = new generateAndRegisterSSHKeys_result();
+ receiveBase(result, "generateAndRegisterSSHKeys");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "generateAndRegisterSSHKeys failed: unknown result");
+ }
+
+ public String getSSHPubKey(String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ send_getSSHPubKey(airavataCredStoreToken);
+ return recv_getSSHPubKey();
+ }
+
+ public void send_getSSHPubKey(String airavataCredStoreToken) throws org.apache.thrift.TException
+ {
+ getSSHPubKey_args args = new getSSHPubKey_args();
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ sendBase("getSSHPubKey", args);
+ }
+
+ public String recv_getSSHPubKey() throws org.apache.thrift.TException
+ {
+ getSSHPubKey_result result = new getSSHPubKey_result();
+ receiveBase(result, "getSSHPubKey");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHPubKey failed: unknown result");
+ }
+
+ public Map<String,String> getAllUserSSHPubKeys(String userName) throws org.apache.thrift.TException
+ {
+ send_getAllUserSSHPubKeys(userName);
+ return recv_getAllUserSSHPubKeys();
+ }
+
+ public void send_getAllUserSSHPubKeys(String userName) throws org.apache.thrift.TException
+ {
+ getAllUserSSHPubKeys_args args = new getAllUserSSHPubKeys_args();
+ args.setUserName(userName);
+ sendBase("getAllUserSSHPubKeys", args);
+ }
+
+ public Map<String,String> recv_getAllUserSSHPubKeys() throws org.apache.thrift.TException
+ {
+ getAllUserSSHPubKeys_result result = new getAllUserSSHPubKeys_result();
+ receiveBase(result, "getAllUserSSHPubKeys");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUserSSHPubKeys 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 generateAndRegisterSSHKeys(String gatewayId, String userName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ generateAndRegisterSSHKeys_call method_call = new generateAndRegisterSSHKeys_call(gatewayId, userName, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class generateAndRegisterSSHKeys_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String gatewayId;
+ private String userName;
+ public generateAndRegisterSSHKeys_call(String gatewayId, String userName, 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.gatewayId = gatewayId;
+ this.userName = userName;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateAndRegisterSSHKeys", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ generateAndRegisterSSHKeys_args args = new generateAndRegisterSSHKeys_args();
+ args.setGatewayId(gatewayId);
+ args.setUserName(userName);
+ 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_generateAndRegisterSSHKeys();
+ }
+ }
+
+ public void getSSHPubKey(String airavataCredStoreToken, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getSSHPubKey_call method_call = new getSSHPubKey_call(airavataCredStoreToken, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getSSHPubKey_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String airavataCredStoreToken;
+ public getSSHPubKey_call(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.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("getSSHPubKey", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getSSHPubKey_args args = new getSSHPubKey_args();
+ args.setAiravataCredStoreToken(airavataCredStoreToken);
+ 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_getSSHPubKey();
+ }
+ }
+
+ public void getAllUserSSHPubKeys(String userName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getAllUserSSHPubKeys_call method_call = new getAllUserSSHPubKeys_call(userName, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getAllUserSSHPubKeys_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String userName;
+ public getAllUserSSHPubKeys_call(String userName, 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.userName = userName;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllUserSSHPubKeys", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getAllUserSSHPubKeys_args args = new getAllUserSSHPubKeys_args();
+ args.setUserName(userName);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public Map<String,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_getAllUserSSHPubKeys();
+ }
+ }
+
+ }
+
+ 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("generateAndRegisterSSHKeys", new generateAndRegisterSSHKeys());
+ processMap.put("getSSHPubKey", new getSSHPubKey());
+ processMap.put("getAllUserSSHPubKeys", new getAllUserSSHPubKeys());
+ return processMap;
+ }
+
+ public static class generateAndRegisterSSHKeys<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateAndRegisterSSHKeys_args> {
+ public generateAndRegisterSSHKeys() {
+ super("generateAndRegisterSSHKeys");
+ }
+
+ public generateAndRegisterSSHKeys_args getEmptyArgsInstance() {
+ return new generateAndRegisterSSHKeys_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public generateAndRegisterSSHKeys_result getResult(I iface, generateAndRegisterSSHKeys_args args) throws org.apache.thrift.TException {
+ generateAndRegisterSSHKeys_result result = new generateAndRegisterSSHKeys_result();
+ result.success = iface.generateAndRegisterSSHKeys(args.gatewayId, args.userName);
+ return result;
+ }
+ }
+
+ public static class getSSHPubKey<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHPubKey_args> {
+ public getSSHPubKey() {
+ super("getSSHPubKey");
+ }
+
+ public getSSHPubKey_args getEmptyArgsInstance() {
+ return new getSSHPubKey_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getSSHPubKey_result getResult(I iface, getSSHPubKey_args args) throws org.apache.thrift.TException {
+ getSSHPubKey_result result = new getSSHPubKey_result();
+ result.success = iface.getSSHPubKey(args.airavataCredStoreToken);
+ return result;
+ }
+ }
+
+ public static class getAllUserSSHPubKeys<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllUserSSHPubKeys_args> {
+ public getAllUserSSHPubKeys() {
+ super("getAllUserSSHPubKeys");
+ }
+
+ public getAllUserSSHPubKeys_args getEmptyArgsInstance() {
+ return new getAllUserSSHPubKeys_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getAllUserSSHPubKeys_result getResult(I iface, getAllUserSSHPubKeys_args args) throws org.apache.thrift.TException {
+ getAllUserSSHPubKeys_result result = new getAllUserSSHPubKeys_result();
+ result.success = iface.getAllUserSSHPubKeys(args.userName);
+ 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("generateAndRegisterSSHKeys", new generateAndRegisterSSHKeys());
+ processMap.put("getSSHPubKey", new getSSHPubKey());
+ processMap.put("getAllUserSSHPubKeys", new getAllUserSSHPubKeys());
+ return processMap;
+ }
+
+ public static class generateAndRegisterSSHKeys<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, generateAndRegisterSSHKeys_args, String> {
+ public generateAndRegisterSSHKeys() {
+ super("generateAndRegisterSSHKeys");
+ }
+
+ public generateAndRegisterSSHKeys_args getEmptyArgsInstance() {
+ return new generateAndRegisterSSHKeys_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) {
+ generateAndRegisterSSHKeys_result result = new generateAndRegisterSSHKeys_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;
+ generateAndRegisterSSHKeys_result result = new generateAndRegisterSSHKeys_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, generateAndRegisterSSHKeys_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.generateAndRegisterSSHKeys(args.gatewayId, args.userName,resultHandler);
+ }
+ }
+
+ public static class getSSHPubKey<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHPubKey_args, String> {
+ public getSSHPubKey() {
+ super("getSSHPubKey");
+ }
+
+ public getSSHPubKey_args getEmptyArgsInstance() {
+ return new getSSHPubKey_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) {
+ getSSHPubKey_result result = new getSSHPubKey_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;
+ getSSHPubKey_result result = new getSSHPubKey_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, getSSHPubKey_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.getSSHPubKey(args.airavataCredStoreToken,resultHandler);
+ }
+ }
+
+ public static class getAllUserSSHPubKeys<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllUserSSHPubKeys_args, Map<String,String>> {
+ public getAllUserSSHPubKeys() {
+ super("getAllUserSSHPubKeys");
+ }
+
+ public getAllUserSSHPubKeys_args getEmptyArgsInstance() {
+ return new getAllUserSSHPubKeys_args();
+ }
+
+ public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Map<String,String>>() {
+ public void onComplete(Map<String,String> o) {
+ getAllUserSSHPubKeys_result result = new getAllUserSSHPubKeys_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;
+ getAllUserSSHPubKeys_result result = new getAllUserSSHPubKeys_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, getAllUserSSHPubKeys_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException {
+ iface.getAllUserSSHPubKeys(args.userName,resultHandler);
+ }
+ }
+
+ }
+
+ public static class generateAndRegisterSSHKeys_args implements org.apache.thrift.TBase<generateAndRegisterSSHKeys_args, generateAndRegisterSSHKeys_args._Fields>, java.io.Serializable, Cloneable, Comparable<generateAndRegisterSSHKeys_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateAndRegisterSSHKeys_args");
+
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", 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 generateAndRegisterSSHKeys_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new generateAndRegisterSSHKeys_argsTupleSchemeFactory());
+ }
+
+ public String gatewayId; // required
+ public String userName; // 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 {
+ GATEWAY_ID((short)1, "gatewayId"),
+ USER_NAME((short)2, "userName");
+
+ 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: // GATEWAY_ID
+ return GATEWAY_ID;
+ case 2: // USER_NAME
+ return USER_NAME;
+ 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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", 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(generateAndRegisterSSHKeys_args.class, metaDataMap);
+ }
+
+ public generateAndRegisterSSHKeys_args() {
+ }
+
+ public generateAndRegisterSSHKeys_args(
+ String gatewayId,
+ String userName)
+ {
+ this();
+ this.gatewayId = gatewayId;
+ this.userName = userName;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public generateAndRegisterSSHKeys_args(generateAndRegisterSSHKeys_args other) {
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ if (other.isSetUserName()) {
+ this.userName = other.userName;
+ }
+ }
+
+ public generateAndRegisterSSHKeys_args deepCopy() {
+ return new generateAndRegisterSSHKeys_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.gatewayId = null;
+ this.userName = null;
+ }
+
+ public String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public generateAndRegisterSSHKeys_args setGatewayId(String gatewayId) {
+ this.gatewayId = gatewayId;
+ return this;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public generateAndRegisterSSHKeys_args setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public void unsetUserName() {
+ this.userName = null;
+ }
+
+ /** Returns true if field userName is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserName() {
+ return this.userName != null;
+ }
+
+ public void setUserNameIsSet(boolean value) {
+ if (!value) {
+ this.userName = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((String)value);
+ }
+ break;
+
+ case USER_NAME:
+ if (value == null) {
+ unsetUserName();
+ } else {
+ setUserName((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ case USER_NAME:
+ return getUserName();
+
+ }
+ 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 GATEWAY_ID:
+ return isSetGatewayId();
+ case USER_NAME:
+ return isSetUserName();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof generateAndRegisterSSHKeys_args)
+ return this.equals((generateAndRegisterSSHKeys_args)that);
+ return false;
+ }
+
+ public boolean equals(generateAndRegisterSSHKeys_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ boolean this_present_userName = true && this.isSetUserName();
+ boolean that_present_userName = true && that.isSetUserName();
+ if (this_present_userName || that_present_userName) {
+ if (!(this_present_userName && that_present_userName))
+ return false;
+ if (!this.userName.equals(that.userName))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_gatewayId = true && (isSetGatewayId());
+ list.add(present_gatewayId);
+ if (present_gatewayId)
+ list.add(gatewayId);
+
+ boolean present_userName = true && (isSetUserName());
+ list.add(present_userName);
+ if (present_userName)
+ list.add(userName);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(generateAndRegisterSSHKeys_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ 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("generateAndRegisterSSHKeys_args(");
+ boolean first = true;
+
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("userName:");
+ if (this.userName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userName);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (gatewayId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+ }
+ if (userName == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' 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 generateAndRegisterSSHKeys_argsStandardSchemeFactory implements SchemeFactory {
+ public generateAndRegisterSSHKeys_argsStandardScheme getScheme() {
+ return new generateAndRegisterSSHKeys_argsStandardScheme();
+ }
+ }
+
+ private static class generateAndRegisterSSHKeys_argsStandardScheme extends StandardScheme<generateAndRegisterSSHKeys_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, generateAndRegisterSSHKeys_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: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // USER_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(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, generateAndRegisterSSHKeys_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.userName != null) {
+ oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
+ oprot.writeString(struct.userName);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class generateAndRegisterSSHKeys_argsTupleSchemeFactory implements SchemeFactory {
+ public generateAndRegisterSSHKeys_argsTupleScheme getScheme() {
+ return new generateAndRegisterSSHKeys_argsTupleScheme();
+ }
+ }
+
+ private static class generateAndRegisterSSHKeys_argsTupleScheme extends TupleScheme<generateAndRegisterSSHKeys_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, generateAndRegisterSSHKeys_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.gatewayId);
+ oprot.writeString(struct.userName);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, generateAndRegisterSSHKeys_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ struct.userName = iprot.readString();
+ struct.setUserNameIsSet(true);
+ }
+ }
+
+ }
+
+ public static class generateAndRegisterSSHKeys_result implements org.apache.thrift.TBase<generateAndRegisterSSHKeys_result, generateAndRegisterSSHKeys_result._Fields>, java.io.Serializable, Cloneable, Comparable<generateAndRegisterSSHKeys_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateAndRegisterSSHKeys_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 generateAndRegisterSSHKeys_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new generateAndRegisterSSHKeys_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(generateAndRegisterSSHKeys_result.class, metaDataMap);
+ }
+
+ public generateAndRegisterSSHKeys_result() {
+ }
+
+ public generateAndRegisterSSHKeys_result(
+ String success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public generateAndRegisterSSHKeys_result(generateAndRegisterSSHKeys_result other) {
+ if (other.isSetSuccess()) {
+ this.success = other.success;
+ }
+ }
+
+ public generateAndRegisterSSHKeys_result deepCopy() {
+ return new generateAndRegisterSSHKeys_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public String getSuccess() {
+ return this.success;
+ }
+
+ public generateAndRegisterSSHKeys_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 generateAndRegisterSSHKeys_result)
+ return this.equals((generateAndRegisterSSHKeys_result)that);
+ return false;
+ }
+
+ public boolean equals(generateAndRegisterSSHKeys_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() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true && (isSetSuccess());
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(generateAndRegisterSSHKeys_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("generateAndRegisterSSHKeys_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 generateAndRegisterSSHKeys_resultStandardSchemeFactory implements SchemeFactory {
+ public generateAndRegisterSSHKeys_resultStandardScheme getScheme() {
+ return new generateAndRegisterSSHKeys_resultStandardScheme();
+ }
+ }
+
+ private static class generateAndRegisterSSHKeys_resultStandardScheme extends StandardScheme<generateAndRegisterSSHKeys_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, generateAndRegisterSSHKeys_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, generateAndRegisterSSHKeys_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 generateAndRegisterSSHKeys_resultTupleSchemeFactory implements SchemeFactory {
+ public generateAndRegisterSSHKeys_resultTupleScheme getScheme() {
+ return new generateAndRegisterSSHKeys_resultTupleScheme();
+ }
+ }
+
+ private static class generateAndRegisterSSHKeys_resultTupleScheme extends TupleScheme<generateAndRegisterSSHKeys_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, generateAndRegisterSSHKeys_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, generateAndRegisterSSHKeys_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 getSSHPubKey_args implements org.apache.thrift.TBase<getSSHPubKey_args, getSSHPubKey_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSSHPubKey_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSSHPubKey_args");
+
+ 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)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getSSHPubKey_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getSSHPubKey_argsTupleSchemeFactory());
+ }
+
+ 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 {
+ AIRAVATA_CRED_STORE_TOKEN((short)1, "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: // 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.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(getSSHPubKey_args.class, metaDataMap);
+ }
+
+ public getSSHPubKey_args() {
+ }
+
+ public getSSHPubKey_args(
+ String airavataCredStoreToken)
+ {
+ this();
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getSSHPubKey_args(getSSHPubKey_args other) {
+ if (other.isSetAiravataCredStoreToken()) {
+ this.airavataCredStoreToken = other.airavataCredStoreToken;
+ }
+ }
+
+ public getSSHPubKey_args deepCopy() {
+ return new getSSHPubKey_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.airavataCredStoreToken = null;
+ }
+
+ public String getAiravataCredStoreToken() {
+ return this.airavataCredStoreToken;
+ }
+
+ public getSSHPubKey_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 AIRAVATA_CRED_STORE_TOKEN:
+ if (value == null) {
+ unsetAiravataCredStoreToken();
+ } else {
+ setAiravataCredStoreToken((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ 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 AIRAVATA_CRED_STORE_TOKEN:
+ return isSetAiravataCredStoreToken();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getSSHPubKey_args)
+ return this.equals((getSSHPubKey_args)that);
+ return false;
+ }
+
+ public boolean equals(getSSHPubKey_args that) {
+ if (that == null)
+ 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() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_airavataCredStoreToken = true && (isSetAiravataCredStoreToken());
+ list.add(present_airavataCredStoreToken);
+ if (present_airavataCredStoreToken)
+ list.add(airavataCredStoreToken);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getSSHPubKey_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ 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("getSSHPubKey_args(");
+ boolean first = true;
+
+ 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 (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 getSSHPubKey_argsStandardSchemeFactory implements SchemeFactory {
+ public getSSHPubKey_argsStandardScheme getScheme() {
+ return new getSSHPubKey_argsStandardScheme();
+ }
+ }
+
+ private static class getSSHPubKey_argsStandardScheme extends StandardScheme<getSSHPubKey_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getSSHPubKey_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: // 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, getSSHPubKey_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ 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 getSSHPubKey_argsTupleSchemeFactory implements SchemeFactory {
+ public getSSHPubKey_argsTupleScheme getScheme() {
+ return new getSSHPubKey_argsTupleScheme();
+ }
+ }
+
+ private static class getSSHPubKey_argsTupleScheme extends TupleScheme<getSSHPubKey_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getSSHPubKey_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.airavataCredStoreToken);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getSSHPubKey_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.airavataCredStoreToken = iprot.readString();
+ struct.setAiravataCredStoreTokenIsSet(true);
+ }
+ }
+
+ }
+
+ public static class getSSHPubKey_result implements org.apache.thrift.TBase<getSSHPubKey_result, getSSHPubKey_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSSHPubKey_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSSHPubKey_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 getSSHPubKey_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getSSHPubKey_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(getSSHPubKey_result.class, metaDataMap);
+ }
+
+ public getSSHPubKey_result() {
+ }
+
+ public getSSHPubKey_result(
+ String success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getSSHPubKey_result(getSSHPubKey_result other) {
+ if (other.isSetSuccess()) {
+ this.success = other.success;
+ }
+ }
+
+ public getSSHPubKey_result deepCopy() {
+ return new getSSHPubKey_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public String getSuccess() {
+ return this.success;
+ }
+
+ public getSSHPubKey_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 getSSHPubKey_result)
+ return this.equals((getSSHPubKey_result)that);
+ return false;
+ }
+
+ public boolean equals(getSSHPubKey_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() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true && (isSetSuccess());
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getSSHPubKey_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("getSSHPubKey_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 getSSHPubKey_resultStandardSchemeFactory implements SchemeFactory {
+ public getSSHPubKey_resultStandardScheme getScheme() {
+ return new getSSHPubKey_resultStandardScheme();
+ }
+ }
+
+ private static class getSSHPubKey_resultStandardScheme extends StandardScheme<getSSHPubKey_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getSSHPubKey_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, getSSHPubKey_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 getSSHPubKey_resultTupleSchemeFactory implements SchemeFactory {
+ public getSSHPubKey_resultTupleScheme getScheme() {
+ return new getSSHPubKey_resultTupleScheme();
+ }
+ }
+
+ private static class getSSHPubKey_resultTupleScheme extends TupleScheme<getSSHPubKey_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getSSHPubKey_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, getSSHPubKey_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 getAllUserSSHPubKeys_args implements org.apache.thrift.TBase<getAllUserSSHPubKeys_args, getAllUserSSHPubKeys_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllUserSSHPubKeys_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllUserSSHPubKeys_args");
+
+ private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getAllUserSSHPubKeys_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getAllUserSSHPubKeys_argsTupleSchemeFactory());
+ }
+
+ public String userName; // 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 {
+ USER_NAME((short)1, "userName");
+
+ 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: // USER_NAME
+ return USER_NAME;
+ 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.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", 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(getAllUserSSHPubKeys_args.class, metaDataMap);
+ }
+
+ public getAllUserSSHPubKeys_args() {
+ }
+
+ public getAllUserSSHPubKeys_args(
+ String userName)
+ {
+ this();
+ this.userName = userName;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getAllUserSSHPubKeys_args(getAllUserSSHPubKeys_args other) {
+ if (other.isSetUserName()) {
+ this.userName = other.userName;
+ }
+ }
+
+ public getAllUserSSHPubKeys_args deepCopy() {
+ return new getAllUserSSHPubKeys_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.userName = null;
+ }
+
+ public String getUserName() {
+ return this.userName;
+ }
+
+ public getAllUserSSHPubKeys_args setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public void unsetUserName() {
+ this.userName = null;
+ }
+
+ /** Returns true if field userName is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserName() {
+ return this.userName != null;
+ }
+
+ public void setUserNameIsSet(boolean value) {
+ if (!value) {
+ this.userName = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case USER_NAME:
+ if (value == null) {
+ unsetUserName();
+ } else {
+ setUserName((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case USER_NAME:
+ return getUserName();
+
+ }
+ 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 USER_NAME:
+ return isSetUserName();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getAllUserSSHPubKeys_args)
+ return this.equals((getAllUserSSHPubKeys_args)that);
+ return false;
+ }
+
+ public boolean equals(getAllUserSSHPubKeys_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_userName = true && this.isSetUserName();
+ boolean that_present_userName = true && that.isSetUserName();
+ if (this_present_userName || that_present_userName) {
+ if (!(this_present_userName && that_present_userName))
+ return false;
+ if (!this.userName.equals(that.userName))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_userName = true && (isSetUserName());
+ list.add(present_userName);
+ if (present_userName)
+ list.add(userName);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getAllUserSSHPubKeys_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ 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("getAllUserSSHPubKeys_args(");
+ boolean first = true;
+
+ sb.append("userName:");
+ if (this.userName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userName);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (userName == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' 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 getAllUserSSHPubKeys_argsStandardSchemeFactory implements SchemeFactory {
+ public getAllUserSSHPubKeys_argsStandardScheme getScheme() {
+ return new getAllUserSSHPubKeys_argsStandardScheme();
+ }
+ }
+
+ private static class getAllUserSSHPubKeys_argsStandardScheme extends StandardScheme<getAllUserSSHPubKeys_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getAllUserSSHPubKeys_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+
<TRUNCATED>
[3/3] airavata-sandbox git commit: mock api to test multi-plexing -
AIRAVATA-1629
Posted by sm...@apache.org.
mock api to test multi-plexing - AIRAVATA-1629
Project: http://git-wip-us.apache.org/repos/asf/airavata-sandbox/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-sandbox/commit/62ad0a53
Tree: http://git-wip-us.apache.org/repos/asf/airavata-sandbox/tree/62ad0a53
Diff: http://git-wip-us.apache.org/repos/asf/airavata-sandbox/diff/62ad0a53
Branch: refs/heads/master
Commit: 62ad0a537987fcc26979191f2dcda7eed1b64aee
Parents: ec6ba29
Author: Suresh Marru <sm...@apache.org>
Authored: Mon Mar 16 21:44:09 2015 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Mon Mar 16 21:44:09 2015 -0400
----------------------------------------------------------------------
.../mock-airavata-api-java-stubs/pom.xml | 41 +
.../CredentialManagementService.java | 2854 ++++++++++++++++++
.../mock-airavata-api-server/pom.xml | 46 +
.../src/main/java/MockAiravataAPIServer.java | 328 ++
.../generate-thrift-stubs.sh | 269 ++
.../mock-appcatalog-api.thrift | 23 +
.../mock-application-execution-api.thrift | 0
.../mock-credential-management-api.thrift | 56 +
.../mock-data-manegement-api.thrift | 0
.../mock-gateway-management-api.thrift | 0
.../mock-workflow-execution-api.thrift | 0
airavata-mock-multiplexed-api/pom.xml | 164 +
12 files changed, 3781 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/62ad0a53/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/pom.xml b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/pom.xml
new file mode 100644
index 0000000..2abafd8
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/pom.xml
@@ -0,0 +1,41 @@
+<?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>mock-airavata-api</artifactId>
+ <groupId>org.apache.airavata</groupId>
+ <version>0.15-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <name>Airavata Generated Stubs Skeltons</name>
+ <artifactId>mock-airavata-api-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>
+
+ </dependencies>
+
+</project>