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/18 05:33:21 UTC

[1/2] airavata-sandbox git commit: adding java multiplexing client for AIRAVATA-1632

Repository: airavata-sandbox
Updated Branches:
  refs/heads/master 62ad0a537 -> e33bf99b0


http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/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
deleted file mode 100644
index 4d465f7..0000000
--- a/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/MockAiravataAPIServer.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.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/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/CredentialManagementHandler.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/CredentialManagementHandler.java b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/CredentialManagementHandler.java
new file mode 100644
index 0000000..540db96
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/CredentialManagementHandler.java
@@ -0,0 +1,44 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.api.handlers;
+
+import org.apache.airavata.api.credentials.CredentialManagementService;
+import org.apache.thrift.TException;
+
+import java.util.Map;
+
+public class CredentialManagementHandler implements CredentialManagementService.Iface {
+    @Override
+    public String generateAndRegisterSSHKeys(String gatewayId, String userName) throws TException {
+        return "testSSHKeyToken";
+    }
+
+    @Override
+    public String getSSHPubKey(String airavataCredStoreToken) throws TException {
+        return "testsshpubkey";
+    }
+
+    @Override
+    public Map<String, String> getAllUserSSHPubKeys(String userName) throws TException {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/GatewayManagementHandler.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/GatewayManagementHandler.java b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/GatewayManagementHandler.java
new file mode 100644
index 0000000..5804309
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/handlers/GatewayManagementHandler.java
@@ -0,0 +1,37 @@
+/*
+*
+* 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.handlers;
+
+import org.apache.airavata.api.gateway.management.GatewayManagementService;
+import org.apache.thrift.TException;
+
+public class GatewayManagementHandler implements GatewayManagementService.Iface {
+    @Override
+    public String registerGateway(String gatewayName) throws TException {
+        return "testGatewayId";
+    }
+
+    @Override
+    public String getGatewayName(String gatewayId) throws TException {
+        return "TestGateway";
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/server/MockAiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/server/MockAiravataAPIServer.java b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/server/MockAiravataAPIServer.java
new file mode 100644
index 0000000..2caedf8
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-server/src/main/java/org/apache/airavata/api/server/MockAiravataAPIServer.java
@@ -0,0 +1,72 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.api.server;
+
+import org.apache.airavata.api.credentials.CredentialManagementService;
+import org.apache.airavata.api.gateway.management.GatewayManagementService;
+import org.apache.airavata.api.handlers.CredentialManagementHandler;
+import org.apache.airavata.api.handlers.GatewayManagementHandler;
+import org.apache.thrift.TMultiplexedProcessor;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MockAiravataAPIServer {
+
+    private final static Logger logger = LoggerFactory.getLogger(MockAiravataAPIServer.class);
+
+    public static CredentialManagementHandler credentialManagementHandler;
+    public static CredentialManagementService.Processor credentialManagementProcessor;
+
+    public static GatewayManagementHandler gatewayManagementHandler;
+    public static GatewayManagementService.Processor gatewayManagementProcessor;
+
+    public static void main(String [] args) {
+        try {
+            credentialManagementHandler = new CredentialManagementHandler();
+            credentialManagementProcessor = new CredentialManagementService.Processor(credentialManagementHandler);
+
+            gatewayManagementHandler = new GatewayManagementHandler();
+            gatewayManagementProcessor = new GatewayManagementService.Processor(gatewayManagementHandler);
+
+            TMultiplexedProcessor airavataServerProcessor = new TMultiplexedProcessor();
+
+            airavataServerProcessor.registerProcessor("CredentialManagementService",credentialManagementProcessor);
+            airavataServerProcessor.registerProcessor("GatewayManagementService",gatewayManagementProcessor);
+
+            TServerTransport serverTransport = new TServerSocket(9190);
+
+            TServer server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(airavataServerProcessor));
+
+            System.out.println("Starting Mock Airavata API server...");
+            server.serve();
+
+        } catch (Exception x) {
+            x.printStackTrace();
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/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
index 3744494..81f624d 100755
--- 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
@@ -174,8 +174,7 @@ generate_java_stubs() {
     # 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
+    thrift ${THRIFT_ARGS} --gen java mock-gateway-management-api.thrift || fail unable to generate java thrift classes on AiravataAPI
 
     # For the generated java classes add the ASF V2 License header
     add_license_header $JAVA_GEN_DIR

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/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
index e69de29..155113b 100644
--- 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
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ *
+*/
+
+/**
+ * Gateway Management API
+*/
+
+namespace java org.apache.airavata.api.gateway.management
+namespace php Airavata.API.GatewayManagement
+namespace cpp apache.airavata.api.gateway.management
+namespace perl ApacheAiravataAPIGatewayManagement
+namespace py apache.airavata.api.gateway.management
+namespace js ApacheAiravataAPIGatewayManagement
+
+service GatewayManagementService {
+
+   string registerGateway (1: required string gatewayName)
+
+   string getGatewayName (1: required string gatewayId)
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/pom.xml b/airavata-mock-multiplexed-api/pom.xml
index ee314bd..b4e8a1b 100644
--- a/airavata-mock-multiplexed-api/pom.xml
+++ b/airavata-mock-multiplexed-api/pom.xml
@@ -26,7 +26,7 @@
 	</parent>
 
 	<groupId>org.apache.airavata</groupId>
-	<artifactId>airavata-mock-api</artifactId>
+	<artifactId>mock-airavata-api</artifactId>
 	<packaging>pom</packaging>
 	<name>Airavata Mock API</name>
 	<version>0.15-SNAPSHOT</version>
@@ -68,10 +68,10 @@
 	<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>
+		<org.slf4j.version>1.7.10</org.slf4j.version>
 		<log4j.version>1.2.16</log4j.version>
-		<surefire.version>2.12</surefire.version>
-		<junit.version>4.7</junit.version>
+		<surefire.version>2.18.1</surefire.version>
+		<junit.version>4.12</junit.version>
         <thrift.version>0.9.2</thrift.version>
 	</properties>
 
@@ -140,10 +140,10 @@
 					<plugin>
 						<groupId>org.apache.maven.plugins</groupId>
 						<artifactId>maven-compiler-plugin</artifactId>
-						<version>3.1</version>
+						<version>3.2</version>
 						<configuration>
-							<source>1.6</source>
-							<target>1.6</target>
+							<source>1.8</source>
+							<target>1.8</target>
 						</configuration>
 					</plugin>
 				</plugins>
@@ -154,6 +154,7 @@
 			<modules>
 				<module>mock-airavata-api-java-stubs</module>
 				<module>mock-airavata-api-server</module>
+                <module>mock-airavata-api-client</module>
 			</modules>
 		</profile>
 


[2/2] airavata-sandbox git commit: adding java multiplexing client for AIRAVATA-1632

Posted by sm...@apache.org.
adding java multiplexing client for AIRAVATA-1632


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

Branch: refs/heads/master
Commit: e33bf99b040eb59add06d73b25c3e5a042dbd1da
Parents: 62ad0a5
Author: Suresh Marru <sm...@apache.org>
Authored: Wed Mar 18 00:33:15 2015 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Wed Mar 18 00:33:15 2015 -0400

----------------------------------------------------------------------
 .../mock-airavata-api-client.iml                |   22 +
 .../mock-airavata-api-client/pom.xml            |   46 +
 .../airavata/api/client/TestAiravataClient.java |   46 +
 .../api/client/MockAiravataClientFactory.java   |   65 +
 .../CredentialManagementService.java            |    3 +-
 .../management/GatewayManagementService.java    | 1830 ++++++++++++++++++
 .../src/main/java/MockAiravataAPIServer.java    |  328 ----
 .../handlers/CredentialManagementHandler.java   |   44 +
 .../api/handlers/GatewayManagementHandler.java  |   37 +
 .../api/server/MockAiravataAPIServer.java       |   72 +
 .../generate-thrift-stubs.sh                    |    3 +-
 .../mock-gateway-management-api.thrift          |   39 +
 airavata-mock-multiplexed-api/pom.xml           |   15 +-
 13 files changed, 2211 insertions(+), 339 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-client/mock-airavata-api-client.iml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-client/mock-airavata-api-client.iml b/airavata-mock-multiplexed-api/mock-airavata-api-client/mock-airavata-api-client.iml
new file mode 100644
index 0000000..3c58000
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-client/mock-airavata-api-client.iml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="mock-airavata-api-stubs" />
+    <orderEntry type="library" name="Maven: org.apache.thrift:libthrift:0.9.2" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.10" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.2.5" level="project" />
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.2.4" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.10" level="project" />
+    <orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" />
+  </component>
+</module>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-client/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-client/pom.xml b/airavata-mock-multiplexed-api/mock-airavata-api-client/pom.xml
new file mode 100644
index 0000000..19362fc
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-client/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-client</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/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-client/src/main/java/org/apache/airavata/api/client/TestAiravataClient.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-client/src/main/java/org/apache/airavata/api/client/TestAiravataClient.java b/airavata-mock-multiplexed-api/mock-airavata-api-client/src/main/java/org/apache/airavata/api/client/TestAiravataClient.java
new file mode 100644
index 0000000..3a2f1d8
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-client/src/main/java/org/apache/airavata/api/client/TestAiravataClient.java
@@ -0,0 +1,46 @@
+/*
+*
+* 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.client;
+
+import org.apache.airavata.api.credentials.CredentialManagementService;
+import org.apache.airavata.api.gateway.management.GatewayManagementService;
+
+public class TestAiravataClient {
+
+    public static void main(String [] args) {
+        System.out.println("Testing Airavata API");
+
+        CredentialManagementService.Client credentialManagementClient = null;
+        GatewayManagementService.Client gatewatManagementClient = null;
+        try {
+            credentialManagementClient = MockAiravataClientFactory.createCredentialManagementClient("localhost", 9190);
+            System.out.println("SSH Key is " + credentialManagementClient.generateAndRegisterSSHKeys("test", "test"));
+
+            gatewatManagementClient = MockAiravataClientFactory.createGatewayManagementClient("localhost", 9190);
+            System.out.println("Test Gateway Name is " + gatewatManagementClient.registerGateway("test"));
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/client/MockAiravataClientFactory.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/client/MockAiravataClientFactory.java b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/client/MockAiravataClientFactory.java
new file mode 100644
index 0000000..effd75a
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/client/MockAiravataClientFactory.java
@@ -0,0 +1,65 @@
+/*
+*
+* 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.client;
+
+import org.apache.airavata.api.credentials.CredentialManagementService;
+import org.apache.airavata.api.gateway.management.GatewayManagementService;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TMultiplexedProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class MockAiravataClientFactory {
+
+    private final static Logger logger = LoggerFactory.getLogger(MockAiravataClientFactory.class);
+
+    public static CredentialManagementService.Client createCredentialManagementClient(String serverHost, int serverPort) throws Exception{
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, "CredentialManagementService");
+            return new CredentialManagementService.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            e.printStackTrace();
+            throw new Exception("Could not connect to API Server");
+        }
+    }
+
+    public static GatewayManagementService.Client createGatewayManagementClient(String serverHost, int serverPort) throws Exception{
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, "GatewayManagementService");
+            return new GatewayManagementService.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            e.printStackTrace();
+            throw new Exception("Could not connect to API Server");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/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
index 7e4215a..b7a4001 100644
--- 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
@@ -50,8 +50,7 @@ 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")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-3-18")
 @SuppressWarnings("all") public class CredentialManagementService {
 
   public interface Iface {

http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/e33bf99b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/gateway/management/GatewayManagementService.java
----------------------------------------------------------------------
diff --git a/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/gateway/management/GatewayManagementService.java b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/gateway/management/GatewayManagementService.java
new file mode 100644
index 0000000..9293ac4
--- /dev/null
+++ b/airavata-mock-multiplexed-api/mock-airavata-api-java-stubs/src/main/java/org/apache/airavata/api/gateway/management/GatewayManagementService.java
@@ -0,0 +1,1830 @@
+/**
+ * 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.gateway.management;
+
+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;
+
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-3-18")
+@SuppressWarnings("all") public class GatewayManagementService {
+
+  public interface Iface {
+
+    public String registerGateway(String gatewayName) throws org.apache.thrift.TException;
+
+    public String getGatewayName(String gatewayId) throws org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void registerGateway(String gatewayName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getGatewayName(String gatewayId, 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 registerGateway(String gatewayName) throws org.apache.thrift.TException
+    {
+      send_registerGateway(gatewayName);
+      return recv_registerGateway();
+    }
+
+    public void send_registerGateway(String gatewayName) throws org.apache.thrift.TException
+    {
+      registerGateway_args args = new registerGateway_args();
+      args.setGatewayName(gatewayName);
+      sendBase("registerGateway", args);
+    }
+
+    public String recv_registerGateway() throws org.apache.thrift.TException
+    {
+      registerGateway_result result = new registerGateway_result();
+      receiveBase(result, "registerGateway");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerGateway failed: unknown result");
+    }
+
+    public String getGatewayName(String gatewayId) throws org.apache.thrift.TException
+    {
+      send_getGatewayName(gatewayId);
+      return recv_getGatewayName();
+    }
+
+    public void send_getGatewayName(String gatewayId) throws org.apache.thrift.TException
+    {
+      getGatewayName_args args = new getGatewayName_args();
+      args.setGatewayId(gatewayId);
+      sendBase("getGatewayName", args);
+    }
+
+    public String recv_getGatewayName() throws org.apache.thrift.TException
+    {
+      getGatewayName_result result = new getGatewayName_result();
+      receiveBase(result, "getGatewayName");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGatewayName 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 registerGateway(String gatewayName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      registerGateway_call method_call = new registerGateway_call(gatewayName, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class registerGateway_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String gatewayName;
+      public registerGateway_call(String gatewayName, 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.gatewayName = gatewayName;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerGateway", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        registerGateway_args args = new registerGateway_args();
+        args.setGatewayName(gatewayName);
+        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_registerGateway();
+      }
+    }
+
+    public void getGatewayName(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getGatewayName_call method_call = new getGatewayName_call(gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getGatewayName_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String gatewayId;
+      public getGatewayName_call(String gatewayId, 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;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGatewayName", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getGatewayName_args args = new getGatewayName_args();
+        args.setGatewayId(gatewayId);
+        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_getGatewayName();
+      }
+    }
+
+  }
+
+  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("registerGateway", new registerGateway());
+      processMap.put("getGatewayName", new getGatewayName());
+      return processMap;
+    }
+
+    public static class registerGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerGateway_args> {
+      public registerGateway() {
+        super("registerGateway");
+      }
+
+      public registerGateway_args getEmptyArgsInstance() {
+        return new registerGateway_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public registerGateway_result getResult(I iface, registerGateway_args args) throws org.apache.thrift.TException {
+        registerGateway_result result = new registerGateway_result();
+        result.success = iface.registerGateway(args.gatewayName);
+        return result;
+      }
+    }
+
+    public static class getGatewayName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getGatewayName_args> {
+      public getGatewayName() {
+        super("getGatewayName");
+      }
+
+      public getGatewayName_args getEmptyArgsInstance() {
+        return new getGatewayName_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getGatewayName_result getResult(I iface, getGatewayName_args args) throws org.apache.thrift.TException {
+        getGatewayName_result result = new getGatewayName_result();
+        result.success = iface.getGatewayName(args.gatewayId);
+        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("registerGateway", new registerGateway());
+      processMap.put("getGatewayName", new getGatewayName());
+      return processMap;
+    }
+
+    public static class registerGateway<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerGateway_args, String> {
+      public registerGateway() {
+        super("registerGateway");
+      }
+
+      public registerGateway_args getEmptyArgsInstance() {
+        return new registerGateway_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) {
+            registerGateway_result result = new registerGateway_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;
+            registerGateway_result result = new registerGateway_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, registerGateway_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.registerGateway(args.gatewayName,resultHandler);
+      }
+    }
+
+    public static class getGatewayName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getGatewayName_args, String> {
+      public getGatewayName() {
+        super("getGatewayName");
+      }
+
+      public getGatewayName_args getEmptyArgsInstance() {
+        return new getGatewayName_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) {
+            getGatewayName_result result = new getGatewayName_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;
+            getGatewayName_result result = new getGatewayName_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, getGatewayName_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.getGatewayName(args.gatewayId,resultHandler);
+      }
+    }
+
+  }
+
+  public static class registerGateway_args implements org.apache.thrift.TBase<registerGateway_args, registerGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerGateway_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerGateway_args");
+
+    private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", 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 registerGateway_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new registerGateway_argsTupleSchemeFactory());
+    }
+
+    public String gatewayName; // 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_NAME((short)1, "gatewayName");
+
+      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_NAME
+            return GATEWAY_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_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", 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(registerGateway_args.class, metaDataMap);
+    }
+
+    public registerGateway_args() {
+    }
+
+    public registerGateway_args(
+      String gatewayName)
+    {
+      this();
+      this.gatewayName = gatewayName;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerGateway_args(registerGateway_args other) {
+      if (other.isSetGatewayName()) {
+        this.gatewayName = other.gatewayName;
+      }
+    }
+
+    public registerGateway_args deepCopy() {
+      return new registerGateway_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.gatewayName = null;
+    }
+
+    public String getGatewayName() {
+      return this.gatewayName;
+    }
+
+    public registerGateway_args setGatewayName(String gatewayName) {
+      this.gatewayName = gatewayName;
+      return this;
+    }
+
+    public void unsetGatewayName() {
+      this.gatewayName = null;
+    }
+
+    /** Returns true if field gatewayName is set (has been assigned a value) and false otherwise */
+    public boolean isSetGatewayName() {
+      return this.gatewayName != null;
+    }
+
+    public void setGatewayNameIsSet(boolean value) {
+      if (!value) {
+        this.gatewayName = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case GATEWAY_NAME:
+        if (value == null) {
+          unsetGatewayName();
+        } else {
+          setGatewayName((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case GATEWAY_NAME:
+        return getGatewayName();
+
+      }
+      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_NAME:
+        return isSetGatewayName();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof registerGateway_args)
+        return this.equals((registerGateway_args)that);
+      return false;
+    }
+
+    public boolean equals(registerGateway_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_gatewayName = true && this.isSetGatewayName();
+      boolean that_present_gatewayName = true && that.isSetGatewayName();
+      if (this_present_gatewayName || that_present_gatewayName) {
+        if (!(this_present_gatewayName && that_present_gatewayName))
+          return false;
+        if (!this.gatewayName.equals(that.gatewayName))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      List<Object> list = new ArrayList<Object>();
+
+      boolean present_gatewayName = true && (isSetGatewayName());
+      list.add(present_gatewayName);
+      if (present_gatewayName)
+        list.add(gatewayName);
+
+      return list.hashCode();
+    }
+
+    @Override
+    public int compareTo(registerGateway_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetGatewayName()).compareTo(other.isSetGatewayName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetGatewayName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayName, other.gatewayName);
+        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("registerGateway_args(");
+      boolean first = true;
+
+      sb.append("gatewayName:");
+      if (this.gatewayName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.gatewayName);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (gatewayName == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayName' 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 registerGateway_argsStandardSchemeFactory implements SchemeFactory {
+      public registerGateway_argsStandardScheme getScheme() {
+        return new registerGateway_argsStandardScheme();
+      }
+    }
+
+    private static class registerGateway_argsStandardScheme extends StandardScheme<registerGateway_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerGateway_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_NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.gatewayName = iprot.readString();
+                struct.setGatewayNameIsSet(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, registerGateway_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.gatewayName != null) {
+          oprot.writeFieldBegin(GATEWAY_NAME_FIELD_DESC);
+          oprot.writeString(struct.gatewayName);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class registerGateway_argsTupleSchemeFactory implements SchemeFactory {
+      public registerGateway_argsTupleScheme getScheme() {
+        return new registerGateway_argsTupleScheme();
+      }
+    }
+
+    private static class registerGateway_argsTupleScheme extends TupleScheme<registerGateway_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerGateway_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        oprot.writeString(struct.gatewayName);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, registerGateway_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        struct.gatewayName = iprot.readString();
+        struct.setGatewayNameIsSet(true);
+      }
+    }
+
+  }
+
+  public static class registerGateway_result implements org.apache.thrift.TBase<registerGateway_result, registerGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerGateway_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerGateway_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 registerGateway_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new registerGateway_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(registerGateway_result.class, metaDataMap);
+    }
+
+    public registerGateway_result() {
+    }
+
+    public registerGateway_result(
+      String success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerGateway_result(registerGateway_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+    }
+
+    public registerGateway_result deepCopy() {
+      return new registerGateway_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public registerGateway_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 registerGateway_result)
+        return this.equals((registerGateway_result)that);
+      return false;
+    }
+
+    public boolean equals(registerGateway_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(registerGateway_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("registerGateway_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 registerGateway_resultStandardSchemeFactory implements SchemeFactory {
+      public registerGateway_resultStandardScheme getScheme() {
+        return new registerGateway_resultStandardScheme();
+      }
+    }
+
+    private static class registerGateway_resultStandardScheme extends StandardScheme<registerGateway_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerGateway_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, registerGateway_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 registerGateway_resultTupleSchemeFactory implements SchemeFactory {
+      public registerGateway_resultTupleScheme getScheme() {
+        return new registerGateway_resultTupleScheme();
+      }
+    }
+
+    private static class registerGateway_resultTupleScheme extends TupleScheme<registerGateway_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerGateway_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, registerGateway_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 getGatewayName_args implements org.apache.thrift.TBase<getGatewayName_args, getGatewayName_args._Fields>, java.io.Serializable, Cloneable, Comparable<getGatewayName_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGatewayName_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getGatewayName_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getGatewayName_argsTupleSchemeFactory());
+    }
+
+    public String gatewayId; // 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");
+
+      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;
+          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)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGatewayName_args.class, metaDataMap);
+    }
+
+    public getGatewayName_args() {
+    }
+
+    public getGatewayName_args(
+      String gatewayId)
+    {
+      this();
+      this.gatewayId = gatewayId;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getGatewayName_args(getGatewayName_args other) {
+      if (other.isSetGatewayId()) {
+        this.gatewayId = other.gatewayId;
+      }
+    }
+
+    public getGatewayName_args deepCopy() {
+      return new getGatewayName_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.gatewayId = null;
+    }
+
+    public String getGatewayId() {
+      return this.gatewayId;
+    }
+
+    public getGatewayName_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 void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case GATEWAY_ID:
+        if (value == null) {
+          unsetGatewayId();
+        } else {
+          setGatewayId((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case GATEWAY_ID:
+        return getGatewayId();
+
+      }
+      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();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getGatewayName_args)
+        return this.equals((getGatewayName_args)that);
+      return false;
+    }
+
+    public boolean equals(getGatewayName_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;
+      }
+
+      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);
+
+      return list.hashCode();
+    }
+
+    @Override
+    public int compareTo(getGatewayName_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;
+        }
+      }
+      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("getGatewayName_args(");
+      boolean first = true;
+
+      sb.append("gatewayId:");
+      if (this.gatewayId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.gatewayId);
+      }
+      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());
+      }
+      // 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 getGatewayName_argsStandardSchemeFactory implements SchemeFactory {
+      public getGatewayName_argsStandardScheme getScheme() {
+        return new getGatewayName_argsStandardScheme();
+      }
+    }
+
+    private static class getGatewayName_argsStandardScheme extends StandardScheme<getGatewayName_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getGatewayName_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;
+            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, getGatewayName_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();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getGatewayName_argsTupleSchemeFactory implements SchemeFactory {
+      public getGatewayName_argsTupleScheme getScheme() {
+        return new getGatewayName_argsTupleScheme();
+      }
+    }
+
+    private static class getGatewayName_argsTupleScheme extends TupleScheme<getGatewayName_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getGatewayName_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        oprot.writeString(struct.gatewayId);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getGatewayName_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        struct.gatewayId = iprot.readString();
+        struct.setGatewayIdIsSet(true);
+      }
+    }
+
+  }
+
+  public static class getGatewayName_result implements org.apache.thrift.TBase<getGatewayName_result, getGatewayName_result._Fields>, java.io.Serializable, Cloneable, Comparable<getGatewayName_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGatewayName_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 getGatewayName_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getGatewayName_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(getGatewayName_result.class, metaDataMap);
+    }
+
+    public getGatewayName_result() {
+    }
+
+    public getGatewayName_result(
+      String success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getGatewayName_result(getGatewayName_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+    }
+
+    public getGatewayName_result deepCopy() {
+      return new getGatewayName_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getGatewayName_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 getGatewayName_result)
+        return this.equals((getGatewayName_result)that);
+      return false;
+    }
+
+    public boolean equals(getGatewayName_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(getGatewayName_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("getGatewayName_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 getGatewayName_resultStandardSchemeFactory implements SchemeFactory {
+      public getGatewayName_resultStandardScheme getScheme() {
+        return new getGatewayName_resultStandardScheme();
+      }
+    }
+
+    private static class getGatewayName_resultStandardScheme extends StandardScheme<getGatewayName_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getGatewayName_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, getGatewayName_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 getGatewayName_resultTupleSchemeFactory implements SchemeFactory {
+      public getGatewayName_resultTupleScheme getScheme() {
+        return new getGatewayName_resultTupleScheme();
+      }
+    }
+
+    private static class getGatewayName_resultTupleScheme extends TupleScheme<getGatewayName_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getGatewayName_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, getGatewayName_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);
+        }
+      }
+    }
+
+  }
+
+}