AIRAVATA-2500 Thrift stub code generation
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/e5dcade0 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/e5dcade0 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/e5dcade0 Branch: refs/heads/develop Commit: e5dcade08f7a91bf7bd135647358202475f37620 Parents: 20fc3fd Author: Marcus Christie <machris...@apache.org> Authored: Mon Sep 25 09:45:47 2017 -0400 Committer: Marcus Christie <machris...@apache.org> Committed: Mon Sep 25 09:57:28 2017 -0400 ---------------------------------------------------------------------- .../resources/lib/Airavata/API/Airavata.php | 10 ++ .../AppCatalog/UserResourceProfile/Types.php | 28 +++++ .../UserComputeResourcePreference.java | 114 ++++++++++++++++++- 3 files changed, 148 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php index c8976ba..a22ef84 100644 --- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php @@ -3485,6 +3485,11 @@ interface AiravataIf { * Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's * default credential store. * + * validated: + * If true the the configuration has been validated in the sense that the username and credential can be used to + * login to the remote host and the scratchLocation is a valid location that the user has permission to write to. + * Should be treated as read-only and only mutated by Airavata middleware. + * * * @throws \Airavata\API\Error\InvalidRequestException * @throws \Airavata\API\Error\AiravataClientException @@ -3717,6 +3722,11 @@ interface AiravataIf { * Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's * default credential store. * + * validated: + * If true the the configuration has been validated in the sense that the username and credential can be used to + * login to the remote host and the scratchLocation is a valid location that the user has permission to write to. + * Should be treated as read-only and only mutated by Airavata middleware. + * * * @throws \Airavata\API\Error\InvalidRequestException * @throws \Airavata\API\Error\AiravataClientException http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php index 8ab78a0..c4a0a9c 100644 --- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php @@ -43,6 +43,11 @@ use Thrift\Exception\TApplicationException; * Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's * default credential store. * + * validated: + * If true the the configuration has been validated in the sense that the username and credential can be used to + * login to the remote host and the scratchLocation is a valid location that the user has permission to write to. + * Should be treated as read-only and only mutated by Airavata middleware. + * */ class UserComputeResourcePreference { static $_TSPEC; @@ -87,6 +92,10 @@ class UserComputeResourcePreference { * @var int */ public $reservationEndTime = null; + /** + * @var bool + */ + public $validated = false; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -131,6 +140,10 @@ class UserComputeResourcePreference { 'var' => 'reservationEndTime', 'type' => TType::I64, ), + 11 => array( + 'var' => 'validated', + 'type' => TType::BOOL, + ), ); } if (is_array($vals)) { @@ -164,6 +177,9 @@ class UserComputeResourcePreference { if (isset($vals['reservationEndTime'])) { $this->reservationEndTime = $vals['reservationEndTime']; } + if (isset($vals['validated'])) { + $this->validated = $vals['validated']; + } } } @@ -256,6 +272,13 @@ class UserComputeResourcePreference { $xfer += $input->skip($ftype); } break; + case 11: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->validated); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -319,6 +342,11 @@ class UserComputeResourcePreference { $xfer += $output->writeI64($this->reservationEndTime); $xfer += $output->writeFieldEnd(); } + if ($this->validated !== null) { + $xfer += $output->writeFieldBegin('validated', TType::BOOL, 11); + $xfer += $output->writeBool($this->validated); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java index 276b7ca..674b5c3 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java @@ -77,6 +77,11 @@ import org.slf4j.LoggerFactory; * Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's * default credential store. * + * validated: + * If true the the configuration has been validated in the sense that the username and credential can be used to + * login to the remote host and the scratchLocation is a valid location that the user has permission to write to. + * Should be treated as read-only and only mutated by Airavata middleware. + * */ @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class UserComputeResourcePreference implements org.apache.thrift.TBase<UserComputeResourcePreference, UserComputeResourcePreference._Fields>, java.io.Serializable, Cloneable, Comparable<UserComputeResourcePreference> { @@ -92,6 +97,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us private static final org.apache.thrift.protocol.TField RESERVATION_FIELD_DESC = new org.apache.thrift.protocol.TField("reservation", org.apache.thrift.protocol.TType.STRING, (short)8); private static final org.apache.thrift.protocol.TField RESERVATION_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("reservationStartTime", org.apache.thrift.protocol.TType.I64, (short)9); private static final org.apache.thrift.protocol.TField RESERVATION_END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("reservationEndTime", org.apache.thrift.protocol.TType.I64, (short)10); + private static final org.apache.thrift.protocol.TField VALIDATED_FIELD_DESC = new org.apache.thrift.protocol.TField("validated", org.apache.thrift.protocol.TType.BOOL, (short)11); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -109,6 +115,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us private String reservation; // optional private long reservationStartTime; // optional private long reservationEndTime; // optional + private boolean validated; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -121,7 +128,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us QUALITY_OF_SERVICE((short)7, "qualityOfService"), RESERVATION((short)8, "reservation"), RESERVATION_START_TIME((short)9, "reservationStartTime"), - RESERVATION_END_TIME((short)10, "reservationEndTime"); + RESERVATION_END_TIME((short)10, "reservationEndTime"), + VALIDATED((short)11, "validated"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -156,6 +164,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us return RESERVATION_START_TIME; case 10: // RESERVATION_END_TIME return RESERVATION_END_TIME; + case 11: // VALIDATED + return VALIDATED; default: return null; } @@ -198,8 +208,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us // isset id assignments private static final int __RESERVATIONSTARTTIME_ISSET_ID = 0; private static final int __RESERVATIONENDTIME_ISSET_ID = 1; + private static final int __VALIDATED_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.PREFERRED_BATCH_QUEUE,_Fields.SCRATCH_LOCATION,_Fields.ALLOCATION_PROJECT_NUMBER,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN,_Fields.QUALITY_OF_SERVICE,_Fields.RESERVATION,_Fields.RESERVATION_START_TIME,_Fields.RESERVATION_END_TIME}; + private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.PREFERRED_BATCH_QUEUE,_Fields.SCRATCH_LOCATION,_Fields.ALLOCATION_PROJECT_NUMBER,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN,_Fields.QUALITY_OF_SERVICE,_Fields.RESERVATION,_Fields.RESERVATION_START_TIME,_Fields.RESERVATION_END_TIME,_Fields.VALIDATED}; 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); @@ -223,11 +234,15 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RESERVATION_END_TIME, new org.apache.thrift.meta_data.FieldMetaData("reservationEndTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.VALIDATED, new org.apache.thrift.meta_data.FieldMetaData("validated", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserComputeResourcePreference.class, metaDataMap); } public UserComputeResourcePreference() { + this.validated = false; + } public UserComputeResourcePreference( @@ -268,6 +283,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us } this.reservationStartTime = other.reservationStartTime; this.reservationEndTime = other.reservationEndTime; + this.validated = other.validated; } public UserComputeResourcePreference deepCopy() { @@ -288,6 +304,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us this.reservationStartTime = 0; setReservationEndTimeIsSet(false); this.reservationEndTime = 0; + this.validated = false; + } public String getComputeResourceId() { @@ -518,6 +536,28 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVATIONENDTIME_ISSET_ID, value); } + public boolean isValidated() { + return this.validated; + } + + public void setValidated(boolean validated) { + this.validated = validated; + setValidatedIsSet(true); + } + + public void unsetValidated() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALIDATED_ISSET_ID); + } + + /** Returns true if field validated is set (has been assigned a value) and false otherwise */ + public boolean isSetValidated() { + return EncodingUtils.testBit(__isset_bitfield, __VALIDATED_ISSET_ID); + } + + public void setValidatedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALIDATED_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case COMPUTE_RESOURCE_ID: @@ -600,6 +640,14 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us } break; + case VALIDATED: + if (value == null) { + unsetValidated(); + } else { + setValidated((Boolean)value); + } + break; + } } @@ -635,6 +683,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us case RESERVATION_END_TIME: return getReservationEndTime(); + case VALIDATED: + return isValidated(); + } throw new IllegalStateException(); } @@ -666,6 +717,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us return isSetReservationStartTime(); case RESERVATION_END_TIME: return isSetReservationEndTime(); + case VALIDATED: + return isSetValidated(); } throw new IllegalStateException(); } @@ -773,6 +826,15 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us return false; } + boolean this_present_validated = true && this.isSetValidated(); + boolean that_present_validated = true && that.isSetValidated(); + if (this_present_validated || that_present_validated) { + if (!(this_present_validated && that_present_validated)) + return false; + if (this.validated != that.validated) + return false; + } + return true; } @@ -830,6 +892,11 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us if (present_reservationEndTime) list.add(reservationEndTime); + boolean present_validated = true && (isSetValidated()); + list.add(present_validated); + if (present_validated) + list.add(validated); + return list.hashCode(); } @@ -941,6 +1008,16 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us return lastComparison; } } + lastComparison = Boolean.valueOf(isSetValidated()).compareTo(other.isSetValidated()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValidated()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validated, other.validated); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -1050,6 +1127,12 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us sb.append(this.reservationEndTime); first = false; } + if (isSetValidated()) { + if (!first) sb.append(", "); + sb.append("validated:"); + sb.append(this.validated); + first = false; + } sb.append(")"); return sb.toString(); } @@ -1179,6 +1262,14 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 11: // VALIDATED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.validated = iprot.readBool(); + struct.setValidatedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -1256,6 +1347,11 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us oprot.writeI64(struct.reservationEndTime); oprot.writeFieldEnd(); } + if (struct.isSetValidated()) { + oprot.writeFieldBegin(VALIDATED_FIELD_DESC); + oprot.writeBool(struct.validated); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1302,7 +1398,10 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us if (struct.isSetReservationEndTime()) { optionals.set(8); } - oprot.writeBitSet(optionals, 9); + if (struct.isSetValidated()) { + optionals.set(9); + } + oprot.writeBitSet(optionals, 10); if (struct.isSetLoginUserName()) { oprot.writeString(struct.loginUserName); } @@ -1330,6 +1429,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us if (struct.isSetReservationEndTime()) { oprot.writeI64(struct.reservationEndTime); } + if (struct.isSetValidated()) { + oprot.writeBool(struct.validated); + } } @Override @@ -1337,7 +1439,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us TTupleProtocol iprot = (TTupleProtocol) prot; struct.computeResourceId = iprot.readString(); struct.setComputeResourceIdIsSet(true); - BitSet incoming = iprot.readBitSet(9); + BitSet incoming = iprot.readBitSet(10); if (incoming.get(0)) { struct.loginUserName = iprot.readString(); struct.setLoginUserNameIsSet(true); @@ -1374,6 +1476,10 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us struct.reservationEndTime = iprot.readI64(); struct.setReservationEndTimeIsSet(true); } + if (incoming.get(9)) { + struct.validated = iprot.readBool(); + struct.setValidatedIsSet(true); + } } }