Repository: airavata Updated Branches: refs/heads/airavata-0.15-release-branch 842ec5412 -> 170c2e310
updating thrift generated files Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/170c2e31 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/170c2e31 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/170c2e31 Branch: refs/heads/airavata-0.15-release-branch Commit: 170c2e310e0e7e85bb537c4228d2d14584c120cd Parents: 842ec54 Author: Supun Nakandala <[email protected]> Authored: Thu Jul 16 20:19:26 2015 +0530 Committer: Supun Nakandala <[email protected]> Committed: Thu Jul 16 20:19:26 2015 +0530 ---------------------------------------------------------------------- .../store/cpi/CredentialStoreService.java | 1000 ++++++++++++++++++ 1 file changed, 1000 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/170c2e31/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 5d9c05c..a6da2ab 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 @@ -75,6 +75,8 @@ import org.slf4j.LoggerFactory; public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId, String gatewayId) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException; + public Map<String,String> getAllSSHKeysForUser(String username) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException; + } public interface AsyncIface { @@ -93,6 +95,8 @@ import org.slf4j.LoggerFactory; public void getPasswordCredential(String tokenId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getAllSSHKeysForUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -296,6 +300,32 @@ import org.slf4j.LoggerFactory; throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result"); } + public Map<String,String> getAllSSHKeysForUser(String username) throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException + { + send_getAllSSHKeysForUser(username); + return recv_getAllSSHKeysForUser(); + } + + public void send_getAllSSHKeysForUser(String username) throws org.apache.thrift.TException + { + getAllSSHKeysForUser_args args = new getAllSSHKeysForUser_args(); + args.setUsername(username); + sendBase("getAllSSHKeysForUser", args); + } + + public Map<String,String> recv_getAllSSHKeysForUser() throws org.apache.airavata.credential.store.exception.CredentialStoreException, org.apache.thrift.TException + { + getAllSSHKeysForUser_result result = new getAllSSHKeysForUser_result(); + receiveBase(result, "getAllSSHKeysForUser"); + 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, "getAllSSHKeysForUser failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { @@ -544,6 +574,38 @@ import org.slf4j.LoggerFactory; } } + public void getAllSSHKeysForUser(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllSSHKeysForUser_call method_call = new getAllSSHKeysForUser_call(username, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllSSHKeysForUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String username; + public getAllSSHKeysForUser_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.username = username; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllSSHKeysForUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllSSHKeysForUser_args args = new getAllSSHKeysForUser_args(); + args.setUsername(username); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map<String,String> 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_getAllSSHKeysForUser(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -564,6 +626,7 @@ import org.slf4j.LoggerFactory; processMap.put("getSSHCredential", new getSSHCredential()); processMap.put("getCertificateCredential", new getCertificateCredential()); processMap.put("getPasswordCredential", new getPasswordCredential()); + processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser()); return processMap; } @@ -731,6 +794,30 @@ import org.slf4j.LoggerFactory; } } + public static class getAllSSHKeysForUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllSSHKeysForUser_args> { + public getAllSSHKeysForUser() { + super("getAllSSHKeysForUser"); + } + + public getAllSSHKeysForUser_args getEmptyArgsInstance() { + return new getAllSSHKeysForUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllSSHKeysForUser_result getResult(I iface, getAllSSHKeysForUser_args args) throws org.apache.thrift.TException { + getAllSSHKeysForUser_result result = new getAllSSHKeysForUser_result(); + try { + result.success = iface.getAllSSHKeysForUser(args.username); + } catch (org.apache.airavata.credential.store.exception.CredentialStoreException csException) { + result.csException = csException; + } + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -751,6 +838,7 @@ import org.slf4j.LoggerFactory; processMap.put("getSSHCredential", new getSSHCredential()); processMap.put("getCertificateCredential", new getCertificateCredential()); processMap.put("getPasswordCredential", new getPasswordCredential()); + processMap.put("getAllSSHKeysForUser", new getAllSSHKeysForUser()); return processMap; } @@ -1147,6 +1235,63 @@ import org.slf4j.LoggerFactory; } } + public static class getAllSSHKeysForUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllSSHKeysForUser_args, Map<String,String>> { + public getAllSSHKeysForUser() { + super("getAllSSHKeysForUser"); + } + + public getAllSSHKeysForUser_args getEmptyArgsInstance() { + return new getAllSSHKeysForUser_args(); + } + + public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Map<String,String>>() { + public void onComplete(Map<String,String> o) { + getAllSSHKeysForUser_result result = new getAllSSHKeysForUser_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; + getAllSSHKeysForUser_result result = new getAllSSHKeysForUser_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, getAllSSHKeysForUser_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException { + iface.getAllSSHKeysForUser(args.username,resultHandler); + } + } + } public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args> { @@ -6885,4 +7030,859 @@ import org.slf4j.LoggerFactory; } + public static class getAllSSHKeysForUser_args implements org.apache.thrift.TBase<getAllSSHKeysForUser_args, getAllSSHKeysForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSSHKeysForUser_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSSHKeysForUser_args"); + + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllSSHKeysForUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllSSHKeysForUser_argsTupleSchemeFactory()); + } + + public String username; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + USERNAME((short)1, "username"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // USERNAME + return USERNAME; + 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.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllSSHKeysForUser_args.class, metaDataMap); + } + + public getAllSSHKeysForUser_args() { + } + + public getAllSSHKeysForUser_args( + String username) + { + this(); + this.username = username; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllSSHKeysForUser_args(getAllSSHKeysForUser_args other) { + if (other.isSetUsername()) { + this.username = other.username; + } + } + + public getAllSSHKeysForUser_args deepCopy() { + return new getAllSSHKeysForUser_args(this); + } + + @Override + public void clear() { + this.username = null; + } + + public String getUsername() { + return this.username; + } + + public getAllSSHKeysForUser_args setUsername(String username) { + this.username = username; + return this; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USERNAME: + return getUsername(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USERNAME: + return isSetUsername(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllSSHKeysForUser_args) + return this.equals((getAllSSHKeysForUser_args)that); + return false; + } + + public boolean equals(getAllSSHKeysForUser_args that) { + if (that == null) + return false; + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllSSHKeysForUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getAllSSHKeysForUser_args("); + boolean first = true; + + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (username == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getAllSSHKeysForUser_argsStandardSchemeFactory implements SchemeFactory { + public getAllSSHKeysForUser_argsStandardScheme getScheme() { + return new getAllSSHKeysForUser_argsStandardScheme(); + } + } + + private static class getAllSSHKeysForUser_argsStandardScheme extends StandardScheme<getAllSSHKeysForUser_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSSHKeysForUser_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: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getAllSSHKeysForUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.username != null) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllSSHKeysForUser_argsTupleSchemeFactory implements SchemeFactory { + public getAllSSHKeysForUser_argsTupleScheme getScheme() { + return new getAllSSHKeysForUser_argsTupleScheme(); + } + } + + private static class getAllSSHKeysForUser_argsTupleScheme extends TupleScheme<getAllSSHKeysForUser_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllSSHKeysForUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.username); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllSSHKeysForUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + } + + } + + public static class getAllSSHKeysForUser_result implements org.apache.thrift.TBase<getAllSSHKeysForUser_result, getAllSSHKeysForUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSSHKeysForUser_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSSHKeysForUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (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 getAllSSHKeysForUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllSSHKeysForUser_resultTupleSchemeFactory()); + } + + public Map<String,String> 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. */ + @SuppressWarnings("all") 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.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + 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(getAllSSHKeysForUser_result.class, metaDataMap); + } + + public getAllSSHKeysForUser_result() { + } + + public getAllSSHKeysForUser_result( + Map<String,String> 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 getAllSSHKeysForUser_result(getAllSSHKeysForUser_result other) { + if (other.isSetSuccess()) { + Map<String,String> __this__success = new HashMap<String,String>(other.success); + this.success = __this__success; + } + if (other.isSetCsException()) { + this.csException = new org.apache.airavata.credential.store.exception.CredentialStoreException(other.csException); + } + } + + public getAllSSHKeysForUser_result deepCopy() { + return new getAllSSHKeysForUser_result(this); + } + + @Override + public void clear() { + this.success = null; + this.csException = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, String val) { + if (this.success == null) { + this.success = new HashMap<String,String>(); + } + this.success.put(key, val); + } + + public Map<String,String> getSuccess() { + return this.success; + } + + public getAllSSHKeysForUser_result setSuccess(Map<String,String> success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public org.apache.airavata.credential.store.exception.CredentialStoreException getCsException() { + return this.csException; + } + + public getAllSSHKeysForUser_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((Map<String,String>)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 getAllSSHKeysForUser_result) + return this.equals((getAllSSHKeysForUser_result)that); + return false; + } + + public boolean equals(getAllSSHKeysForUser_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() { + return 0; + } + + @Override + public int compareTo(getAllSSHKeysForUser_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("getAllSSHKeysForUser_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 getAllSSHKeysForUser_resultStandardSchemeFactory implements SchemeFactory { + public getAllSSHKeysForUser_resultStandardScheme getScheme() { + return new getAllSSHKeysForUser_resultStandardScheme(); + } + } + + private static class getAllSSHKeysForUser_resultStandardScheme extends StandardScheme<getAllSSHKeysForUser_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSSHKeysForUser_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.MAP) { + { + org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); + struct.success = new HashMap<String,String>(2*_map0.size); + for (int _i1 = 0; _i1 < _map0.size; ++_i1) + { + String _key2; + String _val3; + _key2 = iprot.readString(); + _val3 = iprot.readString(); + struct.success.put(_key2, _val3); + } + iprot.readMapEnd(); + } + 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, getAllSSHKeysForUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + 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> _iter4 : struct.success.entrySet()) + { + oprot.writeString(_iter4.getKey()); + oprot.writeString(_iter4.getValue()); + } + oprot.writeMapEnd(); + } + 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 getAllSSHKeysForUser_resultTupleSchemeFactory implements SchemeFactory { + public getAllSSHKeysForUser_resultTupleScheme getScheme() { + return new getAllSSHKeysForUser_resultTupleScheme(); + } + } + + private static class getAllSSHKeysForUser_resultTupleScheme extends TupleScheme<getAllSSHKeysForUser_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllSSHKeysForUser_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 (Map.Entry<String, String> _iter5 : struct.success.entrySet()) + { + oprot.writeString(_iter5.getKey()); + oprot.writeString(_iter5.getValue()); + } + } + } + if (struct.isSetCsException()) { + struct.csException.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllSSHKeysForUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map6 = 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*_map6.size); + for (int _i7 = 0; _i7 < _map6.size; ++_i7) + { + String _key8; + String _val9; + _key8 = iprot.readString(); + _val9 = iprot.readString(); + struct.success.put(_key8, _val9); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.csException = new org.apache.airavata.credential.store.exception.CredentialStoreException(); + struct.csException.read(iprot); + struct.setCsExceptionIsSet(true); + } + } + } + + } + }
