http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/airavataAPIConstants.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/airavataAPIConstants.java b/airavata-api/server/src/main/java/org/apache/airavata/api/airavataAPIConstants.java deleted file mode 100644 index 43739d7..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/airavataAPIConstants.java +++ /dev/null @@ -1,55 +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.api; - -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 airavataAPIConstants { - - public static final String VERSION = "0.12.0"; - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataClientException.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataClientException.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataClientException.java deleted file mode 100644 index 8050da8..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataClientException.java +++ /dev/null @@ -1,534 +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.api.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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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 - * attempts to execute an application on a resource gateway does not have access to. - * - * This exception would not be used for internal system errors that do not - * reflect user actions, but rather reflect a problem within the service that - * the client cannot resolve. - * - * airavataErrorType: The message type indicating the error that occurred. - * must be one of the values of AiravataErrorType. - * - * parameter: If the error applied to a particular input parameter, this will - * indicate which parameter. - */ -@SuppressWarnings("all") public class AiravataClientException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AiravataClientExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AiravataClientExceptionTupleSchemeFactory()); - } - - /** - * - * @see AiravataErrorType - */ - public AiravataErrorType airavataErrorType; // required - public String parameter; // 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 { - /** - * - * @see AiravataErrorType - */ - AIRAVATA_ERROR_TYPE((short)1, "airavataErrorType"), - PARAMETER((short)2, "parameter"); - - private static final Map byName = new HashMap(); - - 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: // AIRAVATA_ERROR_TYPE - return AIRAVATA_ERROR_TYPE; - case 2: // PARAMETER - return PARAMETER; - 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.PARAMETER}; - 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.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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AiravataClientException.class, metaDataMap); - } - - public AiravataClientException() { - } - - public AiravataClientException( - AiravataErrorType airavataErrorType) - { - this(); - this.airavataErrorType = airavataErrorType; - } - - /** - * Performs a deep copy on other. - */ - public AiravataClientException(AiravataClientException other) { - if (other.isSetAiravataErrorType()) { - this.airavataErrorType = other.airavataErrorType; - } - if (other.isSetParameter()) { - this.parameter = other.parameter; - } - } - - public AiravataClientException deepCopy() { - return new AiravataClientException(this); - } - - @Override - public void clear() { - this.airavataErrorType = null; - this.parameter = null; - } - - /** - * - * @see AiravataErrorType - */ - public AiravataErrorType getAiravataErrorType() { - return this.airavataErrorType; - } - - /** - * - * @see AiravataErrorType - */ - public AiravataClientException setAiravataErrorType(AiravataErrorType airavataErrorType) { - this.airavataErrorType = airavataErrorType; - return this; - } - - public void unsetAiravataErrorType() { - this.airavataErrorType = null; - } - - /** Returns true if field airavataErrorType is set (has been assigned a value) and false otherwise */ - public boolean isSetAiravataErrorType() { - return this.airavataErrorType != null; - } - - public void setAiravataErrorTypeIsSet(boolean value) { - if (!value) { - this.airavataErrorType = null; - } - } - - public String getParameter() { - return this.parameter; - } - - public AiravataClientException setParameter(String parameter) { - this.parameter = parameter; - return this; - } - - public void unsetParameter() { - this.parameter = null; - } - - /** Returns true if field parameter is set (has been assigned a value) and false otherwise */ - public boolean isSetParameter() { - return this.parameter != null; - } - - public void setParameterIsSet(boolean value) { - if (!value) { - this.parameter = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AIRAVATA_ERROR_TYPE: - if (value == null) { - unsetAiravataErrorType(); - } else { - setAiravataErrorType((AiravataErrorType)value); - } - break; - - case PARAMETER: - if (value == null) { - unsetParameter(); - } else { - setParameter((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AIRAVATA_ERROR_TYPE: - return getAiravataErrorType(); - - case PARAMETER: - return getParameter(); - - } - 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 AIRAVATA_ERROR_TYPE: - return isSetAiravataErrorType(); - case PARAMETER: - return isSetParameter(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof AiravataClientException) - return this.equals((AiravataClientException)that); - return false; - } - - public boolean equals(AiravataClientException that) { - if (that == null) - return false; - - boolean this_present_airavataErrorType = true && this.isSetAiravataErrorType(); - boolean that_present_airavataErrorType = true && that.isSetAiravataErrorType(); - if (this_present_airavataErrorType || that_present_airavataErrorType) { - if (!(this_present_airavataErrorType && that_present_airavataErrorType)) - return false; - if (!this.airavataErrorType.equals(that.airavataErrorType)) - return false; - } - - boolean this_present_parameter = true && this.isSetParameter(); - boolean that_present_parameter = true && that.isSetParameter(); - if (this_present_parameter || that_present_parameter) { - if (!(this_present_parameter && that_present_parameter)) - return false; - if (!this.parameter.equals(that.parameter)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(AiravataClientException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAiravataErrorType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataErrorType, other.airavataErrorType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParameter()).compareTo(other.isSetParameter()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParameter()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameter, other.parameter); - 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("AiravataClientException("); - boolean first = true; - - sb.append("airavataErrorType:"); - if (this.airavataErrorType == null) { - sb.append("null"); - } else { - sb.append(this.airavataErrorType); - } - first = false; - if (isSetParameter()) { - if (!first) sb.append(", "); - sb.append("parameter:"); - if (this.parameter == null) { - sb.append("null"); - } else { - sb.append(this.parameter); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (airavataErrorType == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataErrorType' was not present! Struct: " + toString()); - } - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class AiravataClientExceptionStandardSchemeFactory implements SchemeFactory { - public AiravataClientExceptionStandardScheme getScheme() { - return new AiravataClientExceptionStandardScheme(); - } - } - - private static class AiravataClientExceptionStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, AiravataClientException 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: // AIRAVATA_ERROR_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.airavataErrorType = AiravataErrorType.findByValue(iprot.readI32()); - struct.setAiravataErrorTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PARAMETER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parameter = iprot.readString(); - struct.setParameterIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, AiravataClientException struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.airavataErrorType != null) { - oprot.writeFieldBegin(AIRAVATA_ERROR_TYPE_FIELD_DESC); - oprot.writeI32(struct.airavataErrorType.getValue()); - oprot.writeFieldEnd(); - } - if (struct.parameter != null) { - if (struct.isSetParameter()) { - oprot.writeFieldBegin(PARAMETER_FIELD_DESC); - oprot.writeString(struct.parameter); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class AiravataClientExceptionTupleSchemeFactory implements SchemeFactory { - public AiravataClientExceptionTupleScheme getScheme() { - return new AiravataClientExceptionTupleScheme(); - } - } - - private static class AiravataClientExceptionTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, AiravataClientException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.airavataErrorType.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetParameter()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetParameter()) { - oprot.writeString(struct.parameter); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, AiravataClientException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.airavataErrorType = AiravataErrorType.findByValue(iprot.readI32()); - struct.setAiravataErrorTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.parameter = iprot.readString(); - struct.setParameterIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java deleted file mode 100644 index 6d9dc2c..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java +++ /dev/null @@ -1,98 +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.api.error; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -/** - * A list of Airavata API Error Message Types - * - * UNKNOWN: No information available about the error - * - * PERMISSION_DENIED: Not permitted to perform action - * - * INTERNAL_ERROR: Unexpected problem with the service - * - * AUTHENTICATION_FAILURE: The client failed to authenticate. - * - * INVALID_AUTHORIZATION: Security Token and/or Username and/or password is incorrect - * - * AUTHORIZATION_EXPIRED: Authentication token expired - * - * UNKNOWN_GATEWAY_ID: The gateway is not registered with Airavata. - * - * UNSUPPORTED_OPERATION: Operation denied because it is currently unsupported. - */ -@SuppressWarnings("all") public enum AiravataErrorType implements org.apache.thrift.TEnum { - UNKNOWN(0), - PERMISSION_DENIED(1), - INTERNAL_ERROR(2), - AUTHENTICATION_FAILURE(3), - INVALID_AUTHORIZATION(4), - AUTHORIZATION_EXPIRED(5), - UNKNOWN_GATEWAY_ID(6), - UNSUPPORTED_OPERATION(7); - - private final int value; - - private AiravataErrorType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static AiravataErrorType findByValue(int value) { - switch (value) { - case 0: - return UNKNOWN; - case 1: - return PERMISSION_DENIED; - case 2: - return INTERNAL_ERROR; - case 3: - return AUTHENTICATION_FAILURE; - case 4: - return INVALID_AUTHORIZATION; - case 5: - return AUTHORIZATION_EXPIRED; - case 6: - return UNKNOWN_GATEWAY_ID; - case 7: - return UNSUPPORTED_OPERATION; - default: - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java deleted file mode 100644 index 366fe6e..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java +++ /dev/null @@ -1,529 +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.api.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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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. - * - * airavataErrorType: The message type indicating the error that occurred. - * must be one of the values of AiravataErrorType. - * - * message: This may contain additional information about the error - * - */ -@SuppressWarnings("all") public class AiravataSystemException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AiravataSystemExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AiravataSystemExceptionTupleSchemeFactory()); - } - - /** - * - * @see AiravataErrorType - */ - public AiravataErrorType airavataErrorType; // required - public String message; // 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 { - /** - * - * @see AiravataErrorType - */ - AIRAVATA_ERROR_TYPE((short)1, "airavataErrorType"), - MESSAGE((short)2, "message"); - - private static final Map byName = new HashMap(); - - 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: // AIRAVATA_ERROR_TYPE - return AIRAVATA_ERROR_TYPE; - case 2: // MESSAGE - return MESSAGE; - 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.MESSAGE}; - 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.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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AiravataSystemException.class, metaDataMap); - } - - public AiravataSystemException() { - } - - public AiravataSystemException( - AiravataErrorType airavataErrorType) - { - this(); - this.airavataErrorType = airavataErrorType; - } - - /** - * Performs a deep copy on other. - */ - public AiravataSystemException(AiravataSystemException other) { - if (other.isSetAiravataErrorType()) { - this.airavataErrorType = other.airavataErrorType; - } - if (other.isSetMessage()) { - this.message = other.message; - } - } - - public AiravataSystemException deepCopy() { - return new AiravataSystemException(this); - } - - @Override - public void clear() { - this.airavataErrorType = null; - this.message = null; - } - - /** - * - * @see AiravataErrorType - */ - public AiravataErrorType getAiravataErrorType() { - return this.airavataErrorType; - } - - /** - * - * @see AiravataErrorType - */ - public AiravataSystemException setAiravataErrorType(AiravataErrorType airavataErrorType) { - this.airavataErrorType = airavataErrorType; - return this; - } - - public void unsetAiravataErrorType() { - this.airavataErrorType = null; - } - - /** Returns true if field airavataErrorType is set (has been assigned a value) and false otherwise */ - public boolean isSetAiravataErrorType() { - return this.airavataErrorType != null; - } - - public void setAiravataErrorTypeIsSet(boolean value) { - if (!value) { - this.airavataErrorType = null; - } - } - - public String getMessage() { - return this.message; - } - - public AiravataSystemException setMessage(String message) { - this.message = message; - return this; - } - - public void unsetMessage() { - this.message = null; - } - - /** Returns true if field message is set (has been assigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; - } - - public void setMessageIsSet(boolean value) { - if (!value) { - this.message = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case AIRAVATA_ERROR_TYPE: - if (value == null) { - unsetAiravataErrorType(); - } else { - setAiravataErrorType((AiravataErrorType)value); - } - break; - - case MESSAGE: - if (value == null) { - unsetMessage(); - } else { - setMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case AIRAVATA_ERROR_TYPE: - return getAiravataErrorType(); - - case MESSAGE: - return getMessage(); - - } - 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 AIRAVATA_ERROR_TYPE: - return isSetAiravataErrorType(); - case MESSAGE: - return isSetMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof AiravataSystemException) - return this.equals((AiravataSystemException)that); - return false; - } - - public boolean equals(AiravataSystemException that) { - if (that == null) - return false; - - boolean this_present_airavataErrorType = true && this.isSetAiravataErrorType(); - boolean that_present_airavataErrorType = true && that.isSetAiravataErrorType(); - if (this_present_airavataErrorType || that_present_airavataErrorType) { - if (!(this_present_airavataErrorType && that_present_airavataErrorType)) - return false; - if (!this.airavataErrorType.equals(that.airavataErrorType)) - return false; - } - - boolean this_present_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) - return false; - if (!this.message.equals(that.message)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(AiravataSystemException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetAiravataErrorType()).compareTo(other.isSetAiravataErrorType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAiravataErrorType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataErrorType, other.airavataErrorType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); - 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("AiravataSystemException("); - boolean first = true; - - sb.append("airavataErrorType:"); - if (this.airavataErrorType == null) { - sb.append("null"); - } else { - sb.append(this.airavataErrorType); - } - first = false; - if (isSetMessage()) { - if (!first) sb.append(", "); - sb.append("message:"); - if (this.message == null) { - sb.append("null"); - } else { - sb.append(this.message); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (airavataErrorType == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataErrorType' was not present! Struct: " + toString()); - } - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class AiravataSystemExceptionStandardSchemeFactory implements SchemeFactory { - public AiravataSystemExceptionStandardScheme getScheme() { - return new AiravataSystemExceptionStandardScheme(); - } - } - - private static class AiravataSystemExceptionStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, AiravataSystemException 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: // AIRAVATA_ERROR_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.airavataErrorType = AiravataErrorType.findByValue(iprot.readI32()); - struct.setAiravataErrorTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, AiravataSystemException struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.airavataErrorType != null) { - oprot.writeFieldBegin(AIRAVATA_ERROR_TYPE_FIELD_DESC); - oprot.writeI32(struct.airavataErrorType.getValue()); - oprot.writeFieldEnd(); - } - if (struct.message != null) { - if (struct.isSetMessage()) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(struct.message); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class AiravataSystemExceptionTupleSchemeFactory implements SchemeFactory { - public AiravataSystemExceptionTupleScheme getScheme() { - return new AiravataSystemExceptionTupleScheme(); - } - } - - private static class AiravataSystemExceptionTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, AiravataSystemException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.airavataErrorType.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetMessage()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetMessage()) { - oprot.writeString(struct.message); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, AiravataSystemException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.airavataErrorType = AiravataErrorType.findByValue(iprot.readI32()); - struct.setAiravataErrorTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthenticationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthenticationException.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthenticationException.java deleted file mode 100644 index 24cc7ea..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthenticationException.java +++ /dev/null @@ -1,402 +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.api.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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This exception is thrown for invalid authentication requests. - * - * message: contains the cause of the authorization failure. - */ -@SuppressWarnings("all") public class AuthenticationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AuthenticationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AuthenticationExceptionTupleSchemeFactory()); - } - - public String message; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { - MESSAGE((short)1, "message"); - - private static final Map byName = new HashMap(); - - 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: // MESSAGE - return MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap); - } - - public AuthenticationException() { - } - - public AuthenticationException( - String message) - { - this(); - this.message = message; - } - - /** - * Performs a deep copy on other. - */ - public AuthenticationException(AuthenticationException other) { - if (other.isSetMessage()) { - this.message = other.message; - } - } - - public AuthenticationException deepCopy() { - return new AuthenticationException(this); - } - - @Override - public void clear() { - this.message = null; - } - - public String getMessage() { - return this.message; - } - - public AuthenticationException setMessage(String message) { - this.message = message; - return this; - } - - public void unsetMessage() { - this.message = null; - } - - /** Returns true if field message is set (has been assigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; - } - - public void setMessageIsSet(boolean value) { - if (!value) { - this.message = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MESSAGE: - if (value == null) { - unsetMessage(); - } else { - setMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MESSAGE: - return getMessage(); - - } - 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 MESSAGE: - return isSetMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof AuthenticationException) - return this.equals((AuthenticationException)that); - return false; - } - - public boolean equals(AuthenticationException that) { - if (that == null) - return false; - - boolean this_present_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) - return false; - if (!this.message.equals(that.message)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(AuthenticationException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); - 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("AuthenticationException("); - boolean first = true; - - sb.append("message:"); - if (this.message == null) { - sb.append("null"); - } else { - sb.append(this.message); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (message == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString()); - } - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class AuthenticationExceptionStandardSchemeFactory implements SchemeFactory { - public AuthenticationExceptionStandardScheme getScheme() { - return new AuthenticationExceptionStandardScheme(); - } - } - - private static class AuthenticationExceptionStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, AuthenticationException 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: // MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, AuthenticationException struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(struct.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class AuthenticationExceptionTupleSchemeFactory implements SchemeFactory { - public AuthenticationExceptionTupleScheme getScheme() { - return new AuthenticationExceptionTupleScheme(); - } - } - - private static class AuthenticationExceptionTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (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; - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthorizationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthorizationException.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthorizationException.java deleted file mode 100644 index eb56508..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/AuthorizationException.java +++ /dev/null @@ -1,402 +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.api.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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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 - */ -@SuppressWarnings("all") public class AuthorizationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory()); - } - - public String message; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { - MESSAGE((short)1, "message"); - - private static final Map byName = new HashMap(); - - 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: // MESSAGE - return MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthorizationException.class, metaDataMap); - } - - public AuthorizationException() { - } - - public AuthorizationException( - String message) - { - this(); - this.message = message; - } - - /** - * Performs a deep copy on other. - */ - public AuthorizationException(AuthorizationException other) { - if (other.isSetMessage()) { - this.message = other.message; - } - } - - public AuthorizationException deepCopy() { - return new AuthorizationException(this); - } - - @Override - public void clear() { - this.message = null; - } - - public String getMessage() { - return this.message; - } - - public AuthorizationException setMessage(String message) { - this.message = message; - return this; - } - - public void unsetMessage() { - this.message = null; - } - - /** Returns true if field message is set (has been assigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; - } - - public void setMessageIsSet(boolean value) { - if (!value) { - this.message = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MESSAGE: - if (value == null) { - unsetMessage(); - } else { - setMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MESSAGE: - return getMessage(); - - } - 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 MESSAGE: - return isSetMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof AuthorizationException) - return this.equals((AuthorizationException)that); - return false; - } - - public boolean equals(AuthorizationException that) { - if (that == null) - return false; - - boolean this_present_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) - return false; - if (!this.message.equals(that.message)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(AuthorizationException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); - 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("AuthorizationException("); - boolean first = true; - - sb.append("message:"); - if (this.message == null) { - sb.append("null"); - } else { - sb.append(this.message); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (message == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString()); - } - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class AuthorizationExceptionStandardSchemeFactory implements SchemeFactory { - public AuthorizationExceptionStandardScheme getScheme() { - return new AuthorizationExceptionStandardScheme(); - } - } - - private static class AuthorizationExceptionStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, AuthorizationException 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: // MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, AuthorizationException struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(struct.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class AuthorizationExceptionTupleSchemeFactory implements SchemeFactory { - public AuthorizationExceptionTupleScheme getScheme() { - return new AuthorizationExceptionTupleScheme(); - } - } - - private static class AuthorizationExceptionTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (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; - struct.message = iprot.readString(); - struct.setMessageIsSet(true); - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/fc927c6c/airavata-api/server/src/main/java/org/apache/airavata/api/error/ExperimentNotFoundException.java ---------------------------------------------------------------------- diff --git a/airavata-api/server/src/main/java/org/apache/airavata/api/error/ExperimentNotFoundException.java b/airavata-api/server/src/main/java/org/apache/airavata/api/error/ExperimentNotFoundException.java deleted file mode 100644 index 9b1044b..0000000 --- a/airavata-api/server/src/main/java/org/apache/airavata/api/error/ExperimentNotFoundException.java +++ /dev/null @@ -1,511 +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.api.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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This exception is thrown when a client asks to perform an operation on an experiment that does not exist. - * - * identifier: A description of the experiment that was not found on the server. - * - * key: The value passed from the client in the identifier, which was not found. - */ -@SuppressWarnings("all") public class ExperimentNotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExperimentNotFoundException"); - - private static final org.apache.thrift.protocol.TField IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("identifier", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExperimentNotFoundExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExperimentNotFoundExceptionTupleSchemeFactory()); - } - - public String identifier; // optional - public String key; // 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 { - IDENTIFIER((short)1, "identifier"), - KEY((short)2, "key"); - - private static final Map byName = new HashMap(); - - 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: // IDENTIFIER - return IDENTIFIER; - case 2: // KEY - return KEY; - 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.IDENTIFIER,_Fields.KEY}; - 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.IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("identifier", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", 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(ExperimentNotFoundException.class, metaDataMap); - } - - public ExperimentNotFoundException() { - } - - /** - * Performs a deep copy on other. - */ - public ExperimentNotFoundException(ExperimentNotFoundException other) { - if (other.isSetIdentifier()) { - this.identifier = other.identifier; - } - if (other.isSetKey()) { - this.key = other.key; - } - } - - public ExperimentNotFoundException deepCopy() { - return new ExperimentNotFoundException(this); - } - - @Override - public void clear() { - this.identifier = null; - this.key = null; - } - - public String getIdentifier() { - return this.identifier; - } - - public ExperimentNotFoundException setIdentifier(String identifier) { - this.identifier = identifier; - return this; - } - - public void unsetIdentifier() { - this.identifier = null; - } - - /** Returns true if field identifier is set (has been assigned a value) and false otherwise */ - public boolean isSetIdentifier() { - return this.identifier != null; - } - - public void setIdentifierIsSet(boolean value) { - if (!value) { - this.identifier = null; - } - } - - public String getKey() { - return this.key; - } - - public ExperimentNotFoundException setKey(String key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IDENTIFIER: - if (value == null) { - unsetIdentifier(); - } else { - setIdentifier((String)value); - } - break; - - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IDENTIFIER: - return getIdentifier(); - - case KEY: - return getKey(); - - } - 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 IDENTIFIER: - return isSetIdentifier(); - case KEY: - return isSetKey(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ExperimentNotFoundException) - return this.equals((ExperimentNotFoundException)that); - return false; - } - - public boolean equals(ExperimentNotFoundException that) { - if (that == null) - return false; - - boolean this_present_identifier = true && this.isSetIdentifier(); - boolean that_present_identifier = true && that.isSetIdentifier(); - if (this_present_identifier || that_present_identifier) { - if (!(this_present_identifier && that_present_identifier)) - return false; - if (!this.identifier.equals(that.identifier)) - return false; - } - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(ExperimentNotFoundException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetIdentifier()).compareTo(other.isSetIdentifier()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIdentifier()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.identifier, other.identifier); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - 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("ExperimentNotFoundException("); - boolean first = true; - - if (isSetIdentifier()) { - sb.append("identifier:"); - if (this.identifier == null) { - sb.append("null"); - } else { - sb.append(this.identifier); - } - first = false; - } - if (isSetKey()) { - if (!first) sb.append(", "); - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ExperimentNotFoundExceptionStandardSchemeFactory implements SchemeFactory { - public ExperimentNotFoundExceptionStandardScheme getScheme() { - return new ExperimentNotFoundExceptionStandardScheme(); - } - } - - private static class ExperimentNotFoundExceptionStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExperimentNotFoundException 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: // IDENTIFIER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.identifier = iprot.readString(); - struct.setIdentifierIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.key = iprot.readString(); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.identifier != null) { - if (struct.isSetIdentifier()) { - oprot.writeFieldBegin(IDENTIFIER_FIELD_DESC); - oprot.writeString(struct.identifier); - oprot.writeFieldEnd(); - } - } - if (struct.key != null) { - if (struct.isSetKey()) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeString(struct.key); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ExperimentNotFoundExceptionTupleSchemeFactory implements SchemeFactory { - public ExperimentNotFoundExceptionTupleScheme getScheme() { - return new ExperimentNotFoundExceptionTupleScheme(); - } - } - - private static class ExperimentNotFoundExceptionTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetIdentifier()) { - optionals.set(0); - } - if (struct.isSetKey()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetIdentifier()) { - oprot.writeString(struct.identifier); - } - if (struct.isSetKey()) { - oprot.writeString(struct.key); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.identifier = iprot.readString(); - struct.setIdentifierIsSet(true); - } - if (incoming.get(1)) { - struct.key = iprot.readString(); - struct.setKeyIsSet(true); - } - } - } - -} -