You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/10/16 22:25:48 UTC
[06/51] [abbrv] airavata git commit: adding method to get all ssh pub
key Summaries
adding method to get all ssh pub key Summaries
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c4fb5322
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c4fb5322
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c4fb5322
Branch: refs/heads/airavata-gov-registry
Commit: c4fb53222205543b85f2b9926ef6c0c98ecfb02e
Parents: 077fd2c
Author: Anuj Bhandar <bh...@gmail.com>
Authored: Mon Oct 10 18:27:52 2016 -0400
Committer: Anuj Bhandar <bh...@gmail.com>
Committed: Wed Oct 12 11:30:42 2016 -0400
----------------------------------------------------------------------
.../server/CredentialStoreServerHandler.java | 36 +-
.../store/cpi/CredentialStoreService.java | 1093 +++++++++++++++++-
2 files changed, 1083 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4fb5322/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
index b7d52ce..e8d0ef2 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -49,10 +49,7 @@ import java.io.IOException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
public class CredentialStoreServerHandler implements CredentialStoreService.Iface {
protected static Logger log = LoggerFactory.getLogger(CredentialStoreServerHandler.class);
@@ -95,6 +92,9 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
if (sshCredential.getPrivateKey() != null) {
credential.setPrivateKey(sshCredential.getPrivateKey().getBytes());
}
+ if(sshCredential.getDescription() != null){
+ credential.setDescription(sshCredential.getDescription());
+ }
if (sshCredential.getPublicKey() != null) {
credential.setPublicKey(sshCredential.getPublicKey().getBytes());
}
@@ -175,6 +175,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
sshCredential.setPassphrase(credential1.getPassphrase());
sshCredential.setToken(credential1.getToken());
sshCredential.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
+ sshCredential.setDescription(credential1.getDescription());
return sshCredential;
} else {
log.info("Could not find SSH credentials for token - " + tokenId + " and "
@@ -199,6 +200,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
sshCredentialSummary.setPublicKey(new String(credential1.getPublicKey()));
sshCredentialSummary.setToken(credential1.getToken());
sshCredentialSummary.setPersistedTime(credential1.getCertificateRequestedTime().getTime());
+ sshCredentialSummary.setDescription(credential1.getDescription());
return sshCredentialSummary;
} else {
log.info("Could not find SSH credential for token - " + tokenId + " and "
@@ -324,6 +326,32 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
}
@Override
+ public List<SSHCredentialSummary> getAllGatewaySSHCredentialSummary(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
+ Map<String, String> sshKeyMap = new HashMap<>();
+ List<SSHCredentialSummary> summaryList = new ArrayList<>();
+ try {
+ List<Credential> allCredentials = credentialReader.getAllCredentialsPerGateway(gatewayId);
+ if (allCredentials != null && !allCredentials.isEmpty()){
+ for (Credential credential : allCredentials) {
+ if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) {
+ org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential sshCredential = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
+ SSHCredentialSummary sshCredentialSummary = new SSHCredentialSummary();
+ sshCredentialSummary.setToken(sshCredential.getToken());
+ sshCredentialSummary.setUsername(sshCredential.getPortalUserName());
+ sshCredentialSummary.setGatewayId(sshCredential.getGateway());
+ sshCredentialSummary.setDescription(sshCredential.getDescription());
+ summaryList.add(sshCredentialSummary);
+ }
+ }
+ }
+ } catch (CredentialStoreException e) {
+ log.error("Error occurred while retrieving credential Summary", e);
+ throw new org.apache.airavata.credential.store.exception.CredentialStoreException("Error occurred while retrieving credential Summary");
+ }
+ return summaryList;
+ }
+
+ @Override
public Map<String, String> getAllPWDCredentialsForGateway(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, TException {
Map<String, String> pwdCredMap = new HashMap<>();
try {
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4fb5322/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
index 209bcce..93e088c 100644
--- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
+++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
@@ -22,33 +22,21 @@
*/
package org.apache.airavata.credential.store.cpi;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.protocol.TTupleProtocol;
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.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.annotation.Generated;
+import java.util.*;
+
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10")
public class CredentialStoreService {
@@ -84,6 +72,8 @@ public class CredentialStoreService {
public Map<String,String> getAllSSHKeysForGateway(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getAllGatewaySSHCredentialSummary(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
+
public Map<String,String> getAllPWDCredentialsForGateway(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
public boolean deleteSSHCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException;
@@ -114,6 +104,8 @@ public class CredentialStoreService {
public void getAllSSHKeysForGateway(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getAllGatewaySSHCredentialSummary(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
public void getAllPWDCredentialsForGateway(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void deleteSSHCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -402,6 +394,32 @@ public class CredentialStoreService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllSSHKeysForGateway failed: unknown result");
}
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getAllGatewaySSHCredentialSummary(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+ {
+ send_getAllGatewaySSHCredentialSummary(gatewayId);
+ return recv_getAllGatewaySSHCredentialSummary();
+ }
+
+ public void send_getAllGatewaySSHCredentialSummary(String gatewayId) throws org.apache.thrift.TException
+ {
+ getAllGatewaySSHCredentialSummary_args args = new getAllGatewaySSHCredentialSummary_args();
+ args.setGatewayId(gatewayId);
+ sendBase("getAllGatewaySSHCredentialSummary", args);
+ }
+
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> recv_getAllGatewaySSHCredentialSummary() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
+ {
+ getAllGatewaySSHCredentialSummary_result result = new getAllGatewaySSHCredentialSummary_result();
+ receiveBase(result, "getAllGatewaySSHCredentialSummary");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.csException != null) {
+ throw result.csException;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllGatewaySSHCredentialSummary failed: unknown result");
+ }
+
public Map<String,String> getAllPWDCredentialsForGateway(String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException
{
send_getAllPWDCredentialsForGateway(gatewayId);
@@ -829,6 +847,38 @@ public class CredentialStoreService {
}
}
+ public void getAllGatewaySSHCredentialSummary(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getAllGatewaySSHCredentialSummary_call method_call = new getAllGatewaySSHCredentialSummary_call(gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getAllGatewaySSHCredentialSummary_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String gatewayId;
+ public getAllGatewaySSHCredentialSummary_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("getAllGatewaySSHCredentialSummary", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getAllGatewaySSHCredentialSummary_args args = new getAllGatewaySSHCredentialSummary_args();
+ args.setGatewayId(gatewayId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getResult() throws org.apache.airavata.credential.store.exception.CredentialStoreException, 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_getAllGatewaySSHCredentialSummary();
+ }
+ }
+
public void getAllPWDCredentialsForGateway(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllPWDCredentialsForGateway_call method_call = new getAllPWDCredentialsForGateway_call(gatewayId, resultHandler, this, ___protocolFactory, ___transport);
@@ -954,6 +1004,7 @@ public class CredentialStoreService {
processMap.put("getPasswordCredential", new getPasswordCredential());
processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser());
processMap.put("getAllSSHKeysForGateway", new getAllSSHKeysForGateway());
+ processMap.put("getAllGatewaySSHCredentialSummary", new getAllGatewaySSHCredentialSummary());
processMap.put("getAllPWDCredentialsForGateway", new getAllPWDCredentialsForGateway());
processMap.put("deleteSSHCredential", new deleteSSHCredential());
processMap.put("deletePWDCredential", new deletePWDCredential());
@@ -1196,6 +1247,30 @@ public class CredentialStoreService {
}
}
+ public static class getAllGatewaySSHCredentialSummary<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllGatewaySSHCredentialSummary_args> {
+ public getAllGatewaySSHCredentialSummary() {
+ super("getAllGatewaySSHCredentialSummary");
+ }
+
+ public getAllGatewaySSHCredentialSummary_args getEmptyArgsInstance() {
+ return new getAllGatewaySSHCredentialSummary_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getAllGatewaySSHCredentialSummary_result getResult(I iface, getAllGatewaySSHCredentialSummary_args args) throws org.apache.thrift.TException {
+ getAllGatewaySSHCredentialSummary_result result = new getAllGatewaySSHCredentialSummary_result();
+ try {
+ result.success = iface.getAllGatewaySSHCredentialSummary(args.gatewayId);
+ } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+ result.csException = csException;
+ }
+ return result;
+ }
+ }
+
public static class getAllPWDCredentialsForGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPWDCredentialsForGateway_args> {
public getAllPWDCredentialsForGateway() {
super("getAllPWDCredentialsForGateway");
@@ -1293,6 +1368,7 @@ public class CredentialStoreService {
processMap.put("getPasswordCredential", new getPasswordCredential());
processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser());
processMap.put("getAllSSHKeysForGateway", new getAllSSHKeysForGateway());
+ processMap.put("getAllGatewaySSHCredentialSummary", new getAllGatewaySSHCredentialSummary());
processMap.put("getAllPWDCredentialsForGateway", new getAllPWDCredentialsForGateway());
processMap.put("deleteSSHCredential", new deleteSSHCredential());
processMap.put("deletePWDCredential", new deletePWDCredential());
@@ -1863,6 +1939,63 @@ public class CredentialStoreService {
}
}
+ public static class getAllGatewaySSHCredentialSummary<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllGatewaySSHCredentialSummary_args, List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>> {
+ public getAllGatewaySSHCredentialSummary() {
+ super("getAllGatewaySSHCredentialSummary");
+ }
+
+ public getAllGatewaySSHCredentialSummary_args getEmptyArgsInstance() {
+ return new getAllGatewaySSHCredentialSummary_args();
+ }
+
+ public AsyncMethodCallback<List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>>() {
+ public void onComplete(List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> o) {
+ getAllGatewaySSHCredentialSummary_result result = new getAllGatewaySSHCredentialSummary_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;
+ getAllGatewaySSHCredentialSummary_result result = new getAllGatewaySSHCredentialSummary_result();
+ if (e instanceof org.apache.airavata.credential.store.exception.CredentialStoreException) {
+ result.csException = (org.apache.airavata.credential.store.exception.CredentialStoreException) e;
+ result.setCsExceptionIsSet(true);
+ msg = result;
+ }
+ else
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, getAllGatewaySSHCredentialSummary_args args, org.apache.thrift.async.AsyncMethodCallback<List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>> resultHandler) throws TException {
+ iface.getAllGatewaySSHCredentialSummary(args.gatewayId,resultHandler);
+ }
+ }
+
public static class getAllPWDCredentialsForGateway<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllPWDCredentialsForGateway_args, Map<String,String>> {
public getAllPWDCredentialsForGateway() {
super("getAllPWDCredentialsForGateway");
@@ -10588,6 +10721,882 @@ public class CredentialStoreService {
}
+ public static class getAllGatewaySSHCredentialSummary_args implements org.apache.thrift.TBase<getAllGatewaySSHCredentialSummary_args, getAllGatewaySSHCredentialSummary_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGatewaySSHCredentialSummary_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGatewaySSHCredentialSummary_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 getAllGatewaySSHCredentialSummary_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getAllGatewaySSHCredentialSummary_argsTupleSchemeFactory());
+ }
+
+ public String gatewayId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ 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(getAllGatewaySSHCredentialSummary_args.class, metaDataMap);
+ }
+
+ public getAllGatewaySSHCredentialSummary_args() {
+ }
+
+ public getAllGatewaySSHCredentialSummary_args(
+ String gatewayId)
+ {
+ this();
+ this.gatewayId = gatewayId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getAllGatewaySSHCredentialSummary_args(getAllGatewaySSHCredentialSummary_args other) {
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ }
+
+ public getAllGatewaySSHCredentialSummary_args deepCopy() {
+ return new getAllGatewaySSHCredentialSummary_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.gatewayId = null;
+ }
+
+ public String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public getAllGatewaySSHCredentialSummary_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 getAllGatewaySSHCredentialSummary_args)
+ return this.equals((getAllGatewaySSHCredentialSummary_args)that);
+ return false;
+ }
+
+ public boolean equals(getAllGatewaySSHCredentialSummary_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(getAllGatewaySSHCredentialSummary_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("getAllGatewaySSHCredentialSummary_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 getAllGatewaySSHCredentialSummary_argsStandardSchemeFactory implements SchemeFactory {
+ public getAllGatewaySSHCredentialSummary_argsStandardScheme getScheme() {
+ return new getAllGatewaySSHCredentialSummary_argsStandardScheme();
+ }
+ }
+
+ private static class getAllGatewaySSHCredentialSummary_argsStandardScheme extends StandardScheme<getAllGatewaySSHCredentialSummary_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getAllGatewaySSHCredentialSummary_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, getAllGatewaySSHCredentialSummary_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 getAllGatewaySSHCredentialSummary_argsTupleSchemeFactory implements SchemeFactory {
+ public getAllGatewaySSHCredentialSummary_argsTupleScheme getScheme() {
+ return new getAllGatewaySSHCredentialSummary_argsTupleScheme();
+ }
+ }
+
+ private static class getAllGatewaySSHCredentialSummary_argsTupleScheme extends TupleScheme<getAllGatewaySSHCredentialSummary_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getAllGatewaySSHCredentialSummary_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, getAllGatewaySSHCredentialSummary_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ }
+ }
+
+ }
+
+ public static class getAllGatewaySSHCredentialSummary_result implements org.apache.thrift.TBase<getAllGatewaySSHCredentialSummary_result, getAllGatewaySSHCredentialSummary_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGatewaySSHCredentialSummary_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGatewaySSHCredentialSummary_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+ private static final org.apache.thrift.protocol.TField CS_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("csException", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getAllGatewaySSHCredentialSummary_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getAllGatewaySSHCredentialSummary_resultTupleSchemeFactory());
+ }
+
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> success; // required
+ public org.apache.airavata.credential.store.exception.CredentialStoreException csException; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success"),
+ CS_EXCEPTION((short)1, "csException");
+
+ 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;
+ case 1: // CS_EXCEPTION
+ return CS_EXCEPTION;
+ 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.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredentialSummary.class))));
+ tmpMap.put(_Fields.CS_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("csException", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllGatewaySSHCredentialSummary_result.class, metaDataMap);
+ }
+
+ public getAllGatewaySSHCredentialSummary_result() {
+ }
+
+ public getAllGatewaySSHCredentialSummary_result(
+ List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> success,
+ org.apache.airavata.credential.store.exception.CredentialStoreException csException)
+ {
+ this();
+ this.success = success;
+ this.csException = csException;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getAllGatewaySSHCredentialSummary_result(getAllGatewaySSHCredentialSummary_result other) {
+ if (other.isSetSuccess()) {
+ List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> __this__success = new ArrayList<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>(other.success.size());
+ for (org.apache.airavata.credential.store.datamodel.SSHCredentialSummary other_element : other.success) {
+ __this__success.add(new org.apache.airavata.credential.store.datamodel.SSHCredentialSummary(other_element));
+ }
+ this.success = __this__success;
+ }
+ if (other.isSetCsException()) {
+ this.csException = new org.apache.airavata.credential.store.exception.CredentialStoreException(other.csException);
+ }
+ }
+
+ public getAllGatewaySSHCredentialSummary_result deepCopy() {
+ return new getAllGatewaySSHCredentialSummary_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ this.csException = null;
+ }
+
+ public int getSuccessSize() {
+ return (this.success == null) ? 0 : this.success.size();
+ }
+
+ public java.util.Iterator<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getSuccessIterator() {
+ return (this.success == null) ? null : this.success.iterator();
+ }
+
+ public void addToSuccess(org.apache.airavata.credential.store.datamodel.SSHCredentialSummary elem) {
+ if (this.success == null) {
+ this.success = new ArrayList<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>();
+ }
+ this.success.add(elem);
+ }
+
+ public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getSuccess() {
+ return this.success;
+ }
+
+ public getAllGatewaySSHCredentialSummary_result setSuccess(List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> 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 org.apache.airavata.credential.store.exception.CredentialStoreException getCsException() {
+ return this.csException;
+ }
+
+ public getAllGatewaySSHCredentialSummary_result setCsException(org.apache.airavata.credential.store.exception.CredentialStoreException csException) {
+ this.csException = csException;
+ return this;
+ }
+
+ public void unsetCsException() {
+ this.csException = null;
+ }
+
+ /** Returns true if field csException is set (has been assigned a value) and false otherwise */
+ public boolean isSetCsException() {
+ return this.csException != null;
+ }
+
+ public void setCsExceptionIsSet(boolean value) {
+ if (!value) {
+ this.csException = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>)value);
+ }
+ break;
+
+ case CS_EXCEPTION:
+ if (value == null) {
+ unsetCsException();
+ } else {
+ setCsException((org.apache.airavata.credential.store.exception.CredentialStoreException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ case CS_EXCEPTION:
+ return getCsException();
+
+ }
+ 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();
+ case CS_EXCEPTION:
+ return isSetCsException();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getAllGatewaySSHCredentialSummary_result)
+ return this.equals((getAllGatewaySSHCredentialSummary_result)that);
+ return false;
+ }
+
+ public boolean equals(getAllGatewaySSHCredentialSummary_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;
+ }
+
+ boolean this_present_csException = true && this.isSetCsException();
+ boolean that_present_csException = true && that.isSetCsException();
+ if (this_present_csException || that_present_csException) {
+ if (!(this_present_csException && that_present_csException))
+ return false;
+ if (!this.csException.equals(that.csException))
+ 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);
+
+ boolean present_csException = true && (isSetCsException());
+ list.add(present_csException);
+ if (present_csException)
+ list.add(csException);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getAllGatewaySSHCredentialSummary_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;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetCsException()).compareTo(other.isSetCsException());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCsException()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csException, other.csException);
+ 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("getAllGatewaySSHCredentialSummary_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("csException:");
+ if (this.csException == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.csException);
+ }
+ 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 getAllGatewaySSHCredentialSummary_resultStandardSchemeFactory implements SchemeFactory {
+ public getAllGatewaySSHCredentialSummary_resultStandardScheme getScheme() {
+ return new getAllGatewaySSHCredentialSummary_resultStandardScheme();
+ }
+ }
+
+ private static class getAllGatewaySSHCredentialSummary_resultStandardScheme extends StandardScheme<getAllGatewaySSHCredentialSummary_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getAllGatewaySSHCredentialSummary_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.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
+ struct.success = new ArrayList<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>(_list20.size);
+ org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _elem21;
+ for (int _i22 = 0; _i22 < _list20.size; ++_i22)
+ {
+ _elem21 = new org.apache.airavata.credential.store.datamodel.SSHCredentialSummary();
+ _elem21.read(iprot);
+ struct.success.add(_elem21);
+ }
+ iprot.readListEnd();
+ }
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // CS_EXCEPTION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.csException = new org.apache.airavata.credential.store.exception.CredentialStoreException();
+ struct.csException.read(iprot);
+ struct.setCsExceptionIsSet(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, getAllGatewaySSHCredentialSummary_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+ for (org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _iter23 : struct.success)
+ {
+ _iter23.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.csException != null) {
+ oprot.writeFieldBegin(CS_EXCEPTION_FIELD_DESC);
+ struct.csException.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getAllGatewaySSHCredentialSummary_resultTupleSchemeFactory implements SchemeFactory {
+ public getAllGatewaySSHCredentialSummary_resultTupleScheme getScheme() {
+ return new getAllGatewaySSHCredentialSummary_resultTupleScheme();
+ }
+ }
+
+ private static class getAllGatewaySSHCredentialSummary_resultTupleScheme extends TupleScheme<getAllGatewaySSHCredentialSummary_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getAllGatewaySSHCredentialSummary_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetCsException()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSuccess()) {
+ {
+ oprot.writeI32(struct.success.size());
+ for (org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _iter24 : struct.success)
+ {
+ _iter24.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetCsException()) {
+ struct.csException.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getAllGatewaySSHCredentialSummary_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list25 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>(_list25.size);
+ org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _elem26;
+ for (int _i27 = 0; _i27 < _list25.size; ++_i27)
+ {
+ _elem26 = new org.apache.airavata.credential.store.datamodel.SSHCredentialSummary();
+ _elem26.read(iprot);
+ struct.success.add(_elem26);
+ }
+ }
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.csException = new org.apache.airavata.credential.store.exception.CredentialStoreException();
+ struct.csException.read(iprot);
+ struct.setCsExceptionIsSet(true);
+ }
+ }
+ }
+
+ }
+
public static class getAllPWDCredentialsForGateway_args implements org.apache.thrift.TBase<getAllPWDCredentialsForGateway_args, getAllPWDCredentialsForGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllPWDCredentialsForGateway_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPWDCredentialsForGateway_args");
@@ -11334,15 +12343,15 @@ public class CredentialStoreService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
- struct.success = new HashMap<String,String>(2*_map20.size);
- String _key21;
- String _val22;
- for (int _i23 = 0; _i23 < _map20.size; ++_i23)
+ org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
+ struct.success = new HashMap<String,String>(2*_map28.size);
+ String _key29;
+ String _val30;
+ for (int _i31 = 0; _i31 < _map28.size; ++_i31)
{
- _key21 = iprot.readString();
- _val22 = iprot.readString();
- struct.success.put(_key21, _val22);
+ _key29 = iprot.readString();
+ _val30 = iprot.readString();
+ struct.success.put(_key29, _val30);
}
iprot.readMapEnd();
}
@@ -11379,10 +12388,10 @@ public class CredentialStoreService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
- for (Map.Entry<String, String> _iter24 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter32 : struct.success.entrySet())
{
- oprot.writeString(_iter24.getKey());
- oprot.writeString(_iter24.getValue());
+ oprot.writeString(_iter32.getKey());
+ oprot.writeString(_iter32.getValue());
}
oprot.writeMapEnd();
}
@@ -11421,10 +12430,10 @@ public class CredentialStoreService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Map.Entry<String, String> _iter25 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter33 : struct.success.entrySet())
{
- oprot.writeString(_iter25.getKey());
- oprot.writeString(_iter25.getValue());
+ oprot.writeString(_iter33.getKey());
+ oprot.writeString(_iter33.getValue());
}
}
}
@@ -11439,15 +12448,15 @@ public class CredentialStoreService {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.success = new HashMap<String,String>(2*_map26.size);
- String _key27;
- String _val28;
- for (int _i29 = 0; _i29 < _map26.size; ++_i29)
+ org.apache.thrift.protocol.TMap _map34 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new HashMap<String,String>(2*_map34.size);
+ String _key35;
+ String _val36;
+ for (int _i37 = 0; _i37 < _map34.size; ++_i37)
{
- _key27 = iprot.readString();
- _val28 = iprot.readString();
- struct.success.put(_key27, _val28);
+ _key35 = iprot.readString();
+ _val36 = iprot.readString();
+ struct.success.put(_key35, _val36);
}
}
struct.setSuccessIsSet(true);