You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2017/04/05 19:10:54 UTC
[30/50] [abbrv] airavata git commit: Modify RegistryService to throw
DuplicateEntryException
Modify RegistryService to throw DuplicateEntryException
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a26520d5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a26520d5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a26520d5
Branch: refs/heads/develop
Commit: a26520d5116781efe0c54c6ed3974d4b2f3e99e2
Parents: 0869c47
Author: Gourav Shenoy <sh...@gmail.com>
Authored: Tue Apr 4 16:33:06 2017 -0400
Committer: Gourav Shenoy <sh...@gmail.com>
Committed: Tue Apr 4 16:33:06 2017 -0400
----------------------------------------------------------------------
.../service/handler/RegistryServerHandler.java | 6 +-
.../RegistryServiceDBEventHandler.java | 2 +-
.../airavata/registry/api/RegistryService.java | 266 +++++++++++++++++--
.../component-cpis/registry-api.thrift | 4 +-
4 files changed, 257 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a26520d5/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 26b21b4..5e1a476 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.registry.api.service.handler;
+import com.sun.org.apache.bcel.internal.generic.DUP;
import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.common.utils.AiravataUtils;
import org.apache.airavata.common.utils.ServerSettings;
@@ -3535,7 +3536,7 @@ public class RegistryServerHandler implements RegistryService.Iface {
* Th unique identifier of the newly registered gateway.
*/
@Override
- public String addGateway(Gateway gateway) throws RegistryServiceException, TException {
+ public String addGateway(Gateway gateway) throws RegistryServiceException, DuplicateEntryException, TException {
try {
experimentCatalog = RegistryFactory.getDefaultExpCatalog();
appCatalog = RegistryFactory.getAppCatalog();
@@ -3545,6 +3546,7 @@ public class RegistryServerHandler implements RegistryService.Iface {
}
// check if gateway exists
if (isGatewayExist(gateway.getGatewayId())) {
+ System.out.println("Gateway with gatewayId: " + gateway.getGatewayId() + ", already exists in ExperimentCatalog.");
throw new DuplicateEntryException("Gateway with gatewayId: " + gateway.getGatewayId() + ", already exists in ExperimentCatalog.");
}
// check if gatewayresourceprofile exists
@@ -3829,7 +3831,7 @@ public class RegistryServerHandler implements RegistryService.Iface {
}
@Override
- public String addUser(UserProfile userProfile) throws RegistryServiceException, TException {
+ public String addUser(UserProfile userProfile) throws RegistryServiceException, DuplicateEntryException, TException {
try {
//FIXME: figure out a way to get password
logger.info("Adding User in Registry: " + userProfile);
http://git-wip-us.apache.org/repos/asf/airavata/blob/a26520d5/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
index 0fb387a..9d44af1 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
@@ -140,7 +140,7 @@ public class RegistryServiceDBEventHandler implements MessageHandler {
logger.error("Handler not defined for Entity: " + publisherContext.getEntityType());
}
}
- } catch (DuplicateEntryException ex) {
+ } catch (RegistryServiceException ex) {
// log this exception and proceed (do nothing)
// this exception is thrown mostly when messages are re-consumed, hence ignore
logger.warn("DuplicateEntryException while consuming db-event message, ex: " + ex.getMessage(), ex);
http://git-wip-us.apache.org/repos/asf/airavata/blob/a26520d5/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
index e096ff2..fd4db42 100644
--- a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
@@ -90,7 +90,7 @@ public class RegistryService {
*
* @param gateway
*/
- public String addGateway(org.apache.airavata.model.workspace.Gateway gateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public String addGateway(org.apache.airavata.model.workspace.Gateway gateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException;
/**
* Get all users in the gateway
@@ -2154,7 +2154,7 @@ public class RegistryService {
*
* @param userProfile
*/
- public String addUser(org.apache.airavata.model.user.UserProfile userProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+ public String addUser(org.apache.airavata.model.user.UserProfile userProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException;
/**
* Add a Compute Resource Preference to a registered user resource profile.
@@ -2812,7 +2812,7 @@ public class RegistryService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isUserExists failed: unknown result");
}
- public String addGateway(org.apache.airavata.model.workspace.Gateway gateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public String addGateway(org.apache.airavata.model.workspace.Gateway gateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException
{
send_addGateway(gateway);
return recv_addGateway();
@@ -2825,7 +2825,7 @@ public class RegistryService {
sendBase("addGateway", args);
}
- public String recv_addGateway() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public String recv_addGateway() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException
{
addGateway_result result = new addGateway_result();
receiveBase(result, "addGateway");
@@ -2835,6 +2835,9 @@ public class RegistryService {
if (result.rse != null) {
throw result.rse;
}
+ if (result.dee != null) {
+ throw result.dee;
+ }
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addGateway failed: unknown result");
}
@@ -6020,7 +6023,7 @@ public class RegistryService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteUserResourceProfile failed: unknown result");
}
- public String addUser(org.apache.airavata.model.user.UserProfile userProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public String addUser(org.apache.airavata.model.user.UserProfile userProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException
{
send_addUser(userProfile);
return recv_addUser();
@@ -6033,7 +6036,7 @@ public class RegistryService {
sendBase("addUser", args);
}
- public String recv_addUser() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException
+ public String recv_addUser() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException
{
addUser_result result = new addUser_result();
receiveBase(result, "addUser");
@@ -6043,6 +6046,9 @@ public class RegistryService {
if (result.rse != null) {
throw result.rse;
}
+ if (result.dee != null) {
+ throw result.dee;
+ }
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addUser failed: unknown result");
}
@@ -6813,7 +6819,7 @@ public class RegistryService {
prot.writeMessageEnd();
}
- public String getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException {
+ public String getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
@@ -10891,7 +10897,7 @@ public class RegistryService {
prot.writeMessageEnd();
}
- public String getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException {
+ public String getResult() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.airavata.model.error.DuplicateEntryException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
@@ -11998,6 +12004,8 @@ public class RegistryService {
result.success = iface.addGateway(args.gateway);
} catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
result.rse = rse;
+ } catch (org.apache.airavata.model.error.DuplicateEntryException dee) {
+ result.dee = dee;
}
return result;
}
@@ -14922,6 +14930,8 @@ public class RegistryService {
result.success = iface.addUser(args.userProfile);
} catch (org.apache.airavata.registry.api.exception.RegistryServiceException rse) {
result.rse = rse;
+ } catch (org.apache.airavata.model.error.DuplicateEntryException dee) {
+ result.dee = dee;
}
return result;
}
@@ -15844,6 +15854,11 @@ public class RegistryService {
result.setRseIsSet(true);
msg = result;
}
+ else if (e instanceof org.apache.airavata.model.error.DuplicateEntryException) {
+ result.dee = (org.apache.airavata.model.error.DuplicateEntryException) e;
+ result.setDeeIsSet(true);
+ msg = result;
+ }
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
@@ -22727,6 +22742,11 @@ public class RegistryService {
result.setRseIsSet(true);
msg = result;
}
+ else if (e instanceof org.apache.airavata.model.error.DuplicateEntryException) {
+ result.dee = (org.apache.airavata.model.error.DuplicateEntryException) e;
+ result.setDeeIsSet(true);
+ msg = result;
+ }
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
@@ -26186,6 +26206,7 @@ public class RegistryService {
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField DEE_FIELD_DESC = new org.apache.thrift.protocol.TField("dee", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -26195,11 +26216,13 @@ public class RegistryService {
public String success; // required
public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // required
+ public org.apache.airavata.model.error.DuplicateEntryException dee; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
- RSE((short)1, "rse");
+ RSE((short)1, "rse"),
+ DEE((short)2, "dee");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -26218,6 +26241,8 @@ public class RegistryService {
return SUCCESS;
case 1: // RSE
return RSE;
+ case 2: // DEE
+ return DEE;
default:
return null;
}
@@ -26265,6 +26290,8 @@ public class RegistryService {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.DEE, new org.apache.thrift.meta_data.FieldMetaData("dee", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addGateway_result.class, metaDataMap);
}
@@ -26274,11 +26301,13 @@ public class RegistryService {
public addGateway_result(
String success,
- org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse,
+ org.apache.airavata.model.error.DuplicateEntryException dee)
{
this();
this.success = success;
this.rse = rse;
+ this.dee = dee;
}
/**
@@ -26291,6 +26320,9 @@ public class RegistryService {
if (other.isSetRse()) {
this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
}
+ if (other.isSetDee()) {
+ this.dee = new org.apache.airavata.model.error.DuplicateEntryException(other.dee);
+ }
}
public addGateway_result deepCopy() {
@@ -26301,6 +26333,7 @@ public class RegistryService {
public void clear() {
this.success = null;
this.rse = null;
+ this.dee = null;
}
public String getSuccess() {
@@ -26351,6 +26384,30 @@ public class RegistryService {
}
}
+ public org.apache.airavata.model.error.DuplicateEntryException getDee() {
+ return this.dee;
+ }
+
+ public addGateway_result setDee(org.apache.airavata.model.error.DuplicateEntryException dee) {
+ this.dee = dee;
+ return this;
+ }
+
+ public void unsetDee() {
+ this.dee = null;
+ }
+
+ /** Returns true if field dee is set (has been assigned a value) and false otherwise */
+ public boolean isSetDee() {
+ return this.dee != null;
+ }
+
+ public void setDeeIsSet(boolean value) {
+ if (!value) {
+ this.dee = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
@@ -26369,6 +26426,14 @@ public class RegistryService {
}
break;
+ case DEE:
+ if (value == null) {
+ unsetDee();
+ } else {
+ setDee((org.apache.airavata.model.error.DuplicateEntryException)value);
+ }
+ break;
+
}
}
@@ -26380,6 +26445,9 @@ public class RegistryService {
case RSE:
return getRse();
+ case DEE:
+ return getDee();
+
}
throw new IllegalStateException();
}
@@ -26395,6 +26463,8 @@ public class RegistryService {
return isSetSuccess();
case RSE:
return isSetRse();
+ case DEE:
+ return isSetDee();
}
throw new IllegalStateException();
}
@@ -26430,6 +26500,15 @@ public class RegistryService {
return false;
}
+ boolean this_present_dee = true && this.isSetDee();
+ boolean that_present_dee = true && that.isSetDee();
+ if (this_present_dee || that_present_dee) {
+ if (!(this_present_dee && that_present_dee))
+ return false;
+ if (!this.dee.equals(that.dee))
+ return false;
+ }
+
return true;
}
@@ -26447,6 +26526,11 @@ public class RegistryService {
if (present_rse)
list.add(rse);
+ boolean present_dee = true && (isSetDee());
+ list.add(present_dee);
+ if (present_dee)
+ list.add(dee);
+
return list.hashCode();
}
@@ -26478,6 +26562,16 @@ public class RegistryService {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetDee()).compareTo(other.isSetDee());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDee()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dee, other.dee);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -26513,6 +26607,14 @@ public class RegistryService {
sb.append(this.rse);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("dee:");
+ if (this.dee == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.dee);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -26573,6 +26675,15 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 2: // DEE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.dee = new org.apache.airavata.model.error.DuplicateEntryException();
+ struct.dee.read(iprot);
+ struct.setDeeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -26598,6 +26709,11 @@ public class RegistryService {
struct.rse.write(oprot);
oprot.writeFieldEnd();
}
+ if (struct.dee != null) {
+ oprot.writeFieldBegin(DEE_FIELD_DESC);
+ struct.dee.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -26622,19 +26738,25 @@ public class RegistryService {
if (struct.isSetRse()) {
optionals.set(1);
}
- oprot.writeBitSet(optionals, 2);
+ if (struct.isSetDee()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
if (struct.isSetRse()) {
struct.rse.write(oprot);
}
+ if (struct.isSetDee()) {
+ struct.dee.write(oprot);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addGateway_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
+ BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
@@ -26644,6 +26766,11 @@ public class RegistryService {
struct.rse.read(iprot);
struct.setRseIsSet(true);
}
+ if (incoming.get(2)) {
+ struct.dee = new org.apache.airavata.model.error.DuplicateEntryException();
+ struct.dee.read(iprot);
+ struct.setDeeIsSet(true);
+ }
}
}
@@ -136031,6 +136158,7 @@ public class RegistryService {
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.protocol.TField RSE_FIELD_DESC = new org.apache.thrift.protocol.TField("rse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField DEE_FIELD_DESC = new org.apache.thrift.protocol.TField("dee", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -136040,11 +136168,13 @@ public class RegistryService {
public String success; // required
public org.apache.airavata.registry.api.exception.RegistryServiceException rse; // required
+ public org.apache.airavata.model.error.DuplicateEntryException dee; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
- RSE((short)1, "rse");
+ RSE((short)1, "rse"),
+ DEE((short)2, "dee");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -136063,6 +136193,8 @@ public class RegistryService {
return SUCCESS;
case 1: // RSE
return RSE;
+ case 2: // DEE
+ return DEE;
default:
return null;
}
@@ -136110,6 +136242,8 @@ public class RegistryService {
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.RSE, new org.apache.thrift.meta_data.FieldMetaData("rse", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.DEE, new org.apache.thrift.meta_data.FieldMetaData("dee", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addUser_result.class, metaDataMap);
}
@@ -136119,11 +136253,13 @@ public class RegistryService {
public addUser_result(
String success,
- org.apache.airavata.registry.api.exception.RegistryServiceException rse)
+ org.apache.airavata.registry.api.exception.RegistryServiceException rse,
+ org.apache.airavata.model.error.DuplicateEntryException dee)
{
this();
this.success = success;
this.rse = rse;
+ this.dee = dee;
}
/**
@@ -136136,6 +136272,9 @@ public class RegistryService {
if (other.isSetRse()) {
this.rse = new org.apache.airavata.registry.api.exception.RegistryServiceException(other.rse);
}
+ if (other.isSetDee()) {
+ this.dee = new org.apache.airavata.model.error.DuplicateEntryException(other.dee);
+ }
}
public addUser_result deepCopy() {
@@ -136146,6 +136285,7 @@ public class RegistryService {
public void clear() {
this.success = null;
this.rse = null;
+ this.dee = null;
}
public String getSuccess() {
@@ -136196,6 +136336,30 @@ public class RegistryService {
}
}
+ public org.apache.airavata.model.error.DuplicateEntryException getDee() {
+ return this.dee;
+ }
+
+ public addUser_result setDee(org.apache.airavata.model.error.DuplicateEntryException dee) {
+ this.dee = dee;
+ return this;
+ }
+
+ public void unsetDee() {
+ this.dee = null;
+ }
+
+ /** Returns true if field dee is set (has been assigned a value) and false otherwise */
+ public boolean isSetDee() {
+ return this.dee != null;
+ }
+
+ public void setDeeIsSet(boolean value) {
+ if (!value) {
+ this.dee = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
@@ -136214,6 +136378,14 @@ public class RegistryService {
}
break;
+ case DEE:
+ if (value == null) {
+ unsetDee();
+ } else {
+ setDee((org.apache.airavata.model.error.DuplicateEntryException)value);
+ }
+ break;
+
}
}
@@ -136225,6 +136397,9 @@ public class RegistryService {
case RSE:
return getRse();
+ case DEE:
+ return getDee();
+
}
throw new IllegalStateException();
}
@@ -136240,6 +136415,8 @@ public class RegistryService {
return isSetSuccess();
case RSE:
return isSetRse();
+ case DEE:
+ return isSetDee();
}
throw new IllegalStateException();
}
@@ -136275,6 +136452,15 @@ public class RegistryService {
return false;
}
+ boolean this_present_dee = true && this.isSetDee();
+ boolean that_present_dee = true && that.isSetDee();
+ if (this_present_dee || that_present_dee) {
+ if (!(this_present_dee && that_present_dee))
+ return false;
+ if (!this.dee.equals(that.dee))
+ return false;
+ }
+
return true;
}
@@ -136292,6 +136478,11 @@ public class RegistryService {
if (present_rse)
list.add(rse);
+ boolean present_dee = true && (isSetDee());
+ list.add(present_dee);
+ if (present_dee)
+ list.add(dee);
+
return list.hashCode();
}
@@ -136323,6 +136514,16 @@ public class RegistryService {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetDee()).compareTo(other.isSetDee());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDee()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dee, other.dee);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -136358,6 +136559,14 @@ public class RegistryService {
sb.append(this.rse);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("dee:");
+ if (this.dee == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.dee);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -136418,6 +136627,15 @@ public class RegistryService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 2: // DEE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.dee = new org.apache.airavata.model.error.DuplicateEntryException();
+ struct.dee.read(iprot);
+ struct.setDeeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -136443,6 +136661,11 @@ public class RegistryService {
struct.rse.write(oprot);
oprot.writeFieldEnd();
}
+ if (struct.dee != null) {
+ oprot.writeFieldBegin(DEE_FIELD_DESC);
+ struct.dee.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -136467,19 +136690,25 @@ public class RegistryService {
if (struct.isSetRse()) {
optionals.set(1);
}
- oprot.writeBitSet(optionals, 2);
+ if (struct.isSetDee()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
if (struct.isSetRse()) {
struct.rse.write(oprot);
}
+ if (struct.isSetDee()) {
+ struct.dee.write(oprot);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addUser_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
+ BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
@@ -136489,6 +136718,11 @@ public class RegistryService {
struct.rse.read(iprot);
struct.setRseIsSet(true);
}
+ if (incoming.get(2)) {
+ struct.dee = new org.apache.airavata.model.error.DuplicateEntryException();
+ struct.dee.read(iprot);
+ struct.setDeeIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a26520d5/thrift-interface-descriptions/component-cpis/registry-api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
index 0f7b85c..3cb6874 100644
--- a/thrift-interface-descriptions/component-cpis/registry-api.thrift
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -80,7 +80,7 @@ service RegistryService {
*
**/
string addGateway(1: required workspace_model.Gateway gateway)
- throws (1: registry_api_errors.RegistryServiceException rse)
+ throws (1: registry_api_errors.RegistryServiceException rse, 2: airavata_errors.DuplicateEntryException dee)
/**
@@ -2137,7 +2137,7 @@ service RegistryService {
*
*/
string addUser(1: required user_profile_model.UserProfile userProfile)
- throws (1: registry_api_errors.RegistryServiceException rse)
+ throws (1: registry_api_errors.RegistryServiceException rse, 2: airavata_errors.DuplicateEntryException dee)
/**
* Add a Compute Resource Preference to a registered user resource profile.