http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataClientException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataClientException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataClientException.java index dfc6630..74192f1 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataClientException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataClientException.java @@ -16,41 +16,14 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown by Airavata Services when a call fails as a result of * a problem that a client may be able to resolve. For example, if the user @@ -66,21 +39,18 @@ import org.slf4j.LoggerFactory; * parameter: If the error applied to a particular input parameter, this will * indicate which parameter. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AiravataClientException extends TException implements org.apache.thrift.TBase<AiravataClientException, AiravataClientException._Fields>, java.io.Serializable, Cloneable, Comparable<AiravataClientException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class AiravataClientException extends org.apache.thrift.TException implements org.apache.thrift.TBase<AiravataClientException, AiravataClientException._Fields>, java.io.Serializable, Cloneable, Comparable<AiravataClientException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AiravataClientException"); private static final org.apache.thrift.protocol.TField AIRAVATA_ERROR_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataErrorType", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PARAMETER_FIELD_DESC = new org.apache.thrift.protocol.TField("parameter", 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 AiravataClientExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AiravataClientExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AiravataClientExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AiravataClientExceptionTupleSchemeFactory(); private AiravataErrorType airavataErrorType; // required - private String parameter; // optional + private java.lang.String parameter; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -91,10 +61,10 @@ public class AiravataClientException extends TException implements org.apache.th AIRAVATA_ERROR_TYPE((short)1, "airavataErrorType"), PARAMETER((short)2, "parameter"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -119,21 +89,21 @@ public class AiravataClientException extends TException implements org.apache.th */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -142,21 +112,21 @@ public class AiravataClientException extends TException implements org.apache.th return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.PARAMETER}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.AIRAVATA_ERROR_TYPE, new org.apache.thrift.meta_data.FieldMetaData("airavataErrorType", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AiravataErrorType.class))); tmpMap.put(_Fields.PARAMETER, new org.apache.thrift.meta_data.FieldMetaData("parameter", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AiravataClientException.class, metaDataMap); } @@ -223,11 +193,11 @@ public class AiravataClientException extends TException implements org.apache.th } } - public String getParameter() { + public java.lang.String getParameter() { return this.parameter; } - public void setParameter(String parameter) { + public void setParameter(java.lang.String parameter) { this.parameter = parameter; } @@ -246,7 +216,7 @@ public class AiravataClientException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case AIRAVATA_ERROR_TYPE: if (value == null) { @@ -260,14 +230,14 @@ public class AiravataClientException extends TException implements org.apache.th if (value == null) { unsetParameter(); } else { - setParameter((String)value); + setParameter((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case AIRAVATA_ERROR_TYPE: return getAiravataErrorType(); @@ -276,13 +246,13 @@ public class AiravataClientException extends TException implements org.apache.th return getParameter(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -291,11 +261,11 @@ public class AiravataClientException extends TException implements org.apache.th case PARAMETER: return isSetParameter(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof AiravataClientException) @@ -306,6 +276,8 @@ public class AiravataClientException extends TException implements org.apache.th public boolean equals(AiravataClientException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_airavataErrorType = true && this.isSetAiravataErrorType(); boolean that_present_airavataErrorType = true && that.isSetAiravataErrorType(); @@ -330,19 +302,17 @@ public class AiravataClientException extends TException implements org.apache.th @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_airavataErrorType = true && (isSetAiravataErrorType()); - list.add(present_airavataErrorType); - if (present_airavataErrorType) - list.add(airavataErrorType.getValue()); + hashCode = hashCode * 8191 + ((isSetAiravataErrorType()) ? 131071 : 524287); + if (isSetAiravataErrorType()) + hashCode = hashCode * 8191 + airavataErrorType.getValue(); - boolean present_parameter = true && (isSetParameter()); - list.add(present_parameter); - if (present_parameter) - list.add(parameter); + hashCode = hashCode * 8191 + ((isSetParameter()) ? 131071 : 524287); + if (isSetParameter()) + hashCode = hashCode * 8191 + parameter.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -353,7 +323,7 @@ public class AiravataClientException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); + lastComparison = java.lang.Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); if (lastComparison != 0) { return lastComparison; } @@ -363,7 +333,7 @@ public class AiravataClientException extends TException implements org.apache.th return lastComparison; } } - lastComparison = Boolean.valueOf(isSetParameter()).compareTo(other.isSetParameter()); + lastComparison = java.lang.Boolean.valueOf(isSetParameter()).compareTo(other.isSetParameter()); if (lastComparison != 0) { return lastComparison; } @@ -381,16 +351,16 @@ public class AiravataClientException extends TException implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("AiravataClientException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("AiravataClientException("); boolean first = true; sb.append("airavataErrorType:"); @@ -431,7 +401,7 @@ public class AiravataClientException extends TException implements org.apache.th } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -439,13 +409,13 @@ public class AiravataClientException extends TException implements org.apache.th } } - private static class AiravataClientExceptionStandardSchemeFactory implements SchemeFactory { + private static class AiravataClientExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AiravataClientExceptionStandardScheme getScheme() { return new AiravataClientExceptionStandardScheme(); } } - private static class AiravataClientExceptionStandardScheme extends StandardScheme<AiravataClientException> { + private static class AiravataClientExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<AiravataClientException> { public void read(org.apache.thrift.protocol.TProtocol iprot, AiravataClientException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -504,19 +474,19 @@ public class AiravataClientException extends TException implements org.apache.th } - private static class AiravataClientExceptionTupleSchemeFactory implements SchemeFactory { + private static class AiravataClientExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AiravataClientExceptionTupleScheme getScheme() { return new AiravataClientExceptionTupleScheme(); } } - private static class AiravataClientExceptionTupleScheme extends TupleScheme<AiravataClientException> { + private static class AiravataClientExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<AiravataClientException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AiravataClientException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.airavataErrorType.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetParameter()) { optionals.set(0); } @@ -528,10 +498,10 @@ public class AiravataClientException extends TException implements org.apache.th @Override public void read(org.apache.thrift.protocol.TProtocol prot, AiravataClientException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.airavataErrorType = org.apache.airavata.model.error.AiravataErrorType.findByValue(iprot.readI32()); struct.setAiravataErrorTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.parameter = iprot.readString(); struct.setParameterIsSet(true); @@ -539,5 +509,8 @@ public class AiravataClientException extends TException implements org.apache.th } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } }
http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataErrorType.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataErrorType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataErrorType.java index 323195f..320f88a 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataErrorType.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataErrorType.java @@ -16,7 +16,7 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java index feb658c..ec00625 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java @@ -16,41 +16,14 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown by Airavata Services when a call fails as a result of * a problem in the service that could not be changed through client's action. @@ -61,21 +34,18 @@ import org.slf4j.LoggerFactory; * message: This may contain additional information about the error * */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AiravataSystemException extends TException implements org.apache.thrift.TBase<AiravataSystemException, AiravataSystemException._Fields>, java.io.Serializable, Cloneable, Comparable<AiravataSystemException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class AiravataSystemException extends org.apache.thrift.TException implements org.apache.thrift.TBase<AiravataSystemException, AiravataSystemException._Fields>, java.io.Serializable, Cloneable, Comparable<AiravataSystemException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AiravataSystemException"); private static final org.apache.thrift.protocol.TField AIRAVATA_ERROR_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataErrorType", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", 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 AiravataSystemExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AiravataSystemExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AiravataSystemExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AiravataSystemExceptionTupleSchemeFactory(); private AiravataErrorType airavataErrorType; // required - private String message; // optional + private java.lang.String message; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -86,10 +56,10 @@ public class AiravataSystemException extends TException implements org.apache.th AIRAVATA_ERROR_TYPE((short)1, "airavataErrorType"), MESSAGE((short)2, "message"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -114,21 +84,21 @@ public class AiravataSystemException extends TException implements org.apache.th */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -137,21 +107,21 @@ public class AiravataSystemException extends TException implements org.apache.th return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.AIRAVATA_ERROR_TYPE, new org.apache.thrift.meta_data.FieldMetaData("airavataErrorType", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AiravataErrorType.class))); tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AiravataSystemException.class, metaDataMap); } @@ -218,11 +188,11 @@ public class AiravataSystemException extends TException implements org.apache.th } } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -241,7 +211,7 @@ public class AiravataSystemException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case AIRAVATA_ERROR_TYPE: if (value == null) { @@ -255,14 +225,14 @@ public class AiravataSystemException extends TException implements org.apache.th if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case AIRAVATA_ERROR_TYPE: return getAiravataErrorType(); @@ -271,13 +241,13 @@ public class AiravataSystemException extends TException implements org.apache.th return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -286,11 +256,11 @@ public class AiravataSystemException extends TException implements org.apache.th case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof AiravataSystemException) @@ -301,6 +271,8 @@ public class AiravataSystemException extends TException implements org.apache.th public boolean equals(AiravataSystemException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_airavataErrorType = true && this.isSetAiravataErrorType(); boolean that_present_airavataErrorType = true && that.isSetAiravataErrorType(); @@ -325,19 +297,17 @@ public class AiravataSystemException extends TException implements org.apache.th @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_airavataErrorType = true && (isSetAiravataErrorType()); - list.add(present_airavataErrorType); - if (present_airavataErrorType) - list.add(airavataErrorType.getValue()); + hashCode = hashCode * 8191 + ((isSetAiravataErrorType()) ? 131071 : 524287); + if (isSetAiravataErrorType()) + hashCode = hashCode * 8191 + airavataErrorType.getValue(); - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -348,7 +318,7 @@ public class AiravataSystemException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); + lastComparison = java.lang.Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); if (lastComparison != 0) { return lastComparison; } @@ -358,7 +328,7 @@ public class AiravataSystemException extends TException implements org.apache.th return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -376,16 +346,16 @@ public class AiravataSystemException extends TException implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("AiravataSystemException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("AiravataSystemException("); boolean first = true; sb.append("airavataErrorType:"); @@ -426,7 +396,7 @@ public class AiravataSystemException extends TException implements org.apache.th } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -434,13 +404,13 @@ public class AiravataSystemException extends TException implements org.apache.th } } - private static class AiravataSystemExceptionStandardSchemeFactory implements SchemeFactory { + private static class AiravataSystemExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AiravataSystemExceptionStandardScheme getScheme() { return new AiravataSystemExceptionStandardScheme(); } } - private static class AiravataSystemExceptionStandardScheme extends StandardScheme<AiravataSystemException> { + private static class AiravataSystemExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<AiravataSystemException> { public void read(org.apache.thrift.protocol.TProtocol iprot, AiravataSystemException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -499,19 +469,19 @@ public class AiravataSystemException extends TException implements org.apache.th } - private static class AiravataSystemExceptionTupleSchemeFactory implements SchemeFactory { + private static class AiravataSystemExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AiravataSystemExceptionTupleScheme getScheme() { return new AiravataSystemExceptionTupleScheme(); } } - private static class AiravataSystemExceptionTupleScheme extends TupleScheme<AiravataSystemException> { + private static class AiravataSystemExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<AiravataSystemException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AiravataSystemException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.airavataErrorType.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetMessage()) { optionals.set(0); } @@ -523,10 +493,10 @@ public class AiravataSystemException extends TException implements org.apache.th @Override public void read(org.apache.thrift.protocol.TProtocol prot, AiravataSystemException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.airavataErrorType = org.apache.airavata.model.error.AiravataErrorType.findByValue(iprot.readI32()); struct.setAiravataErrorTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.message = iprot.readString(); struct.setMessageIsSet(true); @@ -534,5 +504,8 @@ public class AiravataSystemException extends TException implements org.apache.th } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java index 8d45a52..1aa546f 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java @@ -16,68 +16,38 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown for invalid sshKeyAuthentication requests. * * message: contains the cause of the authorization failure. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AuthenticationException extends TException implements org.apache.thrift.TBase<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class AuthenticationException extends org.apache.thrift.TException implements org.apache.thrift.TBase<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AuthenticationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AuthenticationExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AuthenticationExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AuthenticationExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MESSAGE((short)1, "message"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -100,21 +70,21 @@ public class AuthenticationException extends TException implements org.apache.th */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -123,18 +93,18 @@ public class AuthenticationException extends TException implements org.apache.th return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap); } @@ -142,7 +112,7 @@ public class AuthenticationException extends TException implements org.apache.th } public AuthenticationException( - String message) + java.lang.String message) { this(); this.message = message; @@ -166,11 +136,11 @@ public class AuthenticationException extends TException implements org.apache.th this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -189,43 +159,43 @@ public class AuthenticationException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof AuthenticationException) @@ -236,6 +206,8 @@ public class AuthenticationException extends TException implements org.apache.th public boolean equals(AuthenticationException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -251,14 +223,13 @@ public class AuthenticationException extends TException implements org.apache.th @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -269,7 +240,7 @@ public class AuthenticationException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -287,16 +258,16 @@ public class AuthenticationException extends TException implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("AuthenticationException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("AuthenticationException("); boolean first = true; sb.append("message:"); @@ -327,7 +298,7 @@ public class AuthenticationException extends TException implements org.apache.th } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -335,13 +306,13 @@ public class AuthenticationException extends TException implements org.apache.th } } - private static class AuthenticationExceptionStandardSchemeFactory implements SchemeFactory { + private static class AuthenticationExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AuthenticationExceptionStandardScheme getScheme() { return new AuthenticationExceptionStandardScheme(); } } - private static class AuthenticationExceptionStandardScheme extends StandardScheme<AuthenticationException> { + private static class AuthenticationExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<AuthenticationException> { public void read(org.apache.thrift.protocol.TProtocol iprot, AuthenticationException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -385,27 +356,30 @@ public class AuthenticationException extends TException implements org.apache.th } - private static class AuthenticationExceptionTupleSchemeFactory implements SchemeFactory { + private static class AuthenticationExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AuthenticationExceptionTupleScheme getScheme() { return new AuthenticationExceptionTupleScheme(); } } - private static class AuthenticationExceptionTupleScheme extends TupleScheme<AuthenticationException> { + private static class AuthenticationExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<AuthenticationException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java index bc27ae6..8c1725c 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java @@ -16,68 +16,38 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown for invalid authorization requests such user does not have acces to an aplication or resource. * * message: contains the authorization failure message */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AuthorizationException extends TException implements org.apache.thrift.TBase<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthorizationException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class AuthorizationException extends org.apache.thrift.TException implements org.apache.thrift.TBase<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthorizationException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AuthorizationExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AuthorizationExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MESSAGE((short)1, "message"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -100,21 +70,21 @@ public class AuthorizationException extends TException implements org.apache.thr */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -123,18 +93,18 @@ public class AuthorizationException extends TException implements org.apache.thr return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthorizationException.class, metaDataMap); } @@ -142,7 +112,7 @@ public class AuthorizationException extends TException implements org.apache.thr } public AuthorizationException( - String message) + java.lang.String message) { this(); this.message = message; @@ -166,11 +136,11 @@ public class AuthorizationException extends TException implements org.apache.thr this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -189,43 +159,43 @@ public class AuthorizationException extends TException implements org.apache.thr } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof AuthorizationException) @@ -236,6 +206,8 @@ public class AuthorizationException extends TException implements org.apache.thr public boolean equals(AuthorizationException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -251,14 +223,13 @@ public class AuthorizationException extends TException implements org.apache.thr @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -269,7 +240,7 @@ public class AuthorizationException extends TException implements org.apache.thr int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -287,16 +258,16 @@ public class AuthorizationException extends TException implements org.apache.thr } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("AuthorizationException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("AuthorizationException("); boolean first = true; sb.append("message:"); @@ -327,7 +298,7 @@ public class AuthorizationException extends TException implements org.apache.thr } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -335,13 +306,13 @@ public class AuthorizationException extends TException implements org.apache.thr } } - private static class AuthorizationExceptionStandardSchemeFactory implements SchemeFactory { + private static class AuthorizationExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AuthorizationExceptionStandardScheme getScheme() { return new AuthorizationExceptionStandardScheme(); } } - private static class AuthorizationExceptionStandardScheme extends StandardScheme<AuthorizationException> { + private static class AuthorizationExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<AuthorizationException> { public void read(org.apache.thrift.protocol.TProtocol iprot, AuthorizationException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -385,27 +356,30 @@ public class AuthorizationException extends TException implements org.apache.thr } - private static class AuthorizationExceptionTupleSchemeFactory implements SchemeFactory { + private static class AuthorizationExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public AuthorizationExceptionTupleScheme getScheme() { return new AuthorizationExceptionTupleScheme(); } } - private static class AuthorizationExceptionTupleScheme extends TupleScheme<AuthorizationException> { + private static class AuthorizationExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<AuthorizationException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/8e775660/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/DuplicateEntryException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/DuplicateEntryException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/DuplicateEntryException.java index 27b3947..a22dcc8 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/DuplicateEntryException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/DuplicateEntryException.java @@ -16,41 +16,14 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown when you try to save a duplicate entity that already exists * in the database. @@ -58,28 +31,25 @@ import org.slf4j.LoggerFactory; * message: contains the associated error message * */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class DuplicateEntryException extends TException implements org.apache.thrift.TBase<DuplicateEntryException, DuplicateEntryException._Fields>, java.io.Serializable, Cloneable, Comparable<DuplicateEntryException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class DuplicateEntryException extends org.apache.thrift.TException implements org.apache.thrift.TBase<DuplicateEntryException, DuplicateEntryException._Fields>, java.io.Serializable, Cloneable, Comparable<DuplicateEntryException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DuplicateEntryException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new DuplicateEntryExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DuplicateEntryExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DuplicateEntryExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DuplicateEntryExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MESSAGE((short)1, "message"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -102,21 +72,21 @@ public class DuplicateEntryException extends TException implements org.apache.th */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -125,18 +95,18 @@ public class DuplicateEntryException extends TException implements org.apache.th return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DuplicateEntryException.class, metaDataMap); } @@ -144,7 +114,7 @@ public class DuplicateEntryException extends TException implements org.apache.th } public DuplicateEntryException( - String message) + java.lang.String message) { this(); this.message = message; @@ -168,11 +138,11 @@ public class DuplicateEntryException extends TException implements org.apache.th this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -191,43 +161,43 @@ public class DuplicateEntryException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof DuplicateEntryException) @@ -238,6 +208,8 @@ public class DuplicateEntryException extends TException implements org.apache.th public boolean equals(DuplicateEntryException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -253,14 +225,13 @@ public class DuplicateEntryException extends TException implements org.apache.th @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -271,7 +242,7 @@ public class DuplicateEntryException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -289,16 +260,16 @@ public class DuplicateEntryException extends TException implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("DuplicateEntryException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("DuplicateEntryException("); boolean first = true; sb.append("message:"); @@ -329,7 +300,7 @@ public class DuplicateEntryException extends TException implements org.apache.th } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -337,13 +308,13 @@ public class DuplicateEntryException extends TException implements org.apache.th } } - private static class DuplicateEntryExceptionStandardSchemeFactory implements SchemeFactory { + private static class DuplicateEntryExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DuplicateEntryExceptionStandardScheme getScheme() { return new DuplicateEntryExceptionStandardScheme(); } } - private static class DuplicateEntryExceptionStandardScheme extends StandardScheme<DuplicateEntryException> { + private static class DuplicateEntryExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<DuplicateEntryException> { public void read(org.apache.thrift.protocol.TProtocol iprot, DuplicateEntryException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -387,27 +358,30 @@ public class DuplicateEntryException extends TException implements org.apache.th } - private static class DuplicateEntryExceptionTupleSchemeFactory implements SchemeFactory { + private static class DuplicateEntryExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DuplicateEntryExceptionTupleScheme getScheme() { return new DuplicateEntryExceptionTupleScheme(); } } - private static class DuplicateEntryExceptionTupleScheme extends TupleScheme<DuplicateEntryException> { + private static class DuplicateEntryExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<DuplicateEntryException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DuplicateEntryException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DuplicateEntryException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } }