Adding getAllSSHKeyForUsersInGateway and removing dates in auto gen files
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/ac769369 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/ac769369 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/ac769369 Branch: refs/heads/airavata-gov-registry Commit: ac769369bb3b5c42d28ee0bc96b3fbfe251f8474 Parents: d8c17d9 Author: Anuj Bhandar <bhandar.a...@gmail.com> Authored: Wed Oct 12 12:53:56 2016 -0400 Committer: Anuj Bhandar <bhandar.a...@gmail.com> Committed: Wed Oct 12 12:53:56 2016 -0400 ---------------------------------------------------------------------- .../server/CredentialStoreServerHandler.java | 35 + .../store/cpi/CredentialStoreService.java | 1200 +++++++++++++++++- .../store/datamodel/CertificateCredential.java | 27 +- .../store/datamodel/CommunityUser.java | 26 +- .../store/datamodel/PasswordCredential.java | 27 +- .../store/datamodel/SSHCredential.java | 27 +- .../store/datamodel/SSHCredentialSummary.java | 27 +- .../exception/CredentialStoreException.java | 2 +- .../component-cpis/credential-store-cpi.thrift | 2 + 9 files changed, 1231 insertions(+), 142 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/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 e8d0ef2..4914395 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 @@ -340,6 +340,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac sshCredentialSummary.setUsername(sshCredential.getPortalUserName()); sshCredentialSummary.setGatewayId(sshCredential.getGateway()); sshCredentialSummary.setDescription(sshCredential.getDescription()); + sshCredentialSummary.setPublicKey(new String(sshCredential.getPublicKey())); summaryList.add(sshCredentialSummary); } } @@ -352,6 +353,40 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac } @Override + public List<SSHCredentialSummary> getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId) 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.getAllCredentials(); + 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; + String portalUserName = sshCredential.getPortalUserName(); + String gateway = sshCredential.getGateway(); + if (portalUserName != null && gateway != null){ + if (portalUserName.equals(userId) && gateway.equals(gatewayId)) { + org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential sshCredentialKey = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential; + SSHCredentialSummary sshCredentialSummary = new SSHCredentialSummary(); + sshCredentialSummary.setToken(sshCredentialKey.getToken()); + sshCredentialSummary.setUsername(sshCredentialKey.getPortalUserName()); + sshCredentialSummary.setGatewayId(sshCredentialKey.getGateway()); + sshCredentialSummary.setDescription(sshCredentialKey.getDescription()); + sshCredentialSummary.setPublicKey(new String(sshCredentialKey.getPublicKey())); + 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/ac769369/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 93e088c..1686c76 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,23 +22,35 @@ */ 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.server.AbstractNonblockingServer.AsyncFrameBuffer; +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; -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") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class CredentialStoreService { public interface Iface { @@ -74,6 +86,8 @@ public class CredentialStoreService { 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 List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId) 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; @@ -106,6 +120,8 @@ public class CredentialStoreService { public void getAllGatewaySSHCredentialSummary(String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId, 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; @@ -420,6 +436,33 @@ public class CredentialStoreService { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllGatewaySSHCredentialSummary failed: unknown result"); } + public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException + { + send_getAllSSHCredentialSummaryForUserInGateway(gatewayId, userId); + return recv_getAllSSHCredentialSummaryForUserInGateway(); + } + + public void send_getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId) throws org.apache.thrift.TException + { + getAllSSHCredentialSummaryForUserInGateway_args args = new getAllSSHCredentialSummaryForUserInGateway_args(); + args.setGatewayId(gatewayId); + args.setUserId(userId); + sendBase("getAllSSHCredentialSummaryForUserInGateway", args); + } + + public List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary> recv_getAllSSHCredentialSummaryForUserInGateway() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException + { + getAllSSHCredentialSummaryForUserInGateway_result result = new getAllSSHCredentialSummaryForUserInGateway_result(); + receiveBase(result, "getAllSSHCredentialSummaryForUserInGateway"); + 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, "getAllSSHCredentialSummaryForUserInGateway 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); @@ -879,6 +922,41 @@ public class CredentialStoreService { } } + public void getAllSSHCredentialSummaryForUserInGateway(String gatewayId, String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllSSHCredentialSummaryForUserInGateway_call method_call = new getAllSSHCredentialSummaryForUserInGateway_call(gatewayId, userId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllSSHCredentialSummaryForUserInGateway_call extends org.apache.thrift.async.TAsyncMethodCall { + private String gatewayId; + private String userId; + public getAllSSHCredentialSummaryForUserInGateway_call(String gatewayId, String userId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.gatewayId = gatewayId; + this.userId = userId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllSSHCredentialSummaryForUserInGateway", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllSSHCredentialSummaryForUserInGateway_args args = new getAllSSHCredentialSummaryForUserInGateway_args(); + args.setGatewayId(gatewayId); + args.setUserId(userId); + 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_getAllSSHCredentialSummaryForUserInGateway(); + } + } + 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); @@ -1005,6 +1083,7 @@ public class CredentialStoreService { processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser()); processMap.put("getAllSSHKeysForGateway", new getAllSSHKeysForGateway()); processMap.put("getAllGatewaySSHCredentialSummary", new getAllGatewaySSHCredentialSummary()); + processMap.put("getAllSSHCredentialSummaryForUserInGateway", new getAllSSHCredentialSummaryForUserInGateway()); processMap.put("getAllPWDCredentialsForGateway", new getAllPWDCredentialsForGateway()); processMap.put("deleteSSHCredential", new deleteSSHCredential()); processMap.put("deletePWDCredential", new deletePWDCredential()); @@ -1271,6 +1350,30 @@ public class CredentialStoreService { } } + public static class getAllSSHCredentialSummaryForUserInGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllSSHCredentialSummaryForUserInGateway_args> { + public getAllSSHCredentialSummaryForUserInGateway() { + super("getAllSSHCredentialSummaryForUserInGateway"); + } + + public getAllSSHCredentialSummaryForUserInGateway_args getEmptyArgsInstance() { + return new getAllSSHCredentialSummaryForUserInGateway_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllSSHCredentialSummaryForUserInGateway_result getResult(I iface, getAllSSHCredentialSummaryForUserInGateway_args args) throws org.apache.thrift.TException { + getAllSSHCredentialSummaryForUserInGateway_result result = new getAllSSHCredentialSummaryForUserInGateway_result(); + try { + result.success = iface.getAllSSHCredentialSummaryForUserInGateway(args.gatewayId, args.userId); + } 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"); @@ -1369,6 +1472,7 @@ public class CredentialStoreService { processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser()); processMap.put("getAllSSHKeysForGateway", new getAllSSHKeysForGateway()); processMap.put("getAllGatewaySSHCredentialSummary", new getAllGatewaySSHCredentialSummary()); + processMap.put("getAllSSHCredentialSummaryForUserInGateway", new getAllSSHCredentialSummaryForUserInGateway()); processMap.put("getAllPWDCredentialsForGateway", new getAllPWDCredentialsForGateway()); processMap.put("deleteSSHCredential", new deleteSSHCredential()); processMap.put("deletePWDCredential", new deletePWDCredential()); @@ -1996,6 +2100,63 @@ public class CredentialStoreService { } } + public static class getAllSSHCredentialSummaryForUserInGateway<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllSSHCredentialSummaryForUserInGateway_args, List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>> { + public getAllSSHCredentialSummaryForUserInGateway() { + super("getAllSSHCredentialSummaryForUserInGateway"); + } + + public getAllSSHCredentialSummaryForUserInGateway_args getEmptyArgsInstance() { + return new getAllSSHCredentialSummaryForUserInGateway_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) { + getAllSSHCredentialSummaryForUserInGateway_result result = new getAllSSHCredentialSummaryForUserInGateway_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; + getAllSSHCredentialSummaryForUserInGateway_result result = new getAllSSHCredentialSummaryForUserInGateway_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, getAllSSHCredentialSummaryForUserInGateway_args args, org.apache.thrift.async.AsyncMethodCallback<List<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>> resultHandler) throws TException { + iface.getAllSSHCredentialSummaryForUserInGateway(args.gatewayId, args.userId,resultHandler); + } + } + public static class getAllPWDCredentialsForGateway<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllPWDCredentialsForGateway_args, Map<String,String>> { public getAllPWDCredentialsForGateway() { super("getAllPWDCredentialsForGateway"); @@ -11597,6 +11758,983 @@ public class CredentialStoreService { } + public static class getAllSSHCredentialSummaryForUserInGateway_args implements org.apache.thrift.TBase<getAllSSHCredentialSummaryForUserInGateway_args, getAllSSHCredentialSummaryForUserInGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSSHCredentialSummaryForUserInGateway_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSSHCredentialSummaryForUserInGateway_args"); + + private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllSSHCredentialSummaryForUserInGateway_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllSSHCredentialSummaryForUserInGateway_argsTupleSchemeFactory()); + } + + public String gatewayId; // required + public String userId; // 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"), + USER_ID((short)2, "userId"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // GATEWAY_ID + return GATEWAY_ID; + case 2: // USER_ID + return USER_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))); + tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", 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(getAllSSHCredentialSummaryForUserInGateway_args.class, metaDataMap); + } + + public getAllSSHCredentialSummaryForUserInGateway_args() { + } + + public getAllSSHCredentialSummaryForUserInGateway_args( + String gatewayId, + String userId) + { + this(); + this.gatewayId = gatewayId; + this.userId = userId; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllSSHCredentialSummaryForUserInGateway_args(getAllSSHCredentialSummaryForUserInGateway_args other) { + if (other.isSetGatewayId()) { + this.gatewayId = other.gatewayId; + } + if (other.isSetUserId()) { + this.userId = other.userId; + } + } + + public getAllSSHCredentialSummaryForUserInGateway_args deepCopy() { + return new getAllSSHCredentialSummaryForUserInGateway_args(this); + } + + @Override + public void clear() { + this.gatewayId = null; + this.userId = null; + } + + public String getGatewayId() { + return this.gatewayId; + } + + public getAllSSHCredentialSummaryForUserInGateway_args setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + return this; + } + + public void unsetGatewayId() { + this.gatewayId = null; + } + + /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */ + public boolean isSetGatewayId() { + return this.gatewayId != null; + } + + public void setGatewayIdIsSet(boolean value) { + if (!value) { + this.gatewayId = null; + } + } + + public String getUserId() { + return this.userId; + } + + public getAllSSHCredentialSummaryForUserInGateway_args setUserId(String userId) { + this.userId = userId; + return this; + } + + public void unsetUserId() { + this.userId = null; + } + + /** Returns true if field userId is set (has been assigned a value) and false otherwise */ + public boolean isSetUserId() { + return this.userId != null; + } + + public void setUserIdIsSet(boolean value) { + if (!value) { + this.userId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case GATEWAY_ID: + if (value == null) { + unsetGatewayId(); + } else { + setGatewayId((String)value); + } + break; + + case USER_ID: + if (value == null) { + unsetUserId(); + } else { + setUserId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case GATEWAY_ID: + return getGatewayId(); + + case USER_ID: + return getUserId(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case GATEWAY_ID: + return isSetGatewayId(); + case USER_ID: + return isSetUserId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllSSHCredentialSummaryForUserInGateway_args) + return this.equals((getAllSSHCredentialSummaryForUserInGateway_args)that); + return false; + } + + public boolean equals(getAllSSHCredentialSummaryForUserInGateway_args that) { + if (that == null) + return false; + + boolean this_present_gatewayId = true && this.isSetGatewayId(); + boolean that_present_gatewayId = true && that.isSetGatewayId(); + if (this_present_gatewayId || that_present_gatewayId) { + if (!(this_present_gatewayId && that_present_gatewayId)) + return false; + if (!this.gatewayId.equals(that.gatewayId)) + return false; + } + + boolean this_present_userId = true && this.isSetUserId(); + boolean that_present_userId = true && that.isSetUserId(); + if (this_present_userId || that_present_userId) { + if (!(this_present_userId && that_present_userId)) + return false; + if (!this.userId.equals(that.userId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_gatewayId = true && (isSetGatewayId()); + list.add(present_gatewayId); + if (present_gatewayId) + list.add(gatewayId); + + boolean present_userId = true && (isSetUserId()); + list.add(present_userId); + if (present_userId) + list.add(userId); + + return list.hashCode(); + } + + @Override + public int compareTo(getAllSSHCredentialSummaryForUserInGateway_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGatewayId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId); + 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("getAllSSHCredentialSummaryForUserInGateway_args("); + boolean first = true; + + sb.append("gatewayId:"); + if (this.gatewayId == null) { + sb.append("null"); + } else { + sb.append(this.gatewayId); + } + first = false; + if (!first) sb.append(", "); + sb.append("userId:"); + if (this.userId == null) { + sb.append("null"); + } else { + sb.append(this.userId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (gatewayId == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString()); + } + if (userId == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'userId' 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 getAllSSHCredentialSummaryForUserInGateway_argsStandardSchemeFactory implements SchemeFactory { + public getAllSSHCredentialSummaryForUserInGateway_argsStandardScheme getScheme() { + return new getAllSSHCredentialSummaryForUserInGateway_argsStandardScheme(); + } + } + + private static class getAllSSHCredentialSummaryForUserInGateway_argsStandardScheme extends StandardScheme<getAllSSHCredentialSummaryForUserInGateway_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSSHCredentialSummaryForUserInGateway_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // GATEWAY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.gatewayId = iprot.readString(); + struct.setGatewayIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userId = iprot.readString(); + struct.setUserIdIsSet(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, getAllSSHCredentialSummaryForUserInGateway_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.gatewayId != null) { + oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC); + oprot.writeString(struct.gatewayId); + oprot.writeFieldEnd(); + } + if (struct.userId != null) { + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeString(struct.userId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllSSHCredentialSummaryForUserInGateway_argsTupleSchemeFactory implements SchemeFactory { + public getAllSSHCredentialSummaryForUserInGateway_argsTupleScheme getScheme() { + return new getAllSSHCredentialSummaryForUserInGateway_argsTupleScheme(); + } + } + + private static class getAllSSHCredentialSummaryForUserInGateway_argsTupleScheme extends TupleScheme<getAllSSHCredentialSummaryForUserInGateway_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllSSHCredentialSummaryForUserInGateway_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.gatewayId); + oprot.writeString(struct.userId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllSSHCredentialSummaryForUserInGateway_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.gatewayId = iprot.readString(); + struct.setGatewayIdIsSet(true); + struct.userId = iprot.readString(); + struct.setUserIdIsSet(true); + } + } + + } + + public static class getAllSSHCredentialSummaryForUserInGateway_result implements org.apache.thrift.TBase<getAllSSHCredentialSummaryForUserInGateway_result, getAllSSHCredentialSummaryForUserInGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSSHCredentialSummaryForUserInGateway_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllSSHCredentialSummaryForUserInGateway_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(getAllSSHCredentialSummaryForUserInGateway_result.class, metaDataMap); + } + + public getAllSSHCredentialSummaryForUserInGateway_result() { + } + + public getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_result(getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_result deepCopy() { + return new getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_result) + return this.equals((getAllSSHCredentialSummaryForUserInGateway_result)that); + return false; + } + + public boolean equals(getAllSSHCredentialSummaryForUserInGateway_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(getAllSSHCredentialSummaryForUserInGateway_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("getAllSSHCredentialSummaryForUserInGateway_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 getAllSSHCredentialSummaryForUserInGateway_resultStandardSchemeFactory implements SchemeFactory { + public getAllSSHCredentialSummaryForUserInGateway_resultStandardScheme getScheme() { + return new getAllSSHCredentialSummaryForUserInGateway_resultStandardScheme(); + } + } + + private static class getAllSSHCredentialSummaryForUserInGateway_resultStandardScheme extends StandardScheme<getAllSSHCredentialSummaryForUserInGateway_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSSHCredentialSummaryForUserInGateway_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 _list28 = iprot.readListBegin(); + struct.success = new ArrayList<org.apache.airavata.credential.store.datamodel.SSHCredentialSummary>(_list28.size); + org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _elem29; + for (int _i30 = 0; _i30 < _list28.size; ++_i30) + { + _elem29 = new org.apache.airavata.credential.store.datamodel.SSHCredentialSummary(); + _elem29.read(iprot); + struct.success.add(_elem29); + } + 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, getAllSSHCredentialSummaryForUserInGateway_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 _iter31 : struct.success) + { + _iter31.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 getAllSSHCredentialSummaryForUserInGateway_resultTupleSchemeFactory implements SchemeFactory { + public getAllSSHCredentialSummaryForUserInGateway_resultTupleScheme getScheme() { + return new getAllSSHCredentialSummaryForUserInGateway_resultTupleScheme(); + } + } + + private static class getAllSSHCredentialSummaryForUserInGateway_resultTupleScheme extends TupleScheme<getAllSSHCredentialSummaryForUserInGateway_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllSSHCredentialSummaryForUserInGateway_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 _iter32 : struct.success) + { + _iter32.write(oprot); + } + } + } + if (struct.isSetCsException()) { + struct.csException.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllSSHCredentialSummaryForUserInGateway_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 _list33 = 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>(_list33.size); + org.apache.airavata.credential.store.datamodel.SSHCredentialSummary _elem34; + for (int _i35 = 0; _i35 < _list33.size; ++_i35) + { + _elem34 = new org.apache.airavata.credential.store.datamodel.SSHCredentialSummary(); + _elem34.read(iprot); + struct.success.add(_elem34); + } + } + 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"); @@ -12343,15 +13481,15 @@ public class CredentialStoreService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - 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) + org.apache.thrift.protocol.TMap _map36 = iprot.readMapBegin(); + struct.success = new HashMap<String,String>(2*_map36.size); + String _key37; + String _val38; + for (int _i39 = 0; _i39 < _map36.size; ++_i39) { - _key29 = iprot.readString(); - _val30 = iprot.readString(); - struct.success.put(_key29, _val30); + _key37 = iprot.readString(); + _val38 = iprot.readString(); + struct.success.put(_key37, _val38); } iprot.readMapEnd(); } @@ -12388,10 +13526,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> _iter32 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter40 : struct.success.entrySet()) { - oprot.writeString(_iter32.getKey()); - oprot.writeString(_iter32.getValue()); + oprot.writeString(_iter40.getKey()); + oprot.writeString(_iter40.getValue()); } oprot.writeMapEnd(); } @@ -12430,10 +13568,10 @@ public class CredentialStoreService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, String> _iter33 : struct.success.entrySet()) + for (Map.Entry<String, String> _iter41 : struct.success.entrySet()) { - oprot.writeString(_iter33.getKey()); - oprot.writeString(_iter33.getValue()); + oprot.writeString(_iter41.getKey()); + oprot.writeString(_iter41.getValue()); } } } @@ -12448,15 +13586,15 @@ public class CredentialStoreService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - 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) + org.apache.thrift.protocol.TMap _map42 = 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*_map42.size); + String _key43; + String _val44; + for (int _i45 = 0; _i45 < _map42.size; ++_i45) { - _key35 = iprot.readString(); - _val36 = iprot.readString(); - struct.success.put(_key35, _val36); + _key43 = iprot.readString(); + _val44 = iprot.readString(); + struct.success.put(_key43, _val44); } } struct.setSuccessIsSet(true); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java index b41a4ad..76232b0 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java @@ -22,35 +22,18 @@ */ package org.apache.airavata.credential.store.datamodel; +import org.apache.thrift.EncodingUtils; +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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java index f963726..8b1b3fa 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java @@ -22,35 +22,17 @@ */ package org.apache.airavata.credential.store.datamodel; +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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java index 6710c96..4eab7f4 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java @@ -22,35 +22,18 @@ */ package org.apache.airavata.credential.store.datamodel; +import org.apache.thrift.EncodingUtils; +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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java index b7ba8b4..0c3fee1 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java @@ -22,35 +22,18 @@ */ package org.apache.airavata.credential.store.datamodel; +import org.apache.thrift.EncodingUtils; +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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredentialSummary.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredentialSummary.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredentialSummary.java index 624fc0b..85b1a6a 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredentialSummary.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredentialSummary.java @@ -22,35 +22,18 @@ */ package org.apache.airavata.credential.store.datamodel; +import org.apache.thrift.EncodingUtils; +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.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class SSHCredentialSummary implements org.apache.thrift.TBase<SSHCredentialSummary, SSHCredentialSummary._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredentialSummary> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredentialSummary"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java index b55c84e..9d9bb50 100644 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java +++ b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/exception/CredentialStoreException.java @@ -50,7 +50,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-10") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-12") public class CredentialStoreException extends TException implements org.apache.thrift.TBase<CredentialStoreException, CredentialStoreException._Fields>, java.io.Serializable, Cloneable, Comparable<CredentialStoreException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CredentialStoreException"); http://git-wip-us.apache.org/repos/asf/airavata/blob/ac769369/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift index 915804f..36e7980 100644 --- a/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift +++ b/thrift-interface-descriptions/component-cpis/credential-store-cpi.thrift @@ -65,6 +65,8 @@ service CredentialStoreService { list<credential_store_data_models.SSHCredentialSummary> getAllGatewaySSHCredentialSummary (1: required string gatewayId) throws (1:credential_store_errors.CredentialStoreException csException); + list<credential_store_data_models.SSHCredentialSummary> getAllSSHCredentialSummaryForUserInGateway (1: required string gatewayId, 2: required string userId) throws (1:credential_store_errors.CredentialStoreException csException); + map<string,string> getAllPWDCredentialsForGateway (1: required string gatewayId) throws (1:credential_store_errors.CredentialStoreException csException); bool deleteSSHCredential(1: required string tokenId, 2: required string gatewayId) throws (1:credential_store_errors.CredentialStoreException csException);