Repository: airavata Updated Branches: refs/heads/master c83330e98 -> 125098de1
http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java index 3acb088..0389560 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AiravataSystemException.java @@ -28,16 +28,27 @@ 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. * @@ -59,12 +70,8 @@ import java.util.BitSet; schemes.put(TupleScheme.class, new AiravataSystemExceptionTupleSchemeFactory()); } - /** - * - * @see AiravataErrorType - */ - public AiravataErrorType airavataErrorType; // required - public String message; // optional + private AiravataErrorType airavataErrorType; // required + private 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 { @@ -188,9 +195,8 @@ import java.util.BitSet; * * @see AiravataErrorType */ - public AiravataSystemException setAiravataErrorType(AiravataErrorType airavataErrorType) { + public void setAiravataErrorType(AiravataErrorType airavataErrorType) { this.airavataErrorType = airavataErrorType; - return this; } public void unsetAiravataErrorType() { @@ -212,9 +218,8 @@ import java.util.BitSet; return this.message; } - public AiravataSystemException setMessage(String message) { + public void setMessage(String message) { this.message = message; - return this; } public void unsetMessage() { @@ -390,9 +395,10 @@ import java.util.BitSet; 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()); + if (!isSetAiravataErrorType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataErrorType' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -452,8 +458,6 @@ import java.util.BitSet; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java index 28e3896..35710c1 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthenticationException.java @@ -28,15 +28,27 @@ 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. @@ -52,7 +64,7 @@ import java.util.Collections; schemes.put(TupleScheme.class, new AuthenticationExceptionTupleSchemeFactory()); } - public String message; // required + private 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 { @@ -154,9 +166,8 @@ import java.util.Collections; return this.message; } - public AuthenticationException setMessage(String message) { + public void setMessage(String message) { this.message = message; - return this; } public void unsetMessage() { @@ -290,9 +301,10 @@ import java.util.Collections; 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()); + if (!isSetMessage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -344,8 +356,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java index 3a8d1cd..acdabec 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/AuthorizationException.java @@ -28,15 +28,27 @@ 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 @@ -52,7 +64,7 @@ import java.util.Collections; schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory()); } - public String message; // required + private 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 { @@ -154,9 +166,8 @@ import java.util.Collections; return this.message; } - public AuthorizationException setMessage(String message) { + public void setMessage(String message) { this.message = message; - return this; } public void unsetMessage() { @@ -290,9 +301,10 @@ import java.util.Collections; 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()); + if (!isSetMessage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -344,8 +356,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java index 586b6c1..5962251 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java @@ -28,15 +28,27 @@ 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. @@ -54,7 +66,7 @@ import java.util.Collections; schemes.put(TupleScheme.class, new ExperimentNotFoundExceptionTupleSchemeFactory()); } - public String message; // required + private 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 { @@ -156,9 +168,8 @@ import java.util.Collections; return this.message; } - public ExperimentNotFoundException setMessage(String message) { + public void setMessage(String message) { this.message = message; - return this; } public void unsetMessage() { @@ -292,9 +303,10 @@ import java.util.Collections; 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()); + if (!isSetMessage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -346,8 +358,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java index 954428a..549a210 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java @@ -28,15 +28,27 @@ 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 requests that occur from any reasons like required input parameters are missing, * or a parameter is malformed. * @@ -53,7 +65,7 @@ import java.util.Collections; schemes.put(TupleScheme.class, new InvalidRequestExceptionTupleSchemeFactory()); } - public String message; // required + private 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 { @@ -155,9 +167,8 @@ import java.util.Collections; return this.message; } - public InvalidRequestException setMessage(String message) { + public void setMessage(String message) { this.message = message; - return this; } public void unsetMessage() { @@ -291,9 +302,10 @@ import java.util.Collections; 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()); + if (!isSetMessage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -345,8 +357,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java index 0a7ea06..9984abe 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java @@ -28,16 +28,27 @@ 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 LaunchValidationException extends TException implements org.apache.thrift.TBase<LaunchValidationException, LaunchValidationException._Fields>, java.io.Serializable, Cloneable, Comparable<LaunchValidationException> { +@SuppressWarnings("all") public class LaunchValidationException extends TException implements org.apache.thrift.TBase<LaunchValidationException, LaunchValidationException._Fields>, java.io.Serializable, Cloneable, Comparable<LaunchValidationException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LaunchValidationException"); private static final org.apache.thrift.protocol.TField VALIDATION_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("validationResult", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -49,8 +60,8 @@ import java.util.BitSet; schemes.put(TupleScheme.class, new LaunchValidationExceptionTupleSchemeFactory()); } - public ValidationResults validationResult; // required - public String errorMessage; // optional + private ValidationResults validationResult; // required + private String errorMessage; // 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 { @@ -126,8 +137,8 @@ import java.util.BitSet; org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LaunchValidationException.class, metaDataMap); } - public LaunchValidationException() { - } + public LaunchValidationException() { + } public LaunchValidationException( ValidationResults validationResult) @@ -162,9 +173,8 @@ import java.util.BitSet; return this.validationResult; } - public LaunchValidationException setValidationResult(ValidationResults validationResult) { + public void setValidationResult(ValidationResults validationResult) { this.validationResult = validationResult; - return this; } public void unsetValidationResult() { @@ -186,9 +196,8 @@ import java.util.BitSet; return this.errorMessage; } - public LaunchValidationException setErrorMessage(String errorMessage) { + public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; - return this; } public void unsetErrorMessage() { @@ -364,9 +373,10 @@ import java.util.BitSet; public void validate() throws org.apache.thrift.TException { // check for required fields - if (validationResult == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationResult' was not present! Struct: " + toString()); + if (!isSetValidationResult()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationResult' is unset! Struct:" + toString()); } + // check for sub-struct validity if (validationResult != null) { validationResult.validate(); @@ -430,8 +440,6 @@ import java.util.BitSet; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java new file mode 100644 index 0000000..bf072ac --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java @@ -0,0 +1,400 @@ + /* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.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; + +/** + * 1: optional string identifier, + * 2: optional string key + * + */ +@SuppressWarnings("all") public class ProjectNotFoundException extends TException implements org.apache.thrift.TBase<ProjectNotFoundException, ProjectNotFoundException._Fields>, java.io.Serializable, Cloneable, Comparable<ProjectNotFoundException> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ProjectNotFoundException"); + + 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 ProjectNotFoundExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ProjectNotFoundExceptionTupleSchemeFactory()); + } + + private 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(ProjectNotFoundException.class, metaDataMap); + } + + public ProjectNotFoundException() { + } + + public ProjectNotFoundException( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ProjectNotFoundException(ProjectNotFoundException other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public ProjectNotFoundException deepCopy() { + return new ProjectNotFoundException(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + 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 ProjectNotFoundException) + return this.equals((ProjectNotFoundException)that); + return false; + } + + public boolean equals(ProjectNotFoundException 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(ProjectNotFoundException 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("ProjectNotFoundException("); + 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 (!isSetMessage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ProjectNotFoundExceptionStandardSchemeFactory implements SchemeFactory { + public ProjectNotFoundExceptionStandardScheme getScheme() { + return new ProjectNotFoundExceptionStandardScheme(); + } + } + + private static class ProjectNotFoundExceptionStandardScheme extends StandardScheme<ProjectNotFoundException> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ProjectNotFoundException 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(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ProjectNotFoundException 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 ProjectNotFoundExceptionTupleSchemeFactory implements SchemeFactory { + public ProjectNotFoundExceptionTupleScheme getScheme() { + return new ProjectNotFoundExceptionTupleScheme(); + } + } + + private static class ProjectNotFoundExceptionTupleScheme extends TupleScheme<ProjectNotFoundException> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ProjectNotFoundException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.message); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ProjectNotFoundException 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/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java index a7e5616..300c775 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java @@ -28,15 +28,27 @@ 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 RPC timeout gets exceeded. */ @SuppressWarnings("all") public class TimedOutException extends TException implements org.apache.thrift.TBase<TimedOutException, TimedOutException._Fields>, java.io.Serializable, Cloneable, Comparable<TimedOutException> { @@ -249,8 +261,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidationResults.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidationResults.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidationResults.java index f7a67d9..ae75763 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidationResults.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidationResults.java @@ -28,17 +28,27 @@ 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 ValidationResults implements org.apache.thrift.TBase<ValidationResults, ValidationResults._Fields>, java.io.Serializable, Cloneable, Comparable<ValidationResults> { +@SuppressWarnings("all") public class ValidationResults implements org.apache.thrift.TBase<ValidationResults, ValidationResults._Fields>, java.io.Serializable, Cloneable, Comparable<ValidationResults> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ValidationResults"); private static final org.apache.thrift.protocol.TField VALIDATION_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("validationState", org.apache.thrift.protocol.TType.BOOL, (short)1); @@ -50,8 +60,8 @@ import java.util.Collections; schemes.put(TupleScheme.class, new ValidationResultsTupleSchemeFactory()); } - public boolean validationState; // required - public List<ValidatorResult> validationResultList; // required + private boolean validationState; // required + private List<ValidatorResult> validationResultList; // 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 { @@ -172,10 +182,9 @@ import java.util.Collections; return this.validationState; } - public ValidationResults setValidationState(boolean validationState) { + public void setValidationState(boolean validationState) { this.validationState = validationState; setValidationStateIsSet(true); - return this; } public void unsetValidationState() { @@ -210,9 +219,8 @@ import java.util.Collections; return this.validationResultList; } - public ValidationResults setValidationResultList(List<ValidatorResult> validationResultList) { + public void setValidationResultList(List<ValidatorResult> validationResultList) { this.validationResultList = validationResultList; - return this; } public void unsetValidationResultList() { @@ -382,10 +390,14 @@ import java.util.Collections; public void validate() throws org.apache.thrift.TException { // check for required fields - // alas, we cannot check 'validationState' because it's a primitive and you chose the non-beans generator. - if (validationResultList == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationResultList' was not present! Struct: " + toString()); + if (!isSetValidationState()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationState' is unset! Struct:" + toString()); + } + + if (!isSetValidationResultList()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationResultList' is unset! Struct:" + toString()); } + // check for sub-struct validity } @@ -458,11 +470,6 @@ import java.util.Collections; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - if (!struct.isSetValidationState()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'validationState' was not found in serialized data! Struct: " + toString()); - } struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidatorResult.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidatorResult.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidatorResult.java index 413d3be..01f89be 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidatorResult.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ValidatorResult.java @@ -28,16 +28,27 @@ 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 ValidatorResult implements org.apache.thrift.TBase<ValidatorResult, ValidatorResult._Fields>, java.io.Serializable, Cloneable, Comparable<ValidatorResult> { +@SuppressWarnings("all") public class ValidatorResult implements org.apache.thrift.TBase<ValidatorResult, ValidatorResult._Fields>, java.io.Serializable, Cloneable, Comparable<ValidatorResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ValidatorResult"); private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.BOOL, (short)1); @@ -49,8 +60,8 @@ import java.util.BitSet; schemes.put(TupleScheme.class, new ValidatorResultTupleSchemeFactory()); } - public boolean result; // required - public String errorDetails; // optional + private boolean result; // required + private String errorDetails; // 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 { @@ -165,10 +176,9 @@ import java.util.BitSet; return this.result; } - public ValidatorResult setResult(boolean result) { + public void setResult(boolean result) { this.result = result; setResultIsSet(true); - return this; } public void unsetResult() { @@ -188,9 +198,8 @@ import java.util.BitSet; return this.errorDetails; } - public ValidatorResult setErrorDetails(String errorDetails) { + public void setErrorDetails(String errorDetails) { this.errorDetails = errorDetails; - return this; } public void unsetErrorDetails() { @@ -362,7 +371,10 @@ import java.util.BitSet; public void validate() throws org.apache.thrift.TException { // check for required fields - // alas, we cannot check 'result' because it's a primitive and you chose the non-beans generator. + if (!isSetResult()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'result' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -424,11 +436,6 @@ import java.util.BitSet; iprot.readFieldEnd(); } iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - if (!struct.isSetResult()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'result' was not found in serialized data! Struct: " + toString()); - } struct.validate(); } http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/generate-thrift-files.sh ---------------------------------------------------------------------- diff --git a/airavata-api/generate-thrift-files.sh b/airavata-api/generate-thrift-files.sh index fdc84f1..bb2aed9 100755 --- a/airavata-api/generate-thrift-files.sh +++ b/airavata-api/generate-thrift-files.sh @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This script will regenerate the thrift code for Airavata Server Skeltons, Client Stubs and Data Model java beans. +# This script will regenerate the thrift code for Airavata Server Skeletons, Client Stubs and Data Model java beans. # # Credit: This script was created referring to Apache Accumulo project and tuned to Airavata Needs. @@ -28,14 +28,14 @@ JAVA_API_SDK_DIR='airavata-api-stubs/src/main/java' CPP_SDK_DIR='airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib' PHP_SDK_DIR='airavata-client-sdks/airavata-php-sdk/src/main/resources/lib' -# The Funcation fail prints error messages on failure and quits the script. +# The Function fail prints error messages on failure and quits the script. fail() { echo $@ exit 1 } -# The funcation add_license_header adds the ASF V2 license header to all java files within the specified generated -# directory. The funcation also adds suppress all warnings annotation to all public classes and enum's +# The function add_license_header adds the ASF V2 license header to all java files within the specified generated +# directory. The function also adds suppress all warnings annotation to all public classes and enum's # To Call: # add_license_header $generated_code_directory add_license_header() { @@ -44,11 +44,11 @@ add_license_header() { GENERATED_CODE_DIR=$1 # For all generated thrift code, add the suppress all warnings annotation - # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' + # NOTE: In order to save the original file as a backup, use sed -i.orig in place of sed -i '' find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' - # For each java file within the genrated directory, add the ASF V2 LICENSE header + # For each java file within the generated directory, add the ASF V2 LICENSE header for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do cat - ${f} >${f}-with-license <<EOF /* @@ -72,20 +72,20 @@ EOF done } -# The funcation compares every generated java file with the one in specified existing source location. If the comparision +# The function compares every generated java file with the one in specified existing source location. If the comparison # shows a difference, then it replaces with the newly generated file (with added license header). # To Call: # copy_changed_files $generated_code_directory $existing_source_directory copy_changed_files() { - # Read all the funcation arguments + # Read all the function arguments GENERATED_CODE_DIR=$1 WORKSPACE_SRC_DIR=$2 echo "Generated sources are in ${GENERATED_CODE_DIR}" echo "Destination workspace is in ${WORKSPACE_SRC_DIR}" - # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced. + # Check if the newly generated files exist in the targeted workspace, if not copy. Only changed files will be synced. # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied. rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR} } @@ -101,8 +101,8 @@ if [ "$VERSION" -ne 1 ] ; then fail "****************************************************" fi -# Initialize the thrift arguements. -# Since most of the Airavata API and Data Models have includes, use recursive option by defualt. +# Initialize the thrift arguments. +# Since most of the Airavata API and Data Models have includes, use recursive option by default. # Generate all the files in target directory THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}" # Ensure the required target directories exists, if not create. @@ -115,10 +115,10 @@ mkdir -p ${BASE_TARGET_DIR} #Java Beans generation directory JAVA_BEAN_GEN_DIR=${BASE_TARGET_DIR}/gen-javabean -# As a precausion remove and previously generated files if exists +# As a precaution remove and previously generated files if exists rm -rf ${JAVA_BEAN_GEN_DIR} -# Generate the Airavata Data Model using thrify Java Beans generator. This will take generate the classes in bean style +# Generate the Airavata Data Model using thrift Java Beans generator. This will take generate the classes in bean style # with members being private and setters returning voids. # The airavataDataModel.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen java:beans ${THRIFT_IDL_DIR}/airavataDataModel.thrift || fail unable to generate java bean thrift classes on base data model @@ -132,17 +132,17 @@ add_license_header ${JAVA_BEAN_GEN_DIR} copy_changed_files ${JAVA_BEAN_GEN_DIR} ${DATAMODEL_SRC_DIR} ############################################################################### -# Generate/Update source used by Airavata Server Skeltons & Java Client Stubs # +# Generate/Update source used by Airavata Server Skeletons & Java Client Stubs # # JAVA server and client both use generated api-boilerplate-code # ############################################################################### #Java generation directory JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java -# As a precausion remove and previously generated files if exists +# As a precaution remove and previously generated files if exists rm -rf ${JAVA_GEN_DIR} -# Using thrify Java generator, generate the java classes based on Airavata API. This +# Using thrift Java generator, generate the java classes based on Airavata API. This # The airavataAPI.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen java ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate java thrift classes on AiravataAPI @@ -151,7 +151,7 @@ thrift ${THRIFT_ARGS} --gen java ${THRIFT_IDL_DIR}/applicationCatalogAPI.thrift # For the generated java classes add the ASF V2 License header add_license_header $JAVA_GEN_DIR -# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. +# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. copy_changed_files ${JAVA_GEN_DIR}/org/apache/airavata/api ${JAVA_API_SDK_DIR}/org/apache/airavata/api @@ -162,17 +162,17 @@ copy_changed_files ${JAVA_GEN_DIR}/org/apache/airavata/api ${JAVA_API_SDK_DIR}/o #CPP generation directory CPP_GEN_DIR=${BASE_TARGET_DIR}/gen-cpp -# As a precausion remove and previously generated files if exists +# As a precaution remove and previously generated files if exists rm -rf ${CPP_GEN_DIR} -# Using thrify Java generator, generate the java classes based on Airavata API. This +# Using thrift Java generator, generate the java classes based on Airavata API. This # The airavataAPI.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen cpp ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate C++ thrift classes # For the generated java classes add the ASF V2 License header ## TODO Write C++ license parser -# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. +# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. copy_changed_files ${CPP_GEN_DIR} ${CPP_SDK_DIR} @@ -183,17 +183,17 @@ copy_changed_files ${CPP_GEN_DIR} ${CPP_SDK_DIR} #PHP generation directory PHP_GEN_DIR=${BASE_TARGET_DIR}/gen-php -# As a precausion remove and previously generated files if exists +# As a precaution remove and previously generated files if exists rm -rf ${PHP_GEN_DIR} -# Using thrify Java generator, generate the java classes based on Airavata API. This +# Using thrift Java generator, generate the java classes based on Airavata API. This # The airavataAPI.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen php:autoload ${THRIFT_IDL_DIR}/airavataAPI.thrift || fail unable to generate PHP thrift classes # For the generated java classes add the ASF V2 License header ## TODO Write PHP license parser -# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones. +# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones. # Only copying the API related classes and avoiding copy of any data models which already exist in the data-models. copy_changed_files ${PHP_GEN_DIR} ${PHP_SDK_DIR} http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/thrift-interface-descriptions/airavataAPI.thrift ---------------------------------------------------------------------- diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift index 1a2a37b..7b2ec60 100644 --- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift +++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift @@ -81,7 +81,8 @@ service Airavata { 2: required workspaceModel.Project updatedProject) throws (1: airavataErrors.InvalidRequestException ire, 2: airavataErrors.AiravataClientException ace, - 3: airavataErrors.AiravataSystemException ase) + 3: airavataErrors.AiravataSystemException ase, + 4: airavataErrors.ProjectNotFoundException pnfe) /** * Get a Project by ID @@ -90,7 +91,8 @@ service Airavata { workspaceModel.Project getProject (1: required string projectId) throws (1: airavataErrors.InvalidRequestException ire, 2: airavataErrors.AiravataClientException ace, - 3: airavataErrors.AiravataSystemException ase) + 3: airavataErrors.AiravataSystemException ase, + 4: airavataErrors.ProjectNotFoundException pnfe) /** * Get all Project by user @@ -154,7 +156,8 @@ service Airavata { list<experimentModel.Experiment> getAllExperimentsInProject(1: required string projectId) throws (1: airavataErrors.InvalidRequestException ire, 2: airavataErrors.AiravataClientException ace, - 3: airavataErrors.AiravataSystemException ase) + 3: airavataErrors.AiravataSystemException ase, + 4: airavataErrors.ProjectNotFoundException pnfe) /** * Get all Experiments by user http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/thrift-interface-descriptions/airavataDataModel.thrift ---------------------------------------------------------------------- diff --git a/airavata-api/thrift-interface-descriptions/airavataDataModel.thrift b/airavata-api/thrift-interface-descriptions/airavataDataModel.thrift index 1e9b635..ee17fcf 100644 --- a/airavata-api/thrift-interface-descriptions/airavataDataModel.thrift +++ b/airavata-api/thrift-interface-descriptions/airavataDataModel.thrift @@ -19,6 +19,7 @@ */ include "workspaceModel.thrift" +include "airavataErrors.thrift" namespace java org.apache.airavata.model namespace php Airavata.Model http://git-wip-us.apache.org/repos/asf/airavata/blob/125098de/airavata-api/thrift-interface-descriptions/airavataErrors.thrift ---------------------------------------------------------------------- diff --git a/airavata-api/thrift-interface-descriptions/airavataErrors.thrift b/airavata-api/thrift-interface-descriptions/airavataErrors.thrift index cb0f0d9..e0348e0 100644 --- a/airavata-api/thrift-interface-descriptions/airavataErrors.thrift +++ b/airavata-api/thrift-interface-descriptions/airavataErrors.thrift @@ -79,6 +79,10 @@ exception ExperimentNotFoundException { **/ } +exception ProjectNotFoundException { + 1: required string message +} + /** * This exception is thrown for invalid requests that occur from any reasons like required input parameters are missing, * or a parameter is malformed.
