You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/02/11 22:03:02 UTC
[11/14] reading thrift version from a property in parent pom
http://git-wip-us.apache.org/repos/asf/airavata/blob/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/airavataAPIConstants.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/airavataAPIConstants.java
deleted file mode 100644
index 5c92e5e..0000000
--- a/airavata-api/airavata-api-sdk/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 AIRAVATA_API_VERSION = "0.12.0";
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
deleted file mode 100644
index 12df56e..0000000
--- a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-
-package org.apache.airavata.api.client;
-
-import org.apache.airavata.api.Airavata;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-public class AiravataClientFactory {
-
- public Airavata.Client createAiravataClient(String serverHost, int serverPort){
- try {
- TTransport transport = new TSocket(serverHost, serverPort);
- transport.open();
- TProtocol protocol = new TBinaryProtocol(transport);
- return new Airavata.Client(protocol);
- } catch (TTransportException e) {
- e.printStackTrace();
- }
- return null;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataClientException.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataClientException.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataClientException.java
deleted file mode 100644
index 8050da8..0000000
--- a/airavata-api/airavata-api-sdk/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<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());
- }
-
- /**
- *
- * @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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // 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 <i>other</i>.
- */
- 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<AiravataClientException> {
-
- 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<AiravataClientException> {
-
- @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/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataErrorType.java
deleted file mode 100644
index 6d9dc2c..0000000
--- a/airavata-api/airavata-api-sdk/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/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AiravataSystemException.java
deleted file mode 100644
index 366fe6e..0000000
--- a/airavata-api/airavata-api-sdk/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<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());
- }
-
- /**
- *
- * @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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // 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 <i>other</i>.
- */
- 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<AiravataSystemException> {
-
- 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<AiravataSystemException> {
-
- @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/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthenticationException.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthenticationException.java
deleted file mode 100644
index 24cc7ea..0000000
--- a/airavata-api/airavata-api-sdk/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<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());
- }
-
- 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // 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 <i>other</i>.
- */
- 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<AuthenticationException> {
-
- 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<AuthenticationException> {
-
- @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/7456b462/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthorizationException.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthorizationException.java b/airavata-api/airavata-api-sdk/src/main/java/org/apache/airavata/api/error/AuthorizationException.java
deleted file mode 100644
index eb56508..0000000
--- a/airavata-api/airavata-api-sdk/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<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());
- }
-
- 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // 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 <i>other</i>.
- */
- 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<AuthorizationException> {
-
- 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<AuthorizationException> {
-
- @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);
- }
- }
-
-}
-