You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/07/03 22:13:50 UTC
[02/10] Committed generated classes for thrift models - AIRAVATA-1203
http://git-wip-us.apache.org/repos/asf/airavata/blob/59a7443a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SSHJobSubmission.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SSHJobSubmission.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SSHJobSubmission.java
new file mode 100644
index 0000000..c906089
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SSHJobSubmission.java
@@ -0,0 +1,929 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.appcatalog.computeresource;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Authenticate using Secured Shell
+ *
+ * alternativeSSHHostName:
+ * If the login to ssh is different than the hostname itself, specify it here
+ *
+ * sshPort:
+ * If a non-defualt port needs to used, specify it.
+ */
+@SuppressWarnings("all") public class SSHJobSubmission implements org.apache.thrift.TBase<SSHJobSubmission, SSHJobSubmission._Fields>, java.io.Serializable, Cloneable, Comparable<SSHJobSubmission> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHJobSubmission");
+
+ private static final org.apache.thrift.protocol.TField JOB_SUBMISSION_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobSubmissionInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField SECURITY_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("securityProtocol", org.apache.thrift.protocol.TType.I32, (short)2);
+ private static final org.apache.thrift.protocol.TField RESOURCE_JOB_MANAGER_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceJobManager", org.apache.thrift.protocol.TType.I32, (short)3);
+ private static final org.apache.thrift.protocol.TField ALTERNATIVE_SSHHOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("alternativeSSHHostName", org.apache.thrift.protocol.TType.STRING, (short)4);
+ private static final org.apache.thrift.protocol.TField SSH_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sshPort", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField MONITORING_MECHANISM_FIELD_DESC = new org.apache.thrift.protocol.TField("monitoringMechanism", org.apache.thrift.protocol.TType.STRING, (short)6);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new SSHJobSubmissionStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new SSHJobSubmissionTupleSchemeFactory());
+ }
+
+ private String jobSubmissionInterfaceId; // required
+ private SecurityProtocol securityProtocol; // required
+ private ResourceJobManager resourceJobManager; // required
+ private String alternativeSSHHostName; // optional
+ private int sshPort; // optional
+ private String monitoringMechanism; // optional
+
+ /** 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 {
+ JOB_SUBMISSION_INTERFACE_ID((short)1, "jobSubmissionInterfaceId"),
+ /**
+ *
+ * @see SecurityProtocol
+ */
+ SECURITY_PROTOCOL((short)2, "securityProtocol"),
+ /**
+ *
+ * @see ResourceJobManager
+ */
+ RESOURCE_JOB_MANAGER((short)3, "resourceJobManager"),
+ ALTERNATIVE_SSHHOST_NAME((short)4, "alternativeSSHHostName"),
+ SSH_PORT((short)5, "sshPort"),
+ MONITORING_MECHANISM((short)6, "monitoringMechanism");
+
+ 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: // JOB_SUBMISSION_INTERFACE_ID
+ return JOB_SUBMISSION_INTERFACE_ID;
+ case 2: // SECURITY_PROTOCOL
+ return SECURITY_PROTOCOL;
+ case 3: // RESOURCE_JOB_MANAGER
+ return RESOURCE_JOB_MANAGER;
+ case 4: // ALTERNATIVE_SSHHOST_NAME
+ return ALTERNATIVE_SSHHOST_NAME;
+ case 5: // SSH_PORT
+ return SSH_PORT;
+ case 6: // MONITORING_MECHANISM
+ return MONITORING_MECHANISM;
+ 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
+ private static final int __SSHPORT_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.ALTERNATIVE_SSHHOST_NAME,_Fields.SSH_PORT,_Fields.MONITORING_MECHANISM};
+ 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.JOB_SUBMISSION_INTERFACE_ID, new org.apache.thrift.meta_data.FieldMetaData("jobSubmissionInterfaceId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.SECURITY_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("securityProtocol", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SecurityProtocol.class)));
+ tmpMap.put(_Fields.RESOURCE_JOB_MANAGER, new org.apache.thrift.meta_data.FieldMetaData("resourceJobManager", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ResourceJobManager.class)));
+ tmpMap.put(_Fields.ALTERNATIVE_SSHHOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("alternativeSSHHostName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.SSH_PORT, new org.apache.thrift.meta_data.FieldMetaData("sshPort", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.MONITORING_MECHANISM, new org.apache.thrift.meta_data.FieldMetaData("monitoringMechanism", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SSHJobSubmission.class, metaDataMap);
+ }
+
+ public SSHJobSubmission() {
+ this.jobSubmissionInterfaceId = "DO_NOT_SET_AT_CLIENTS";
+
+ this.sshPort = 22;
+
+ }
+
+ public SSHJobSubmission(
+ String jobSubmissionInterfaceId,
+ SecurityProtocol securityProtocol,
+ ResourceJobManager resourceJobManager)
+ {
+ this();
+ this.jobSubmissionInterfaceId = jobSubmissionInterfaceId;
+ this.securityProtocol = securityProtocol;
+ this.resourceJobManager = resourceJobManager;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public SSHJobSubmission(SSHJobSubmission other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetJobSubmissionInterfaceId()) {
+ this.jobSubmissionInterfaceId = other.jobSubmissionInterfaceId;
+ }
+ if (other.isSetSecurityProtocol()) {
+ this.securityProtocol = other.securityProtocol;
+ }
+ if (other.isSetResourceJobManager()) {
+ this.resourceJobManager = other.resourceJobManager;
+ }
+ if (other.isSetAlternativeSSHHostName()) {
+ this.alternativeSSHHostName = other.alternativeSSHHostName;
+ }
+ this.sshPort = other.sshPort;
+ if (other.isSetMonitoringMechanism()) {
+ this.monitoringMechanism = other.monitoringMechanism;
+ }
+ }
+
+ public SSHJobSubmission deepCopy() {
+ return new SSHJobSubmission(this);
+ }
+
+ @Override
+ public void clear() {
+ this.jobSubmissionInterfaceId = "DO_NOT_SET_AT_CLIENTS";
+
+ this.securityProtocol = null;
+ this.resourceJobManager = null;
+ this.alternativeSSHHostName = null;
+ this.sshPort = 22;
+
+ this.monitoringMechanism = null;
+ }
+
+ public String getJobSubmissionInterfaceId() {
+ return this.jobSubmissionInterfaceId;
+ }
+
+ public void setJobSubmissionInterfaceId(String jobSubmissionInterfaceId) {
+ this.jobSubmissionInterfaceId = jobSubmissionInterfaceId;
+ }
+
+ public void unsetJobSubmissionInterfaceId() {
+ this.jobSubmissionInterfaceId = null;
+ }
+
+ /** Returns true if field jobSubmissionInterfaceId is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobSubmissionInterfaceId() {
+ return this.jobSubmissionInterfaceId != null;
+ }
+
+ public void setJobSubmissionInterfaceIdIsSet(boolean value) {
+ if (!value) {
+ this.jobSubmissionInterfaceId = null;
+ }
+ }
+
+ /**
+ *
+ * @see SecurityProtocol
+ */
+ public SecurityProtocol getSecurityProtocol() {
+ return this.securityProtocol;
+ }
+
+ /**
+ *
+ * @see SecurityProtocol
+ */
+ public void setSecurityProtocol(SecurityProtocol securityProtocol) {
+ this.securityProtocol = securityProtocol;
+ }
+
+ public void unsetSecurityProtocol() {
+ this.securityProtocol = null;
+ }
+
+ /** Returns true if field securityProtocol is set (has been assigned a value) and false otherwise */
+ public boolean isSetSecurityProtocol() {
+ return this.securityProtocol != null;
+ }
+
+ public void setSecurityProtocolIsSet(boolean value) {
+ if (!value) {
+ this.securityProtocol = null;
+ }
+ }
+
+ /**
+ *
+ * @see ResourceJobManager
+ */
+ public ResourceJobManager getResourceJobManager() {
+ return this.resourceJobManager;
+ }
+
+ /**
+ *
+ * @see ResourceJobManager
+ */
+ public void setResourceJobManager(ResourceJobManager resourceJobManager) {
+ this.resourceJobManager = resourceJobManager;
+ }
+
+ public void unsetResourceJobManager() {
+ this.resourceJobManager = null;
+ }
+
+ /** Returns true if field resourceJobManager is set (has been assigned a value) and false otherwise */
+ public boolean isSetResourceJobManager() {
+ return this.resourceJobManager != null;
+ }
+
+ public void setResourceJobManagerIsSet(boolean value) {
+ if (!value) {
+ this.resourceJobManager = null;
+ }
+ }
+
+ public String getAlternativeSSHHostName() {
+ return this.alternativeSSHHostName;
+ }
+
+ public void setAlternativeSSHHostName(String alternativeSSHHostName) {
+ this.alternativeSSHHostName = alternativeSSHHostName;
+ }
+
+ public void unsetAlternativeSSHHostName() {
+ this.alternativeSSHHostName = null;
+ }
+
+ /** Returns true if field alternativeSSHHostName is set (has been assigned a value) and false otherwise */
+ public boolean isSetAlternativeSSHHostName() {
+ return this.alternativeSSHHostName != null;
+ }
+
+ public void setAlternativeSSHHostNameIsSet(boolean value) {
+ if (!value) {
+ this.alternativeSSHHostName = null;
+ }
+ }
+
+ public int getSshPort() {
+ return this.sshPort;
+ }
+
+ public void setSshPort(int sshPort) {
+ this.sshPort = sshPort;
+ setSshPortIsSet(true);
+ }
+
+ public void unsetSshPort() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SSHPORT_ISSET_ID);
+ }
+
+ /** Returns true if field sshPort is set (has been assigned a value) and false otherwise */
+ public boolean isSetSshPort() {
+ return EncodingUtils.testBit(__isset_bitfield, __SSHPORT_ISSET_ID);
+ }
+
+ public void setSshPortIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SSHPORT_ISSET_ID, value);
+ }
+
+ public String getMonitoringMechanism() {
+ return this.monitoringMechanism;
+ }
+
+ public void setMonitoringMechanism(String monitoringMechanism) {
+ this.monitoringMechanism = monitoringMechanism;
+ }
+
+ public void unsetMonitoringMechanism() {
+ this.monitoringMechanism = null;
+ }
+
+ /** Returns true if field monitoringMechanism is set (has been assigned a value) and false otherwise */
+ public boolean isSetMonitoringMechanism() {
+ return this.monitoringMechanism != null;
+ }
+
+ public void setMonitoringMechanismIsSet(boolean value) {
+ if (!value) {
+ this.monitoringMechanism = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case JOB_SUBMISSION_INTERFACE_ID:
+ if (value == null) {
+ unsetJobSubmissionInterfaceId();
+ } else {
+ setJobSubmissionInterfaceId((String)value);
+ }
+ break;
+
+ case SECURITY_PROTOCOL:
+ if (value == null) {
+ unsetSecurityProtocol();
+ } else {
+ setSecurityProtocol((SecurityProtocol)value);
+ }
+ break;
+
+ case RESOURCE_JOB_MANAGER:
+ if (value == null) {
+ unsetResourceJobManager();
+ } else {
+ setResourceJobManager((ResourceJobManager)value);
+ }
+ break;
+
+ case ALTERNATIVE_SSHHOST_NAME:
+ if (value == null) {
+ unsetAlternativeSSHHostName();
+ } else {
+ setAlternativeSSHHostName((String)value);
+ }
+ break;
+
+ case SSH_PORT:
+ if (value == null) {
+ unsetSshPort();
+ } else {
+ setSshPort((Integer)value);
+ }
+ break;
+
+ case MONITORING_MECHANISM:
+ if (value == null) {
+ unsetMonitoringMechanism();
+ } else {
+ setMonitoringMechanism((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case JOB_SUBMISSION_INTERFACE_ID:
+ return getJobSubmissionInterfaceId();
+
+ case SECURITY_PROTOCOL:
+ return getSecurityProtocol();
+
+ case RESOURCE_JOB_MANAGER:
+ return getResourceJobManager();
+
+ case ALTERNATIVE_SSHHOST_NAME:
+ return getAlternativeSSHHostName();
+
+ case SSH_PORT:
+ return Integer.valueOf(getSshPort());
+
+ case MONITORING_MECHANISM:
+ return getMonitoringMechanism();
+
+ }
+ 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 JOB_SUBMISSION_INTERFACE_ID:
+ return isSetJobSubmissionInterfaceId();
+ case SECURITY_PROTOCOL:
+ return isSetSecurityProtocol();
+ case RESOURCE_JOB_MANAGER:
+ return isSetResourceJobManager();
+ case ALTERNATIVE_SSHHOST_NAME:
+ return isSetAlternativeSSHHostName();
+ case SSH_PORT:
+ return isSetSshPort();
+ case MONITORING_MECHANISM:
+ return isSetMonitoringMechanism();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof SSHJobSubmission)
+ return this.equals((SSHJobSubmission)that);
+ return false;
+ }
+
+ public boolean equals(SSHJobSubmission that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_jobSubmissionInterfaceId = true && this.isSetJobSubmissionInterfaceId();
+ boolean that_present_jobSubmissionInterfaceId = true && that.isSetJobSubmissionInterfaceId();
+ if (this_present_jobSubmissionInterfaceId || that_present_jobSubmissionInterfaceId) {
+ if (!(this_present_jobSubmissionInterfaceId && that_present_jobSubmissionInterfaceId))
+ return false;
+ if (!this.jobSubmissionInterfaceId.equals(that.jobSubmissionInterfaceId))
+ return false;
+ }
+
+ boolean this_present_securityProtocol = true && this.isSetSecurityProtocol();
+ boolean that_present_securityProtocol = true && that.isSetSecurityProtocol();
+ if (this_present_securityProtocol || that_present_securityProtocol) {
+ if (!(this_present_securityProtocol && that_present_securityProtocol))
+ return false;
+ if (!this.securityProtocol.equals(that.securityProtocol))
+ return false;
+ }
+
+ boolean this_present_resourceJobManager = true && this.isSetResourceJobManager();
+ boolean that_present_resourceJobManager = true && that.isSetResourceJobManager();
+ if (this_present_resourceJobManager || that_present_resourceJobManager) {
+ if (!(this_present_resourceJobManager && that_present_resourceJobManager))
+ return false;
+ if (!this.resourceJobManager.equals(that.resourceJobManager))
+ return false;
+ }
+
+ boolean this_present_alternativeSSHHostName = true && this.isSetAlternativeSSHHostName();
+ boolean that_present_alternativeSSHHostName = true && that.isSetAlternativeSSHHostName();
+ if (this_present_alternativeSSHHostName || that_present_alternativeSSHHostName) {
+ if (!(this_present_alternativeSSHHostName && that_present_alternativeSSHHostName))
+ return false;
+ if (!this.alternativeSSHHostName.equals(that.alternativeSSHHostName))
+ return false;
+ }
+
+ boolean this_present_sshPort = true && this.isSetSshPort();
+ boolean that_present_sshPort = true && that.isSetSshPort();
+ if (this_present_sshPort || that_present_sshPort) {
+ if (!(this_present_sshPort && that_present_sshPort))
+ return false;
+ if (this.sshPort != that.sshPort)
+ return false;
+ }
+
+ boolean this_present_monitoringMechanism = true && this.isSetMonitoringMechanism();
+ boolean that_present_monitoringMechanism = true && that.isSetMonitoringMechanism();
+ if (this_present_monitoringMechanism || that_present_monitoringMechanism) {
+ if (!(this_present_monitoringMechanism && that_present_monitoringMechanism))
+ return false;
+ if (!this.monitoringMechanism.equals(that.monitoringMechanism))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(SSHJobSubmission other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetJobSubmissionInterfaceId()).compareTo(other.isSetJobSubmissionInterfaceId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobSubmissionInterfaceId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobSubmissionInterfaceId, other.jobSubmissionInterfaceId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSecurityProtocol()).compareTo(other.isSetSecurityProtocol());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSecurityProtocol()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.securityProtocol, other.securityProtocol);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetResourceJobManager()).compareTo(other.isSetResourceJobManager());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetResourceJobManager()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceJobManager, other.resourceJobManager);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAlternativeSSHHostName()).compareTo(other.isSetAlternativeSSHHostName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAlternativeSSHHostName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alternativeSSHHostName, other.alternativeSSHHostName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSshPort()).compareTo(other.isSetSshPort());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSshPort()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshPort, other.sshPort);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMonitoringMechanism()).compareTo(other.isSetMonitoringMechanism());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMonitoringMechanism()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.monitoringMechanism, other.monitoringMechanism);
+ 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("SSHJobSubmission(");
+ boolean first = true;
+
+ sb.append("jobSubmissionInterfaceId:");
+ if (this.jobSubmissionInterfaceId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.jobSubmissionInterfaceId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("securityProtocol:");
+ if (this.securityProtocol == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.securityProtocol);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("resourceJobManager:");
+ if (this.resourceJobManager == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.resourceJobManager);
+ }
+ first = false;
+ if (isSetAlternativeSSHHostName()) {
+ if (!first) sb.append(", ");
+ sb.append("alternativeSSHHostName:");
+ if (this.alternativeSSHHostName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.alternativeSSHHostName);
+ }
+ first = false;
+ }
+ if (isSetSshPort()) {
+ if (!first) sb.append(", ");
+ sb.append("sshPort:");
+ sb.append(this.sshPort);
+ first = false;
+ }
+ if (isSetMonitoringMechanism()) {
+ if (!first) sb.append(", ");
+ sb.append("monitoringMechanism:");
+ if (this.monitoringMechanism == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.monitoringMechanism);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetJobSubmissionInterfaceId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobSubmissionInterfaceId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetSecurityProtocol()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'securityProtocol' is unset! Struct:" + toString());
+ }
+
+ if (!isSetResourceJobManager()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'resourceJobManager' is unset! 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 {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ 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 SSHJobSubmissionStandardSchemeFactory implements SchemeFactory {
+ public SSHJobSubmissionStandardScheme getScheme() {
+ return new SSHJobSubmissionStandardScheme();
+ }
+ }
+
+ private static class SSHJobSubmissionStandardScheme extends StandardScheme<SSHJobSubmission> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, SSHJobSubmission 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: // JOB_SUBMISSION_INTERFACE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.jobSubmissionInterfaceId = iprot.readString();
+ struct.setJobSubmissionInterfaceIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // SECURITY_PROTOCOL
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.securityProtocol = SecurityProtocol.findByValue(iprot.readI32());
+ struct.setSecurityProtocolIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // RESOURCE_JOB_MANAGER
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.resourceJobManager = ResourceJobManager.findByValue(iprot.readI32());
+ struct.setResourceJobManagerIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ALTERNATIVE_SSHHOST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.alternativeSSHHostName = iprot.readString();
+ struct.setAlternativeSSHHostNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // SSH_PORT
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.sshPort = iprot.readI32();
+ struct.setSshPortIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // MONITORING_MECHANISM
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.monitoringMechanism = iprot.readString();
+ struct.setMonitoringMechanismIsSet(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();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, SSHJobSubmission struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.jobSubmissionInterfaceId != null) {
+ oprot.writeFieldBegin(JOB_SUBMISSION_INTERFACE_ID_FIELD_DESC);
+ oprot.writeString(struct.jobSubmissionInterfaceId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.securityProtocol != null) {
+ oprot.writeFieldBegin(SECURITY_PROTOCOL_FIELD_DESC);
+ oprot.writeI32(struct.securityProtocol.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.resourceJobManager != null) {
+ oprot.writeFieldBegin(RESOURCE_JOB_MANAGER_FIELD_DESC);
+ oprot.writeI32(struct.resourceJobManager.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.alternativeSSHHostName != null) {
+ if (struct.isSetAlternativeSSHHostName()) {
+ oprot.writeFieldBegin(ALTERNATIVE_SSHHOST_NAME_FIELD_DESC);
+ oprot.writeString(struct.alternativeSSHHostName);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetSshPort()) {
+ oprot.writeFieldBegin(SSH_PORT_FIELD_DESC);
+ oprot.writeI32(struct.sshPort);
+ oprot.writeFieldEnd();
+ }
+ if (struct.monitoringMechanism != null) {
+ if (struct.isSetMonitoringMechanism()) {
+ oprot.writeFieldBegin(MONITORING_MECHANISM_FIELD_DESC);
+ oprot.writeString(struct.monitoringMechanism);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class SSHJobSubmissionTupleSchemeFactory implements SchemeFactory {
+ public SSHJobSubmissionTupleScheme getScheme() {
+ return new SSHJobSubmissionTupleScheme();
+ }
+ }
+
+ private static class SSHJobSubmissionTupleScheme extends TupleScheme<SSHJobSubmission> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, SSHJobSubmission struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.jobSubmissionInterfaceId);
+ oprot.writeI32(struct.securityProtocol.getValue());
+ oprot.writeI32(struct.resourceJobManager.getValue());
+ BitSet optionals = new BitSet();
+ if (struct.isSetAlternativeSSHHostName()) {
+ optionals.set(0);
+ }
+ if (struct.isSetSshPort()) {
+ optionals.set(1);
+ }
+ if (struct.isSetMonitoringMechanism()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetAlternativeSSHHostName()) {
+ oprot.writeString(struct.alternativeSSHHostName);
+ }
+ if (struct.isSetSshPort()) {
+ oprot.writeI32(struct.sshPort);
+ }
+ if (struct.isSetMonitoringMechanism()) {
+ oprot.writeString(struct.monitoringMechanism);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, SSHJobSubmission struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.jobSubmissionInterfaceId = iprot.readString();
+ struct.setJobSubmissionInterfaceIdIsSet(true);
+ struct.securityProtocol = SecurityProtocol.findByValue(iprot.readI32());
+ struct.setSecurityProtocolIsSet(true);
+ struct.resourceJobManager = ResourceJobManager.findByValue(iprot.readI32());
+ struct.setResourceJobManagerIsSet(true);
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.alternativeSSHHostName = iprot.readString();
+ struct.setAlternativeSSHHostNameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.sshPort = iprot.readI32();
+ struct.setSshPortIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.monitoringMechanism = iprot.readString();
+ struct.setMonitoringMechanismIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/59a7443a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SecurityProtocol.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SecurityProtocol.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SecurityProtocol.java
new file mode 100644
index 0000000..fe1f625
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/SecurityProtocol.java
@@ -0,0 +1,82 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.appcatalog.computeresource;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+/**
+ * Enumeration of security authentication and authorization mechanisms supported by Airavata. This enumeration just
+ * describes the supported mechanism. The corresponding security credentials are registered with Airavata Credential
+ * store.
+ *
+ * USERNAME_PASSWORD:
+ * A User Name.
+ *
+ * SSH_KEYS:
+ * SSH Keys
+ *
+ */
+@SuppressWarnings("all") public enum SecurityProtocol implements org.apache.thrift.TEnum {
+ USERNAME_PASSWORD(0),
+ SSH_KEYS(1),
+ GSI(2),
+ KERBEROS(3),
+ OAUTH(4);
+
+ private final int value;
+
+ private SecurityProtocol(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static SecurityProtocol findByValue(int value) {
+ switch (value) {
+ case 0:
+ return USERNAME_PASSWORD;
+ case 1:
+ return SSH_KEYS;
+ case 2:
+ return GSI;
+ case 3:
+ return KERBEROS;
+ case 4:
+ return OAUTH;
+ default:
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/59a7443a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/computeResourceModelConstants.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/computeResourceModelConstants.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/computeResourceModelConstants.java
new file mode 100644
index 0000000..250a671
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/computeResourceModelConstants.java
@@ -0,0 +1,55 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.appcatalog.computeresource;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class computeResourceModelConstants {
+
+ public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/59a7443a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/ComputeResourcePreference.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/ComputeResourcePreference.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/ComputeResourcePreference.java
new file mode 100644
index 0000000..47375e3
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/ComputeResourcePreference.java
@@ -0,0 +1,1023 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.appcatalog.gatewayprofile;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Resource Preferences for each of the gateway
+ *
+ * computeResourceId:
+ * Corelate the preference for compute resource to
+ *
+ * gatewayName:
+ * Name of the Gateway.
+ *
+ * ipAddress:
+ * IP Addresse of the Hostname.
+ *
+ * resourceDescription:
+ * A user friendly description of the hostname.
+ *
+ * JobSubmissionProtocols:
+ * A computational resources may have one or more ways of submitting Jobs. This structure
+ * will hold all available mechanisms to interact with the resource.
+ *
+ * DataMovementProtocol:
+ * Option to specify a prefered data movement mechanism of the available options.
+ *
+ */
+@SuppressWarnings("all") public class ComputeResourcePreference implements org.apache.thrift.TBase<ComputeResourcePreference, ComputeResourcePreference._Fields>, java.io.Serializable, Cloneable, Comparable<ComputeResourcePreference> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComputeResourcePreference");
+
+ private static final org.apache.thrift.protocol.TField COMPUTE_RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("computeResourceId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField OVERRIDEBY_AIRAVATA_FIELD_DESC = new org.apache.thrift.protocol.TField("overridebyAiravata", org.apache.thrift.protocol.TType.BOOL, (short)2);
+ private static final org.apache.thrift.protocol.TField PREFERRED_JOB_SUBMISSION_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredJobSubmissionProtocol", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField PREFERRED_DATA_MOVEMENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredDataMovementProtocol", org.apache.thrift.protocol.TType.STRING, (short)4);
+ private static final org.apache.thrift.protocol.TField PREFERRED_BATCH_QUEUE_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredBatchQueue", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField SCRATCH_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("scratchLocation", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField ALLOCATION_PROJECT_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("allocationProjectNumber", org.apache.thrift.protocol.TType.STRING, (short)7);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new ComputeResourcePreferenceStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ComputeResourcePreferenceTupleSchemeFactory());
+ }
+
+ private String computeResourceId; // required
+ private boolean overridebyAiravata; // required
+ private String preferredJobSubmissionProtocol; // optional
+ private String preferredDataMovementProtocol; // optional
+ private String preferredBatchQueue; // optional
+ private String scratchLocation; // optional
+ private String allocationProjectNumber; // optional
+
+ /** 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 {
+ COMPUTE_RESOURCE_ID((short)1, "computeResourceId"),
+ OVERRIDEBY_AIRAVATA((short)2, "overridebyAiravata"),
+ PREFERRED_JOB_SUBMISSION_PROTOCOL((short)3, "preferredJobSubmissionProtocol"),
+ PREFERRED_DATA_MOVEMENT_PROTOCOL((short)4, "preferredDataMovementProtocol"),
+ PREFERRED_BATCH_QUEUE((short)5, "preferredBatchQueue"),
+ SCRATCH_LOCATION((short)6, "scratchLocation"),
+ ALLOCATION_PROJECT_NUMBER((short)7, "allocationProjectNumber");
+
+ 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: // COMPUTE_RESOURCE_ID
+ return COMPUTE_RESOURCE_ID;
+ case 2: // OVERRIDEBY_AIRAVATA
+ return OVERRIDEBY_AIRAVATA;
+ case 3: // PREFERRED_JOB_SUBMISSION_PROTOCOL
+ return PREFERRED_JOB_SUBMISSION_PROTOCOL;
+ case 4: // PREFERRED_DATA_MOVEMENT_PROTOCOL
+ return PREFERRED_DATA_MOVEMENT_PROTOCOL;
+ case 5: // PREFERRED_BATCH_QUEUE
+ return PREFERRED_BATCH_QUEUE;
+ case 6: // SCRATCH_LOCATION
+ return SCRATCH_LOCATION;
+ case 7: // ALLOCATION_PROJECT_NUMBER
+ return ALLOCATION_PROJECT_NUMBER;
+ 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
+ private static final int __OVERRIDEBYAIRAVATA_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.PREFERRED_JOB_SUBMISSION_PROTOCOL,_Fields.PREFERRED_DATA_MOVEMENT_PROTOCOL,_Fields.PREFERRED_BATCH_QUEUE,_Fields.SCRATCH_LOCATION,_Fields.ALLOCATION_PROJECT_NUMBER};
+ 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.COMPUTE_RESOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("computeResourceId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.OVERRIDEBY_AIRAVATA, new org.apache.thrift.meta_data.FieldMetaData("overridebyAiravata", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.PREFERRED_JOB_SUBMISSION_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("preferredJobSubmissionProtocol", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.PREFERRED_DATA_MOVEMENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("preferredDataMovementProtocol", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.PREFERRED_BATCH_QUEUE, new org.apache.thrift.meta_data.FieldMetaData("preferredBatchQueue", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.SCRATCH_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("scratchLocation", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ALLOCATION_PROJECT_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("allocationProjectNumber", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComputeResourcePreference.class, metaDataMap);
+ }
+
+ public ComputeResourcePreference() {
+ this.overridebyAiravata = true;
+
+ }
+
+ public ComputeResourcePreference(
+ String computeResourceId,
+ boolean overridebyAiravata)
+ {
+ this();
+ this.computeResourceId = computeResourceId;
+ this.overridebyAiravata = overridebyAiravata;
+ setOverridebyAiravataIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public ComputeResourcePreference(ComputeResourcePreference other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetComputeResourceId()) {
+ this.computeResourceId = other.computeResourceId;
+ }
+ this.overridebyAiravata = other.overridebyAiravata;
+ if (other.isSetPreferredJobSubmissionProtocol()) {
+ this.preferredJobSubmissionProtocol = other.preferredJobSubmissionProtocol;
+ }
+ if (other.isSetPreferredDataMovementProtocol()) {
+ this.preferredDataMovementProtocol = other.preferredDataMovementProtocol;
+ }
+ if (other.isSetPreferredBatchQueue()) {
+ this.preferredBatchQueue = other.preferredBatchQueue;
+ }
+ if (other.isSetScratchLocation()) {
+ this.scratchLocation = other.scratchLocation;
+ }
+ if (other.isSetAllocationProjectNumber()) {
+ this.allocationProjectNumber = other.allocationProjectNumber;
+ }
+ }
+
+ public ComputeResourcePreference deepCopy() {
+ return new ComputeResourcePreference(this);
+ }
+
+ @Override
+ public void clear() {
+ this.computeResourceId = null;
+ this.overridebyAiravata = true;
+
+ this.preferredJobSubmissionProtocol = null;
+ this.preferredDataMovementProtocol = null;
+ this.preferredBatchQueue = null;
+ this.scratchLocation = null;
+ this.allocationProjectNumber = null;
+ }
+
+ public String getComputeResourceId() {
+ return this.computeResourceId;
+ }
+
+ public void setComputeResourceId(String computeResourceId) {
+ this.computeResourceId = computeResourceId;
+ }
+
+ public void unsetComputeResourceId() {
+ this.computeResourceId = null;
+ }
+
+ /** Returns true if field computeResourceId is set (has been assigned a value) and false otherwise */
+ public boolean isSetComputeResourceId() {
+ return this.computeResourceId != null;
+ }
+
+ public void setComputeResourceIdIsSet(boolean value) {
+ if (!value) {
+ this.computeResourceId = null;
+ }
+ }
+
+ public boolean isOverridebyAiravata() {
+ return this.overridebyAiravata;
+ }
+
+ public void setOverridebyAiravata(boolean overridebyAiravata) {
+ this.overridebyAiravata = overridebyAiravata;
+ setOverridebyAiravataIsSet(true);
+ }
+
+ public void unsetOverridebyAiravata() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OVERRIDEBYAIRAVATA_ISSET_ID);
+ }
+
+ /** Returns true if field overridebyAiravata is set (has been assigned a value) and false otherwise */
+ public boolean isSetOverridebyAiravata() {
+ return EncodingUtils.testBit(__isset_bitfield, __OVERRIDEBYAIRAVATA_ISSET_ID);
+ }
+
+ public void setOverridebyAiravataIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OVERRIDEBYAIRAVATA_ISSET_ID, value);
+ }
+
+ public String getPreferredJobSubmissionProtocol() {
+ return this.preferredJobSubmissionProtocol;
+ }
+
+ public void setPreferredJobSubmissionProtocol(String preferredJobSubmissionProtocol) {
+ this.preferredJobSubmissionProtocol = preferredJobSubmissionProtocol;
+ }
+
+ public void unsetPreferredJobSubmissionProtocol() {
+ this.preferredJobSubmissionProtocol = null;
+ }
+
+ /** Returns true if field preferredJobSubmissionProtocol is set (has been assigned a value) and false otherwise */
+ public boolean isSetPreferredJobSubmissionProtocol() {
+ return this.preferredJobSubmissionProtocol != null;
+ }
+
+ public void setPreferredJobSubmissionProtocolIsSet(boolean value) {
+ if (!value) {
+ this.preferredJobSubmissionProtocol = null;
+ }
+ }
+
+ public String getPreferredDataMovementProtocol() {
+ return this.preferredDataMovementProtocol;
+ }
+
+ public void setPreferredDataMovementProtocol(String preferredDataMovementProtocol) {
+ this.preferredDataMovementProtocol = preferredDataMovementProtocol;
+ }
+
+ public void unsetPreferredDataMovementProtocol() {
+ this.preferredDataMovementProtocol = null;
+ }
+
+ /** Returns true if field preferredDataMovementProtocol is set (has been assigned a value) and false otherwise */
+ public boolean isSetPreferredDataMovementProtocol() {
+ return this.preferredDataMovementProtocol != null;
+ }
+
+ public void setPreferredDataMovementProtocolIsSet(boolean value) {
+ if (!value) {
+ this.preferredDataMovementProtocol = null;
+ }
+ }
+
+ public String getPreferredBatchQueue() {
+ return this.preferredBatchQueue;
+ }
+
+ public void setPreferredBatchQueue(String preferredBatchQueue) {
+ this.preferredBatchQueue = preferredBatchQueue;
+ }
+
+ public void unsetPreferredBatchQueue() {
+ this.preferredBatchQueue = null;
+ }
+
+ /** Returns true if field preferredBatchQueue is set (has been assigned a value) and false otherwise */
+ public boolean isSetPreferredBatchQueue() {
+ return this.preferredBatchQueue != null;
+ }
+
+ public void setPreferredBatchQueueIsSet(boolean value) {
+ if (!value) {
+ this.preferredBatchQueue = null;
+ }
+ }
+
+ public String getScratchLocation() {
+ return this.scratchLocation;
+ }
+
+ public void setScratchLocation(String scratchLocation) {
+ this.scratchLocation = scratchLocation;
+ }
+
+ public void unsetScratchLocation() {
+ this.scratchLocation = null;
+ }
+
+ /** Returns true if field scratchLocation is set (has been assigned a value) and false otherwise */
+ public boolean isSetScratchLocation() {
+ return this.scratchLocation != null;
+ }
+
+ public void setScratchLocationIsSet(boolean value) {
+ if (!value) {
+ this.scratchLocation = null;
+ }
+ }
+
+ public String getAllocationProjectNumber() {
+ return this.allocationProjectNumber;
+ }
+
+ public void setAllocationProjectNumber(String allocationProjectNumber) {
+ this.allocationProjectNumber = allocationProjectNumber;
+ }
+
+ public void unsetAllocationProjectNumber() {
+ this.allocationProjectNumber = null;
+ }
+
+ /** Returns true if field allocationProjectNumber is set (has been assigned a value) and false otherwise */
+ public boolean isSetAllocationProjectNumber() {
+ return this.allocationProjectNumber != null;
+ }
+
+ public void setAllocationProjectNumberIsSet(boolean value) {
+ if (!value) {
+ this.allocationProjectNumber = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case COMPUTE_RESOURCE_ID:
+ if (value == null) {
+ unsetComputeResourceId();
+ } else {
+ setComputeResourceId((String)value);
+ }
+ break;
+
+ case OVERRIDEBY_AIRAVATA:
+ if (value == null) {
+ unsetOverridebyAiravata();
+ } else {
+ setOverridebyAiravata((Boolean)value);
+ }
+ break;
+
+ case PREFERRED_JOB_SUBMISSION_PROTOCOL:
+ if (value == null) {
+ unsetPreferredJobSubmissionProtocol();
+ } else {
+ setPreferredJobSubmissionProtocol((String)value);
+ }
+ break;
+
+ case PREFERRED_DATA_MOVEMENT_PROTOCOL:
+ if (value == null) {
+ unsetPreferredDataMovementProtocol();
+ } else {
+ setPreferredDataMovementProtocol((String)value);
+ }
+ break;
+
+ case PREFERRED_BATCH_QUEUE:
+ if (value == null) {
+ unsetPreferredBatchQueue();
+ } else {
+ setPreferredBatchQueue((String)value);
+ }
+ break;
+
+ case SCRATCH_LOCATION:
+ if (value == null) {
+ unsetScratchLocation();
+ } else {
+ setScratchLocation((String)value);
+ }
+ break;
+
+ case ALLOCATION_PROJECT_NUMBER:
+ if (value == null) {
+ unsetAllocationProjectNumber();
+ } else {
+ setAllocationProjectNumber((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case COMPUTE_RESOURCE_ID:
+ return getComputeResourceId();
+
+ case OVERRIDEBY_AIRAVATA:
+ return Boolean.valueOf(isOverridebyAiravata());
+
+ case PREFERRED_JOB_SUBMISSION_PROTOCOL:
+ return getPreferredJobSubmissionProtocol();
+
+ case PREFERRED_DATA_MOVEMENT_PROTOCOL:
+ return getPreferredDataMovementProtocol();
+
+ case PREFERRED_BATCH_QUEUE:
+ return getPreferredBatchQueue();
+
+ case SCRATCH_LOCATION:
+ return getScratchLocation();
+
+ case ALLOCATION_PROJECT_NUMBER:
+ return getAllocationProjectNumber();
+
+ }
+ 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 COMPUTE_RESOURCE_ID:
+ return isSetComputeResourceId();
+ case OVERRIDEBY_AIRAVATA:
+ return isSetOverridebyAiravata();
+ case PREFERRED_JOB_SUBMISSION_PROTOCOL:
+ return isSetPreferredJobSubmissionProtocol();
+ case PREFERRED_DATA_MOVEMENT_PROTOCOL:
+ return isSetPreferredDataMovementProtocol();
+ case PREFERRED_BATCH_QUEUE:
+ return isSetPreferredBatchQueue();
+ case SCRATCH_LOCATION:
+ return isSetScratchLocation();
+ case ALLOCATION_PROJECT_NUMBER:
+ return isSetAllocationProjectNumber();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof ComputeResourcePreference)
+ return this.equals((ComputeResourcePreference)that);
+ return false;
+ }
+
+ public boolean equals(ComputeResourcePreference that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_computeResourceId = true && this.isSetComputeResourceId();
+ boolean that_present_computeResourceId = true && that.isSetComputeResourceId();
+ if (this_present_computeResourceId || that_present_computeResourceId) {
+ if (!(this_present_computeResourceId && that_present_computeResourceId))
+ return false;
+ if (!this.computeResourceId.equals(that.computeResourceId))
+ return false;
+ }
+
+ boolean this_present_overridebyAiravata = true;
+ boolean that_present_overridebyAiravata = true;
+ if (this_present_overridebyAiravata || that_present_overridebyAiravata) {
+ if (!(this_present_overridebyAiravata && that_present_overridebyAiravata))
+ return false;
+ if (this.overridebyAiravata != that.overridebyAiravata)
+ return false;
+ }
+
+ boolean this_present_preferredJobSubmissionProtocol = true && this.isSetPreferredJobSubmissionProtocol();
+ boolean that_present_preferredJobSubmissionProtocol = true && that.isSetPreferredJobSubmissionProtocol();
+ if (this_present_preferredJobSubmissionProtocol || that_present_preferredJobSubmissionProtocol) {
+ if (!(this_present_preferredJobSubmissionProtocol && that_present_preferredJobSubmissionProtocol))
+ return false;
+ if (!this.preferredJobSubmissionProtocol.equals(that.preferredJobSubmissionProtocol))
+ return false;
+ }
+
+ boolean this_present_preferredDataMovementProtocol = true && this.isSetPreferredDataMovementProtocol();
+ boolean that_present_preferredDataMovementProtocol = true && that.isSetPreferredDataMovementProtocol();
+ if (this_present_preferredDataMovementProtocol || that_present_preferredDataMovementProtocol) {
+ if (!(this_present_preferredDataMovementProtocol && that_present_preferredDataMovementProtocol))
+ return false;
+ if (!this.preferredDataMovementProtocol.equals(that.preferredDataMovementProtocol))
+ return false;
+ }
+
+ boolean this_present_preferredBatchQueue = true && this.isSetPreferredBatchQueue();
+ boolean that_present_preferredBatchQueue = true && that.isSetPreferredBatchQueue();
+ if (this_present_preferredBatchQueue || that_present_preferredBatchQueue) {
+ if (!(this_present_preferredBatchQueue && that_present_preferredBatchQueue))
+ return false;
+ if (!this.preferredBatchQueue.equals(that.preferredBatchQueue))
+ return false;
+ }
+
+ boolean this_present_scratchLocation = true && this.isSetScratchLocation();
+ boolean that_present_scratchLocation = true && that.isSetScratchLocation();
+ if (this_present_scratchLocation || that_present_scratchLocation) {
+ if (!(this_present_scratchLocation && that_present_scratchLocation))
+ return false;
+ if (!this.scratchLocation.equals(that.scratchLocation))
+ return false;
+ }
+
+ boolean this_present_allocationProjectNumber = true && this.isSetAllocationProjectNumber();
+ boolean that_present_allocationProjectNumber = true && that.isSetAllocationProjectNumber();
+ if (this_present_allocationProjectNumber || that_present_allocationProjectNumber) {
+ if (!(this_present_allocationProjectNumber && that_present_allocationProjectNumber))
+ return false;
+ if (!this.allocationProjectNumber.equals(that.allocationProjectNumber))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(ComputeResourcePreference other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetComputeResourceId()).compareTo(other.isSetComputeResourceId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetComputeResourceId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.computeResourceId, other.computeResourceId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetOverridebyAiravata()).compareTo(other.isSetOverridebyAiravata());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOverridebyAiravata()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.overridebyAiravata, other.overridebyAiravata);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPreferredJobSubmissionProtocol()).compareTo(other.isSetPreferredJobSubmissionProtocol());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPreferredJobSubmissionProtocol()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredJobSubmissionProtocol, other.preferredJobSubmissionProtocol);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPreferredDataMovementProtocol()).compareTo(other.isSetPreferredDataMovementProtocol());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPreferredDataMovementProtocol()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredDataMovementProtocol, other.preferredDataMovementProtocol);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPreferredBatchQueue()).compareTo(other.isSetPreferredBatchQueue());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPreferredBatchQueue()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredBatchQueue, other.preferredBatchQueue);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetScratchLocation()).compareTo(other.isSetScratchLocation());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetScratchLocation()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scratchLocation, other.scratchLocation);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAllocationProjectNumber()).compareTo(other.isSetAllocationProjectNumber());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAllocationProjectNumber()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allocationProjectNumber, other.allocationProjectNumber);
+ 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("ComputeResourcePreference(");
+ boolean first = true;
+
+ sb.append("computeResourceId:");
+ if (this.computeResourceId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.computeResourceId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("overridebyAiravata:");
+ sb.append(this.overridebyAiravata);
+ first = false;
+ if (isSetPreferredJobSubmissionProtocol()) {
+ if (!first) sb.append(", ");
+ sb.append("preferredJobSubmissionProtocol:");
+ if (this.preferredJobSubmissionProtocol == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.preferredJobSubmissionProtocol);
+ }
+ first = false;
+ }
+ if (isSetPreferredDataMovementProtocol()) {
+ if (!first) sb.append(", ");
+ sb.append("preferredDataMovementProtocol:");
+ if (this.preferredDataMovementProtocol == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.preferredDataMovementProtocol);
+ }
+ first = false;
+ }
+ if (isSetPreferredBatchQueue()) {
+ if (!first) sb.append(", ");
+ sb.append("preferredBatchQueue:");
+ if (this.preferredBatchQueue == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.preferredBatchQueue);
+ }
+ first = false;
+ }
+ if (isSetScratchLocation()) {
+ if (!first) sb.append(", ");
+ sb.append("scratchLocation:");
+ if (this.scratchLocation == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.scratchLocation);
+ }
+ first = false;
+ }
+ if (isSetAllocationProjectNumber()) {
+ if (!first) sb.append(", ");
+ sb.append("allocationProjectNumber:");
+ if (this.allocationProjectNumber == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.allocationProjectNumber);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetComputeResourceId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'computeResourceId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetOverridebyAiravata()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'overridebyAiravata' is unset! 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 {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ 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 ComputeResourcePreferenceStandardSchemeFactory implements SchemeFactory {
+ public ComputeResourcePreferenceStandardScheme getScheme() {
+ return new ComputeResourcePreferenceStandardScheme();
+ }
+ }
+
+ private static class ComputeResourcePreferenceStandardScheme extends StandardScheme<ComputeResourcePreference> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ComputeResourcePreference 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: // COMPUTE_RESOURCE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.computeResourceId = iprot.readString();
+ struct.setComputeResourceIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // OVERRIDEBY_AIRAVATA
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.overridebyAiravata = iprot.readBool();
+ struct.setOverridebyAiravataIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // PREFERRED_JOB_SUBMISSION_PROTOCOL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.preferredJobSubmissionProtocol = iprot.readString();
+ struct.setPreferredJobSubmissionProtocolIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // PREFERRED_DATA_MOVEMENT_PROTOCOL
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.preferredDataMovementProtocol = iprot.readString();
+ struct.setPreferredDataMovementProtocolIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // PREFERRED_BATCH_QUEUE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.preferredBatchQueue = iprot.readString();
+ struct.setPreferredBatchQueueIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // SCRATCH_LOCATION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.scratchLocation = iprot.readString();
+ struct.setScratchLocationIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // ALLOCATION_PROJECT_NUMBER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.allocationProjectNumber = iprot.readString();
+ struct.setAllocationProjectNumberIsSet(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();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, ComputeResourcePreference struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.computeResourceId != null) {
+ oprot.writeFieldBegin(COMPUTE_RESOURCE_ID_FIELD_DESC);
+ oprot.writeString(struct.computeResourceId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(OVERRIDEBY_AIRAVATA_FIELD_DESC);
+ oprot.writeBool(struct.overridebyAiravata);
+ oprot.writeFieldEnd();
+ if (struct.preferredJobSubmissionProtocol != null) {
+ if (struct.isSetPreferredJobSubmissionProtocol()) {
+ oprot.writeFieldBegin(PREFERRED_JOB_SUBMISSION_PROTOCOL_FIELD_DESC);
+ oprot.writeString(struct.preferredJobSubmissionProtocol);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.preferredDataMovementProtocol != null) {
+ if (struct.isSetPreferredDataMovementProtocol()) {
+ oprot.writeFieldBegin(PREFERRED_DATA_MOVEMENT_PROTOCOL_FIELD_DESC);
+ oprot.writeString(struct.preferredDataMovementProtocol);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.preferredBatchQueue != null) {
+ if (struct.isSetPreferredBatchQueue()) {
+ oprot.writeFieldBegin(PREFERRED_BATCH_QUEUE_FIELD_DESC);
+ oprot.writeString(struct.preferredBatchQueue);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.scratchLocation != null) {
+ if (struct.isSetScratchLocation()) {
+ oprot.writeFieldBegin(SCRATCH_LOCATION_FIELD_DESC);
+ oprot.writeString(struct.scratchLocation);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.allocationProjectNumber != null) {
+ if (struct.isSetAllocationProjectNumber()) {
+ oprot.writeFieldBegin(ALLOCATION_PROJECT_NUMBER_FIELD_DESC);
+ oprot.writeString(struct.allocationProjectNumber);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ComputeResourcePreferenceTupleSchemeFactory implements SchemeFactory {
+ public ComputeResourcePreferenceTupleScheme getScheme() {
+ return new ComputeResourcePreferenceTupleScheme();
+ }
+ }
+
+ private static class ComputeResourcePreferenceTupleScheme extends TupleScheme<ComputeResourcePreference> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ComputeResourcePreference struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.computeResourceId);
+ oprot.writeBool(struct.overridebyAiravata);
+ BitSet optionals = new BitSet();
+ if (struct.isSetPreferredJobSubmissionProtocol()) {
+ optionals.set(0);
+ }
+ if (struct.isSetPreferredDataMovementProtocol()) {
+ optionals.set(1);
+ }
+ if (struct.isSetPreferredBatchQueue()) {
+ optionals.set(2);
+ }
+ if (struct.isSetScratchLocation()) {
+ optionals.set(3);
+ }
+ if (struct.isSetAllocationProjectNumber()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetPreferredJobSubmissionProtocol()) {
+ oprot.writeString(struct.preferredJobSubmissionProtocol);
+ }
+ if (struct.isSetPreferredDataMovementProtocol()) {
+ oprot.writeString(struct.preferredDataMovementProtocol);
+ }
+ if (struct.isSetPreferredBatchQueue()) {
+ oprot.writeString(struct.preferredBatchQueue);
+ }
+ if (struct.isSetScratchLocation()) {
+ oprot.writeString(struct.scratchLocation);
+ }
+ if (struct.isSetAllocationProjectNumber()) {
+ oprot.writeString(struct.allocationProjectNumber);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ComputeResourcePreference struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.computeResourceId = iprot.readString();
+ struct.setComputeResourceIdIsSet(true);
+ struct.overridebyAiravata = iprot.readBool();
+ struct.setOverridebyAiravataIsSet(true);
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.preferredJobSubmissionProtocol = iprot.readString();
+ struct.setPreferredJobSubmissionProtocolIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.preferredDataMovementProtocol = iprot.readString();
+ struct.setPreferredDataMovementProtocolIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.preferredBatchQueue = iprot.readString();
+ struct.setPreferredBatchQueueIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.scratchLocation = iprot.readString();
+ struct.setScratchLocationIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.allocationProjectNumber = iprot.readString();
+ struct.setAllocationProjectNumberIsSet(true);
+ }
+ }
+ }
+
+}
+