You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2014/05/16 22:02:23 UTC
[5/7] adding id to all the job submission protocols and data movement
protocols - AIRAVATA-1203
http://git-wip-us.apache.org/repos/asf/airavata/blob/0317c4a6/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationDescriptor.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationDescriptor.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationDescriptor.java
deleted file mode 100644
index 6be247a..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationDescriptor.java
+++ /dev/null
@@ -1,506 +0,0 @@
- /*
- * 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;
-
-/**
- * Following structs are added for completeness of the application catalog
- */
-@SuppressWarnings("all") public class ApplicationDescriptor implements org.apache.thrift.TBase<ApplicationDescriptor, ApplicationDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ApplicationDescriptor> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ApplicationDescriptor");
-
- private static final org.apache.thrift.protocol.TField APPLICATION_DESCRIPTOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationDescriptorId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField APPLICATION_DESCRIPTOR_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationDescriptorData", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ApplicationDescriptorStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ApplicationDescriptorTupleSchemeFactory());
- }
-
- private String applicationDescriptorId; // required
- private String applicationDescriptorData; // 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 {
- APPLICATION_DESCRIPTOR_ID((short)1, "applicationDescriptorId"),
- APPLICATION_DESCRIPTOR_DATA((short)2, "applicationDescriptorData");
-
- 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: // APPLICATION_DESCRIPTOR_ID
- return APPLICATION_DESCRIPTOR_ID;
- case 2: // APPLICATION_DESCRIPTOR_DATA
- return APPLICATION_DESCRIPTOR_DATA;
- 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 _Fields optionals[] = {_Fields.APPLICATION_DESCRIPTOR_DATA};
- 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.APPLICATION_DESCRIPTOR_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationDescriptorId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.APPLICATION_DESCRIPTOR_DATA, new org.apache.thrift.meta_data.FieldMetaData("applicationDescriptorData", 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(ApplicationDescriptor.class, metaDataMap);
- }
-
- public ApplicationDescriptor() {
- this.applicationDescriptorId = "DO_NOT_SET_AT_CLIENTS";
-
- }
-
- public ApplicationDescriptor(
- String applicationDescriptorId)
- {
- this();
- this.applicationDescriptorId = applicationDescriptorId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ApplicationDescriptor(ApplicationDescriptor other) {
- if (other.isSetApplicationDescriptorId()) {
- this.applicationDescriptorId = other.applicationDescriptorId;
- }
- if (other.isSetApplicationDescriptorData()) {
- this.applicationDescriptorData = other.applicationDescriptorData;
- }
- }
-
- public ApplicationDescriptor deepCopy() {
- return new ApplicationDescriptor(this);
- }
-
- @Override
- public void clear() {
- this.applicationDescriptorId = "DO_NOT_SET_AT_CLIENTS";
-
- this.applicationDescriptorData = null;
- }
-
- public String getApplicationDescriptorId() {
- return this.applicationDescriptorId;
- }
-
- public void setApplicationDescriptorId(String applicationDescriptorId) {
- this.applicationDescriptorId = applicationDescriptorId;
- }
-
- public void unsetApplicationDescriptorId() {
- this.applicationDescriptorId = null;
- }
-
- /** Returns true if field applicationDescriptorId is set (has been assigned a value) and false otherwise */
- public boolean isSetApplicationDescriptorId() {
- return this.applicationDescriptorId != null;
- }
-
- public void setApplicationDescriptorIdIsSet(boolean value) {
- if (!value) {
- this.applicationDescriptorId = null;
- }
- }
-
- public String getApplicationDescriptorData() {
- return this.applicationDescriptorData;
- }
-
- public void setApplicationDescriptorData(String applicationDescriptorData) {
- this.applicationDescriptorData = applicationDescriptorData;
- }
-
- public void unsetApplicationDescriptorData() {
- this.applicationDescriptorData = null;
- }
-
- /** Returns true if field applicationDescriptorData is set (has been assigned a value) and false otherwise */
- public boolean isSetApplicationDescriptorData() {
- return this.applicationDescriptorData != null;
- }
-
- public void setApplicationDescriptorDataIsSet(boolean value) {
- if (!value) {
- this.applicationDescriptorData = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case APPLICATION_DESCRIPTOR_ID:
- if (value == null) {
- unsetApplicationDescriptorId();
- } else {
- setApplicationDescriptorId((String)value);
- }
- break;
-
- case APPLICATION_DESCRIPTOR_DATA:
- if (value == null) {
- unsetApplicationDescriptorData();
- } else {
- setApplicationDescriptorData((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case APPLICATION_DESCRIPTOR_ID:
- return getApplicationDescriptorId();
-
- case APPLICATION_DESCRIPTOR_DATA:
- return getApplicationDescriptorData();
-
- }
- 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 APPLICATION_DESCRIPTOR_ID:
- return isSetApplicationDescriptorId();
- case APPLICATION_DESCRIPTOR_DATA:
- return isSetApplicationDescriptorData();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ApplicationDescriptor)
- return this.equals((ApplicationDescriptor)that);
- return false;
- }
-
- public boolean equals(ApplicationDescriptor that) {
- if (that == null)
- return false;
-
- boolean this_present_applicationDescriptorId = true && this.isSetApplicationDescriptorId();
- boolean that_present_applicationDescriptorId = true && that.isSetApplicationDescriptorId();
- if (this_present_applicationDescriptorId || that_present_applicationDescriptorId) {
- if (!(this_present_applicationDescriptorId && that_present_applicationDescriptorId))
- return false;
- if (!this.applicationDescriptorId.equals(that.applicationDescriptorId))
- return false;
- }
-
- boolean this_present_applicationDescriptorData = true && this.isSetApplicationDescriptorData();
- boolean that_present_applicationDescriptorData = true && that.isSetApplicationDescriptorData();
- if (this_present_applicationDescriptorData || that_present_applicationDescriptorData) {
- if (!(this_present_applicationDescriptorData && that_present_applicationDescriptorData))
- return false;
- if (!this.applicationDescriptorData.equals(that.applicationDescriptorData))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(ApplicationDescriptor other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetApplicationDescriptorId()).compareTo(other.isSetApplicationDescriptorId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetApplicationDescriptorId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationDescriptorId, other.applicationDescriptorId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetApplicationDescriptorData()).compareTo(other.isSetApplicationDescriptorData());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetApplicationDescriptorData()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationDescriptorData, other.applicationDescriptorData);
- 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("ApplicationDescriptor(");
- boolean first = true;
-
- sb.append("applicationDescriptorId:");
- if (this.applicationDescriptorId == null) {
- sb.append("null");
- } else {
- sb.append(this.applicationDescriptorId);
- }
- first = false;
- if (isSetApplicationDescriptorData()) {
- if (!first) sb.append(", ");
- sb.append("applicationDescriptorData:");
- if (this.applicationDescriptorData == null) {
- sb.append("null");
- } else {
- sb.append(this.applicationDescriptorData);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!isSetApplicationDescriptorId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'applicationDescriptorId' 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 {
- 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 ApplicationDescriptorStandardSchemeFactory implements SchemeFactory {
- public ApplicationDescriptorStandardScheme getScheme() {
- return new ApplicationDescriptorStandardScheme();
- }
- }
-
- private static class ApplicationDescriptorStandardScheme extends StandardScheme<ApplicationDescriptor> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ApplicationDescriptor 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: // APPLICATION_DESCRIPTOR_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.applicationDescriptorId = iprot.readString();
- struct.setApplicationDescriptorIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // APPLICATION_DESCRIPTOR_DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.applicationDescriptorData = iprot.readString();
- struct.setApplicationDescriptorDataIsSet(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, ApplicationDescriptor struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.applicationDescriptorId != null) {
- oprot.writeFieldBegin(APPLICATION_DESCRIPTOR_ID_FIELD_DESC);
- oprot.writeString(struct.applicationDescriptorId);
- oprot.writeFieldEnd();
- }
- if (struct.applicationDescriptorData != null) {
- if (struct.isSetApplicationDescriptorData()) {
- oprot.writeFieldBegin(APPLICATION_DESCRIPTOR_DATA_FIELD_DESC);
- oprot.writeString(struct.applicationDescriptorData);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ApplicationDescriptorTupleSchemeFactory implements SchemeFactory {
- public ApplicationDescriptorTupleScheme getScheme() {
- return new ApplicationDescriptorTupleScheme();
- }
- }
-
- private static class ApplicationDescriptorTupleScheme extends TupleScheme<ApplicationDescriptor> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ApplicationDescriptor struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.applicationDescriptorId);
- BitSet optionals = new BitSet();
- if (struct.isSetApplicationDescriptorData()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetApplicationDescriptorData()) {
- oprot.writeString(struct.applicationDescriptorData);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ApplicationDescriptor struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.applicationDescriptorId = iprot.readString();
- struct.setApplicationDescriptorIdIsSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.applicationDescriptorData = iprot.readString();
- struct.setApplicationDescriptorDataIsSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/0317c4a6/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationInterface.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationInterface.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationInterface.java
deleted file mode 100644
index 85c219b..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/ApplicationInterface.java
+++ /dev/null
@@ -1,658 +0,0 @@
- /*
- * 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 ApplicationInterface implements org.apache.thrift.TBase<ApplicationInterface, ApplicationInterface._Fields>, java.io.Serializable, Cloneable, Comparable<ApplicationInterface> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ApplicationInterface");
-
- private static final org.apache.thrift.protocol.TField APPLICATION_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField APPLICATION_INTERFACE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationInterfaceData", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField APPLICATION_DEPLOYMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationDeployments", org.apache.thrift.protocol.TType.LIST, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ApplicationInterfaceStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ApplicationInterfaceTupleSchemeFactory());
- }
-
- private String applicationInterfaceId; // required
- private String applicationInterfaceData; // optional
- private List<ApplicationDeployment> applicationDeployments; // 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 {
- APPLICATION_INTERFACE_ID((short)1, "applicationInterfaceId"),
- APPLICATION_INTERFACE_DATA((short)2, "applicationInterfaceData"),
- APPLICATION_DEPLOYMENTS((short)3, "applicationDeployments");
-
- 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: // APPLICATION_INTERFACE_ID
- return APPLICATION_INTERFACE_ID;
- case 2: // APPLICATION_INTERFACE_DATA
- return APPLICATION_INTERFACE_DATA;
- case 3: // APPLICATION_DEPLOYMENTS
- return APPLICATION_DEPLOYMENTS;
- 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 _Fields optionals[] = {_Fields.APPLICATION_INTERFACE_DATA,_Fields.APPLICATION_DEPLOYMENTS};
- 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.APPLICATION_INTERFACE_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationInterfaceId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.APPLICATION_INTERFACE_DATA, new org.apache.thrift.meta_data.FieldMetaData("applicationInterfaceData", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.APPLICATION_DEPLOYMENTS, new org.apache.thrift.meta_data.FieldMetaData("applicationDeployments", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ApplicationDeployment.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ApplicationInterface.class, metaDataMap);
- }
-
- public ApplicationInterface() {
- this.applicationInterfaceId = "DO_NOT_SET_AT_CLIENTS";
-
- }
-
- public ApplicationInterface(
- String applicationInterfaceId)
- {
- this();
- this.applicationInterfaceId = applicationInterfaceId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ApplicationInterface(ApplicationInterface other) {
- if (other.isSetApplicationInterfaceId()) {
- this.applicationInterfaceId = other.applicationInterfaceId;
- }
- if (other.isSetApplicationInterfaceData()) {
- this.applicationInterfaceData = other.applicationInterfaceData;
- }
- if (other.isSetApplicationDeployments()) {
- List<ApplicationDeployment> __this__applicationDeployments = new ArrayList<ApplicationDeployment>(other.applicationDeployments.size());
- for (ApplicationDeployment other_element : other.applicationDeployments) {
- __this__applicationDeployments.add(new ApplicationDeployment(other_element));
- }
- this.applicationDeployments = __this__applicationDeployments;
- }
- }
-
- public ApplicationInterface deepCopy() {
- return new ApplicationInterface(this);
- }
-
- @Override
- public void clear() {
- this.applicationInterfaceId = "DO_NOT_SET_AT_CLIENTS";
-
- this.applicationInterfaceData = null;
- this.applicationDeployments = null;
- }
-
- public String getApplicationInterfaceId() {
- return this.applicationInterfaceId;
- }
-
- public void setApplicationInterfaceId(String applicationInterfaceId) {
- this.applicationInterfaceId = applicationInterfaceId;
- }
-
- public void unsetApplicationInterfaceId() {
- this.applicationInterfaceId = null;
- }
-
- /** Returns true if field applicationInterfaceId is set (has been assigned a value) and false otherwise */
- public boolean isSetApplicationInterfaceId() {
- return this.applicationInterfaceId != null;
- }
-
- public void setApplicationInterfaceIdIsSet(boolean value) {
- if (!value) {
- this.applicationInterfaceId = null;
- }
- }
-
- public String getApplicationInterfaceData() {
- return this.applicationInterfaceData;
- }
-
- public void setApplicationInterfaceData(String applicationInterfaceData) {
- this.applicationInterfaceData = applicationInterfaceData;
- }
-
- public void unsetApplicationInterfaceData() {
- this.applicationInterfaceData = null;
- }
-
- /** Returns true if field applicationInterfaceData is set (has been assigned a value) and false otherwise */
- public boolean isSetApplicationInterfaceData() {
- return this.applicationInterfaceData != null;
- }
-
- public void setApplicationInterfaceDataIsSet(boolean value) {
- if (!value) {
- this.applicationInterfaceData = null;
- }
- }
-
- public int getApplicationDeploymentsSize() {
- return (this.applicationDeployments == null) ? 0 : this.applicationDeployments.size();
- }
-
- public java.util.Iterator<ApplicationDeployment> getApplicationDeploymentsIterator() {
- return (this.applicationDeployments == null) ? null : this.applicationDeployments.iterator();
- }
-
- public void addToApplicationDeployments(ApplicationDeployment elem) {
- if (this.applicationDeployments == null) {
- this.applicationDeployments = new ArrayList<ApplicationDeployment>();
- }
- this.applicationDeployments.add(elem);
- }
-
- public List<ApplicationDeployment> getApplicationDeployments() {
- return this.applicationDeployments;
- }
-
- public void setApplicationDeployments(List<ApplicationDeployment> applicationDeployments) {
- this.applicationDeployments = applicationDeployments;
- }
-
- public void unsetApplicationDeployments() {
- this.applicationDeployments = null;
- }
-
- /** Returns true if field applicationDeployments is set (has been assigned a value) and false otherwise */
- public boolean isSetApplicationDeployments() {
- return this.applicationDeployments != null;
- }
-
- public void setApplicationDeploymentsIsSet(boolean value) {
- if (!value) {
- this.applicationDeployments = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case APPLICATION_INTERFACE_ID:
- if (value == null) {
- unsetApplicationInterfaceId();
- } else {
- setApplicationInterfaceId((String)value);
- }
- break;
-
- case APPLICATION_INTERFACE_DATA:
- if (value == null) {
- unsetApplicationInterfaceData();
- } else {
- setApplicationInterfaceData((String)value);
- }
- break;
-
- case APPLICATION_DEPLOYMENTS:
- if (value == null) {
- unsetApplicationDeployments();
- } else {
- setApplicationDeployments((List<ApplicationDeployment>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case APPLICATION_INTERFACE_ID:
- return getApplicationInterfaceId();
-
- case APPLICATION_INTERFACE_DATA:
- return getApplicationInterfaceData();
-
- case APPLICATION_DEPLOYMENTS:
- return getApplicationDeployments();
-
- }
- 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 APPLICATION_INTERFACE_ID:
- return isSetApplicationInterfaceId();
- case APPLICATION_INTERFACE_DATA:
- return isSetApplicationInterfaceData();
- case APPLICATION_DEPLOYMENTS:
- return isSetApplicationDeployments();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ApplicationInterface)
- return this.equals((ApplicationInterface)that);
- return false;
- }
-
- public boolean equals(ApplicationInterface that) {
- if (that == null)
- return false;
-
- boolean this_present_applicationInterfaceId = true && this.isSetApplicationInterfaceId();
- boolean that_present_applicationInterfaceId = true && that.isSetApplicationInterfaceId();
- if (this_present_applicationInterfaceId || that_present_applicationInterfaceId) {
- if (!(this_present_applicationInterfaceId && that_present_applicationInterfaceId))
- return false;
- if (!this.applicationInterfaceId.equals(that.applicationInterfaceId))
- return false;
- }
-
- boolean this_present_applicationInterfaceData = true && this.isSetApplicationInterfaceData();
- boolean that_present_applicationInterfaceData = true && that.isSetApplicationInterfaceData();
- if (this_present_applicationInterfaceData || that_present_applicationInterfaceData) {
- if (!(this_present_applicationInterfaceData && that_present_applicationInterfaceData))
- return false;
- if (!this.applicationInterfaceData.equals(that.applicationInterfaceData))
- return false;
- }
-
- boolean this_present_applicationDeployments = true && this.isSetApplicationDeployments();
- boolean that_present_applicationDeployments = true && that.isSetApplicationDeployments();
- if (this_present_applicationDeployments || that_present_applicationDeployments) {
- if (!(this_present_applicationDeployments && that_present_applicationDeployments))
- return false;
- if (!this.applicationDeployments.equals(that.applicationDeployments))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(ApplicationInterface other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetApplicationInterfaceId()).compareTo(other.isSetApplicationInterfaceId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetApplicationInterfaceId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationInterfaceId, other.applicationInterfaceId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetApplicationInterfaceData()).compareTo(other.isSetApplicationInterfaceData());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetApplicationInterfaceData()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationInterfaceData, other.applicationInterfaceData);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetApplicationDeployments()).compareTo(other.isSetApplicationDeployments());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetApplicationDeployments()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationDeployments, other.applicationDeployments);
- 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("ApplicationInterface(");
- boolean first = true;
-
- sb.append("applicationInterfaceId:");
- if (this.applicationInterfaceId == null) {
- sb.append("null");
- } else {
- sb.append(this.applicationInterfaceId);
- }
- first = false;
- if (isSetApplicationInterfaceData()) {
- if (!first) sb.append(", ");
- sb.append("applicationInterfaceData:");
- if (this.applicationInterfaceData == null) {
- sb.append("null");
- } else {
- sb.append(this.applicationInterfaceData);
- }
- first = false;
- }
- if (isSetApplicationDeployments()) {
- if (!first) sb.append(", ");
- sb.append("applicationDeployments:");
- if (this.applicationDeployments == null) {
- sb.append("null");
- } else {
- sb.append(this.applicationDeployments);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!isSetApplicationInterfaceId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'applicationInterfaceId' 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 {
- 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 ApplicationInterfaceStandardSchemeFactory implements SchemeFactory {
- public ApplicationInterfaceStandardScheme getScheme() {
- return new ApplicationInterfaceStandardScheme();
- }
- }
-
- private static class ApplicationInterfaceStandardScheme extends StandardScheme<ApplicationInterface> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ApplicationInterface 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: // APPLICATION_INTERFACE_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.applicationInterfaceId = iprot.readString();
- struct.setApplicationInterfaceIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // APPLICATION_INTERFACE_DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.applicationInterfaceData = iprot.readString();
- struct.setApplicationInterfaceDataIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // APPLICATION_DEPLOYMENTS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list60 = iprot.readListBegin();
- struct.applicationDeployments = new ArrayList<ApplicationDeployment>(_list60.size);
- for (int _i61 = 0; _i61 < _list60.size; ++_i61)
- {
- ApplicationDeployment _elem62;
- _elem62 = new ApplicationDeployment();
- _elem62.read(iprot);
- struct.applicationDeployments.add(_elem62);
- }
- iprot.readListEnd();
- }
- struct.setApplicationDeploymentsIsSet(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, ApplicationInterface struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.applicationInterfaceId != null) {
- oprot.writeFieldBegin(APPLICATION_INTERFACE_ID_FIELD_DESC);
- oprot.writeString(struct.applicationInterfaceId);
- oprot.writeFieldEnd();
- }
- if (struct.applicationInterfaceData != null) {
- if (struct.isSetApplicationInterfaceData()) {
- oprot.writeFieldBegin(APPLICATION_INTERFACE_DATA_FIELD_DESC);
- oprot.writeString(struct.applicationInterfaceData);
- oprot.writeFieldEnd();
- }
- }
- if (struct.applicationDeployments != null) {
- if (struct.isSetApplicationDeployments()) {
- oprot.writeFieldBegin(APPLICATION_DEPLOYMENTS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.applicationDeployments.size()));
- for (ApplicationDeployment _iter63 : struct.applicationDeployments)
- {
- _iter63.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ApplicationInterfaceTupleSchemeFactory implements SchemeFactory {
- public ApplicationInterfaceTupleScheme getScheme() {
- return new ApplicationInterfaceTupleScheme();
- }
- }
-
- private static class ApplicationInterfaceTupleScheme extends TupleScheme<ApplicationInterface> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ApplicationInterface struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.applicationInterfaceId);
- BitSet optionals = new BitSet();
- if (struct.isSetApplicationInterfaceData()) {
- optionals.set(0);
- }
- if (struct.isSetApplicationDeployments()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetApplicationInterfaceData()) {
- oprot.writeString(struct.applicationInterfaceData);
- }
- if (struct.isSetApplicationDeployments()) {
- {
- oprot.writeI32(struct.applicationDeployments.size());
- for (ApplicationDeployment _iter64 : struct.applicationDeployments)
- {
- _iter64.write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ApplicationInterface struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.applicationInterfaceId = iprot.readString();
- struct.setApplicationInterfaceIdIsSet(true);
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.applicationInterfaceData = iprot.readString();
- struct.setApplicationInterfaceDataIsSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TList _list65 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.applicationDeployments = new ArrayList<ApplicationDeployment>(_list65.size);
- for (int _i66 = 0; _i66 < _list65.size; ++_i66)
- {
- ApplicationDeployment _elem67;
- _elem67 = new ApplicationDeployment();
- _elem67.read(iprot);
- struct.applicationDeployments.add(_elem67);
- }
- }
- struct.setApplicationDeploymentsIsSet(true);
- }
- }
- }
-
-}
-