Making required changes
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/29718e08 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/29718e08 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/29718e08 Branch: refs/heads/develop Commit: 29718e088ba9013c09b0623d3e6000823f176e7f Parents: 98ec4bf Author: Sneha Tilak <[email protected]> Authored: Fri Jun 9 14:44:10 2017 -0400 Committer: Sneha Tilak <[email protected]> Committed: Fri Jun 9 14:44:10 2017 -0400 ---------------------------------------------------------------------- .../airavata/model/workspace/Gateway.java | 986 +++++++------ .../profile/commons/utils/QueryConstants.java | 6 +- .../handlers/TenantProfileServiceHandler.java | 64 +- .../tenant/cpi/TenantProfileService.java | 1381 +++++++++++++++++- .../repositories/TenantProfileRepository.java | 10 + .../workspace_model.thrift | 39 +- .../profile-tenant/profile-tenant-cpi.thrift | 8 +- 7 files changed, 2007 insertions(+), 487 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/29718e08/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/Gateway.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/Gateway.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/Gateway.java index c32cc0d..039a1f9 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/Gateway.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/Gateway.java @@ -55,25 +55,26 @@ import org.slf4j.LoggerFactory; public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields>, java.io.Serializable, Cloneable, Comparable<Gateway> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Gateway"); - private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField GATEWAY_APPROVAL_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayApprovalStatus", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField EMAIL_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("emailAddress", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField GATEWAY_ACRONYM_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAcronym", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField GATEWAY_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayURL", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final org.apache.thrift.protocol.TField GATEWAY_PUBLIC_ABSTRACT_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayPublicAbstract", org.apache.thrift.protocol.TType.STRING, (short)8); - private static final org.apache.thrift.protocol.TField REVIEW_PROPOSAL_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("reviewProposalDescription", org.apache.thrift.protocol.TType.STRING, (short)9); - private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminFirstName", org.apache.thrift.protocol.TType.STRING, (short)10); - private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminLastName", org.apache.thrift.protocol.TType.STRING, (short)11); - private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminEmail", org.apache.thrift.protocol.TType.STRING, (short)12); - private static final org.apache.thrift.protocol.TField IDENTITY_SERVER_USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("identityServerUserName", org.apache.thrift.protocol.TType.STRING, (short)13); - private static final org.apache.thrift.protocol.TField IDENTITY_SERVER_PASSWORD_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("identityServerPasswordToken", org.apache.thrift.protocol.TType.STRING, (short)14); - private static final org.apache.thrift.protocol.TField DECLINED_REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("declinedReason", org.apache.thrift.protocol.TType.STRING, (short)15); - private static final org.apache.thrift.protocol.TField OAUTH_CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("oauthClientId", org.apache.thrift.protocol.TType.STRING, (short)16); - private static final org.apache.thrift.protocol.TField OAUTH_CLIENT_SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("oauthClientSecret", org.apache.thrift.protocol.TType.STRING, (short)17); - private static final org.apache.thrift.protocol.TField REQUEST_CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("requestCreationTime", org.apache.thrift.protocol.TType.I64, (short)18); - private static final org.apache.thrift.protocol.TField REQUESTER_USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("requesterUsername", org.apache.thrift.protocol.TType.STRING, (short)19); + private static final org.apache.thrift.protocol.TField AIRAVATA_INTERNAL_GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataInternalGatewayId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField GATEWAY_APPROVAL_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayApprovalStatus", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField EMAIL_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("emailAddress", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField GATEWAY_ACRONYM_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAcronym", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField GATEWAY_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayURL", org.apache.thrift.protocol.TType.STRING, (short)8); + private static final org.apache.thrift.protocol.TField GATEWAY_PUBLIC_ABSTRACT_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayPublicAbstract", org.apache.thrift.protocol.TType.STRING, (short)9); + private static final org.apache.thrift.protocol.TField REVIEW_PROPOSAL_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("reviewProposalDescription", org.apache.thrift.protocol.TType.STRING, (short)10); + private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminFirstName", org.apache.thrift.protocol.TType.STRING, (short)11); + private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminLastName", org.apache.thrift.protocol.TType.STRING, (short)12); + private static final org.apache.thrift.protocol.TField GATEWAY_ADMIN_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayAdminEmail", org.apache.thrift.protocol.TType.STRING, (short)13); + private static final org.apache.thrift.protocol.TField IDENTITY_SERVER_USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("identityServerUserName", org.apache.thrift.protocol.TType.STRING, (short)14); + private static final org.apache.thrift.protocol.TField IDENTITY_SERVER_PASSWORD_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("identityServerPasswordToken", org.apache.thrift.protocol.TType.STRING, (short)15); + private static final org.apache.thrift.protocol.TField DECLINED_REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("declinedReason", org.apache.thrift.protocol.TType.STRING, (short)16); + private static final org.apache.thrift.protocol.TField OAUTH_CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("oauthClientId", org.apache.thrift.protocol.TType.STRING, (short)17); + private static final org.apache.thrift.protocol.TField OAUTH_CLIENT_SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("oauthClientSecret", org.apache.thrift.protocol.TType.STRING, (short)18); + private static final org.apache.thrift.protocol.TField REQUEST_CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("requestCreationTime", org.apache.thrift.protocol.TType.I64, (short)19); + private static final org.apache.thrift.protocol.TField REQUESTER_USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("requesterUsername", org.apache.thrift.protocol.TType.STRING, (short)20); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -81,51 +82,57 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields schemes.put(TupleScheme.class, new GatewayTupleSchemeFactory()); } - private String gatewayId; // required - private GatewayApprovalStatus gatewayApprovalStatus; // required - private String gatewayName; // optional - private String domain; // optional - private String emailAddress; // optional - private String gatewayAcronym; // optional - private String gatewayURL; // optional - private String gatewayPublicAbstract; // optional - private String reviewProposalDescription; // optional - private String gatewayAdminFirstName; // optional - private String gatewayAdminLastName; // optional - private String gatewayAdminEmail; // optional - private String identityServerUserName; // optional - private String identityServerPasswordToken; // optional - private String declinedReason; // optional - private String oauthClientId; // optional - private String oauthClientSecret; // optional - private long requestCreationTime; // optional - private String requesterUsername; // optional + public String airavataInternalGatewayId; // optional + public String gatewayId; // required + /** + * + * @see GatewayApprovalStatus + */ + public GatewayApprovalStatus gatewayApprovalStatus; // required + public String gatewayName; // optional + public String domain; // optional + public String emailAddress; // optional + public String gatewayAcronym; // optional + public String gatewayURL; // optional + public String gatewayPublicAbstract; // optional + public String reviewProposalDescription; // optional + public String gatewayAdminFirstName; // optional + public String gatewayAdminLastName; // optional + public String gatewayAdminEmail; // optional + public String identityServerUserName; // optional + public String identityServerPasswordToken; // optional + public String declinedReason; // optional + public String oauthClientId; // optional + public String oauthClientSecret; // optional + public long requestCreationTime; // optional + public String requesterUsername; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - GATEWAY_ID((short)1, "gatewayId"), + AIRAVATA_INTERNAL_GATEWAY_ID((short)1, "airavataInternalGatewayId"), + GATEWAY_ID((short)2, "gatewayId"), /** - * + * * @see GatewayApprovalStatus */ - GATEWAY_APPROVAL_STATUS((short)2, "gatewayApprovalStatus"), - GATEWAY_NAME((short)3, "gatewayName"), - DOMAIN((short)4, "domain"), - EMAIL_ADDRESS((short)5, "emailAddress"), - GATEWAY_ACRONYM((short)6, "gatewayAcronym"), - GATEWAY_URL((short)7, "gatewayURL"), - GATEWAY_PUBLIC_ABSTRACT((short)8, "gatewayPublicAbstract"), - REVIEW_PROPOSAL_DESCRIPTION((short)9, "reviewProposalDescription"), - GATEWAY_ADMIN_FIRST_NAME((short)10, "gatewayAdminFirstName"), - GATEWAY_ADMIN_LAST_NAME((short)11, "gatewayAdminLastName"), - GATEWAY_ADMIN_EMAIL((short)12, "gatewayAdminEmail"), - IDENTITY_SERVER_USER_NAME((short)13, "identityServerUserName"), - IDENTITY_SERVER_PASSWORD_TOKEN((short)14, "identityServerPasswordToken"), - DECLINED_REASON((short)15, "declinedReason"), - OAUTH_CLIENT_ID((short)16, "oauthClientId"), - OAUTH_CLIENT_SECRET((short)17, "oauthClientSecret"), - REQUEST_CREATION_TIME((short)18, "requestCreationTime"), - REQUESTER_USERNAME((short)19, "requesterUsername"); + GATEWAY_APPROVAL_STATUS((short)3, "gatewayApprovalStatus"), + GATEWAY_NAME((short)4, "gatewayName"), + DOMAIN((short)5, "domain"), + EMAIL_ADDRESS((short)6, "emailAddress"), + GATEWAY_ACRONYM((short)7, "gatewayAcronym"), + GATEWAY_URL((short)8, "gatewayURL"), + GATEWAY_PUBLIC_ABSTRACT((short)9, "gatewayPublicAbstract"), + REVIEW_PROPOSAL_DESCRIPTION((short)10, "reviewProposalDescription"), + GATEWAY_ADMIN_FIRST_NAME((short)11, "gatewayAdminFirstName"), + GATEWAY_ADMIN_LAST_NAME((short)12, "gatewayAdminLastName"), + GATEWAY_ADMIN_EMAIL((short)13, "gatewayAdminEmail"), + IDENTITY_SERVER_USER_NAME((short)14, "identityServerUserName"), + IDENTITY_SERVER_PASSWORD_TOKEN((short)15, "identityServerPasswordToken"), + DECLINED_REASON((short)16, "declinedReason"), + OAUTH_CLIENT_ID((short)17, "oauthClientId"), + OAUTH_CLIENT_SECRET((short)18, "oauthClientSecret"), + REQUEST_CREATION_TIME((short)19, "requestCreationTime"), + REQUESTER_USERNAME((short)20, "requesterUsername"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -140,43 +147,45 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // GATEWAY_ID + case 1: // AIRAVATA_INTERNAL_GATEWAY_ID + return AIRAVATA_INTERNAL_GATEWAY_ID; + case 2: // GATEWAY_ID return GATEWAY_ID; - case 2: // GATEWAY_APPROVAL_STATUS + case 3: // GATEWAY_APPROVAL_STATUS return GATEWAY_APPROVAL_STATUS; - case 3: // GATEWAY_NAME + case 4: // GATEWAY_NAME return GATEWAY_NAME; - case 4: // DOMAIN + case 5: // DOMAIN return DOMAIN; - case 5: // EMAIL_ADDRESS + case 6: // EMAIL_ADDRESS return EMAIL_ADDRESS; - case 6: // GATEWAY_ACRONYM + case 7: // GATEWAY_ACRONYM return GATEWAY_ACRONYM; - case 7: // GATEWAY_URL + case 8: // GATEWAY_URL return GATEWAY_URL; - case 8: // GATEWAY_PUBLIC_ABSTRACT + case 9: // GATEWAY_PUBLIC_ABSTRACT return GATEWAY_PUBLIC_ABSTRACT; - case 9: // REVIEW_PROPOSAL_DESCRIPTION + case 10: // REVIEW_PROPOSAL_DESCRIPTION return REVIEW_PROPOSAL_DESCRIPTION; - case 10: // GATEWAY_ADMIN_FIRST_NAME + case 11: // GATEWAY_ADMIN_FIRST_NAME return GATEWAY_ADMIN_FIRST_NAME; - case 11: // GATEWAY_ADMIN_LAST_NAME + case 12: // GATEWAY_ADMIN_LAST_NAME return GATEWAY_ADMIN_LAST_NAME; - case 12: // GATEWAY_ADMIN_EMAIL + case 13: // GATEWAY_ADMIN_EMAIL return GATEWAY_ADMIN_EMAIL; - case 13: // IDENTITY_SERVER_USER_NAME + case 14: // IDENTITY_SERVER_USER_NAME return IDENTITY_SERVER_USER_NAME; - case 14: // IDENTITY_SERVER_PASSWORD_TOKEN + case 15: // IDENTITY_SERVER_PASSWORD_TOKEN return IDENTITY_SERVER_PASSWORD_TOKEN; - case 15: // DECLINED_REASON + case 16: // DECLINED_REASON return DECLINED_REASON; - case 16: // OAUTH_CLIENT_ID + case 17: // OAUTH_CLIENT_ID return OAUTH_CLIENT_ID; - case 17: // OAUTH_CLIENT_SECRET + case 18: // OAUTH_CLIENT_SECRET return OAUTH_CLIENT_SECRET; - case 18: // REQUEST_CREATION_TIME + case 19: // REQUEST_CREATION_TIME return REQUEST_CREATION_TIME; - case 19: // REQUESTER_USERNAME + case 20: // REQUESTER_USERNAME return REQUESTER_USERNAME; default: return null; @@ -220,48 +229,50 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields // isset id assignments private static final int __REQUESTCREATIONTIME_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.GATEWAY_NAME,_Fields.DOMAIN,_Fields.EMAIL_ADDRESS,_Fields.GATEWAY_ACRONYM,_Fields.GATEWAY_URL,_Fields.GATEWAY_PUBLIC_ABSTRACT,_Fields.REVIEW_PROPOSAL_DESCRIPTION,_Fields.GATEWAY_ADMIN_FIRST_NAME,_Fields.GATEWAY_ADMIN_LAST_NAME,_Fields.GATEWAY_ADMIN_EMAIL,_Fields.IDENTITY_SERVER_USER_NAME,_Fields.IDENTITY_SERVER_PASSWORD_TOKEN,_Fields.DECLINED_REASON,_Fields.OAUTH_CLIENT_ID,_Fields.OAUTH_CLIENT_SECRET,_Fields.REQUEST_CREATION_TIME,_Fields.REQUESTER_USERNAME}; + private static final _Fields optionals[] = {_Fields.AIRAVATA_INTERNAL_GATEWAY_ID,_Fields.GATEWAY_NAME,_Fields.DOMAIN,_Fields.EMAIL_ADDRESS,_Fields.GATEWAY_ACRONYM,_Fields.GATEWAY_URL,_Fields.GATEWAY_PUBLIC_ABSTRACT,_Fields.REVIEW_PROPOSAL_DESCRIPTION,_Fields.GATEWAY_ADMIN_FIRST_NAME,_Fields.GATEWAY_ADMIN_LAST_NAME,_Fields.GATEWAY_ADMIN_EMAIL,_Fields.IDENTITY_SERVER_USER_NAME,_Fields.IDENTITY_SERVER_PASSWORD_TOKEN,_Fields.DECLINED_REASON,_Fields.OAUTH_CLIENT_ID,_Fields.OAUTH_CLIENT_SECRET,_Fields.REQUEST_CREATION_TIME,_Fields.REQUESTER_USERNAME}; 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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_APPROVAL_STATUS, new org.apache.thrift.meta_data.FieldMetaData("gatewayApprovalStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GatewayApprovalStatus.class))); - tmpMap.put(_Fields.GATEWAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EMAIL_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("emailAddress", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_ACRONYM, new org.apache.thrift.meta_data.FieldMetaData("gatewayAcronym", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_URL, new org.apache.thrift.meta_data.FieldMetaData("gatewayURL", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_PUBLIC_ABSTRACT, new org.apache.thrift.meta_data.FieldMetaData("gatewayPublicAbstract", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.REVIEW_PROPOSAL_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("reviewProposalDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_ADMIN_FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminFirstName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_ADMIN_LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminLastName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.GATEWAY_ADMIN_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminEmail", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IDENTITY_SERVER_USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("identityServerUserName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IDENTITY_SERVER_PASSWORD_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("identityServerPasswordToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DECLINED_REASON, new org.apache.thrift.meta_data.FieldMetaData("declinedReason", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OAUTH_CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("oauthClientId", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OAUTH_CLIENT_SECRET, new org.apache.thrift.meta_data.FieldMetaData("oauthClientSecret", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.REQUEST_CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("requestCreationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.REQUESTER_USERNAME, new org.apache.thrift.meta_data.FieldMetaData("requesterUsername", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AIRAVATA_INTERNAL_GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("airavataInternalGatewayId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_APPROVAL_STATUS, new org.apache.thrift.meta_data.FieldMetaData("gatewayApprovalStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, GatewayApprovalStatus.class))); + tmpMap.put(_Fields.GATEWAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EMAIL_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("emailAddress", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ACRONYM, new org.apache.thrift.meta_data.FieldMetaData("gatewayAcronym", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_URL, new org.apache.thrift.meta_data.FieldMetaData("gatewayURL", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_PUBLIC_ABSTRACT, new org.apache.thrift.meta_data.FieldMetaData("gatewayPublicAbstract", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REVIEW_PROPOSAL_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("reviewProposalDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ADMIN_FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminFirstName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ADMIN_LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminLastName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ADMIN_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("gatewayAdminEmail", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IDENTITY_SERVER_USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("identityServerUserName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IDENTITY_SERVER_PASSWORD_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("identityServerPasswordToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DECLINED_REASON, new org.apache.thrift.meta_data.FieldMetaData("declinedReason", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OAUTH_CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("oauthClientId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OAUTH_CLIENT_SECRET, new org.apache.thrift.meta_data.FieldMetaData("oauthClientSecret", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REQUEST_CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("requestCreationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.REQUESTER_USERNAME, new org.apache.thrift.meta_data.FieldMetaData("requesterUsername", 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(Gateway.class, metaDataMap); } @@ -270,8 +281,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields } public Gateway( - String gatewayId, - GatewayApprovalStatus gatewayApprovalStatus) + String gatewayId, + GatewayApprovalStatus gatewayApprovalStatus) { this(); this.gatewayId = gatewayId; @@ -283,6 +294,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields */ public Gateway(Gateway other) { __isset_bitfield = other.__isset_bitfield; + if (other.isSetAiravataInternalGatewayId()) { + this.airavataInternalGatewayId = other.airavataInternalGatewayId; + } if (other.isSetGatewayId()) { this.gatewayId = other.gatewayId; } @@ -346,6 +360,7 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields @Override public void clear() { + this.airavataInternalGatewayId = null; this.gatewayId = null; this.gatewayApprovalStatus = null; this.gatewayName = null; @@ -368,12 +383,37 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields this.requesterUsername = null; } + public String getAiravataInternalGatewayId() { + return this.airavataInternalGatewayId; + } + + public Gateway setAiravataInternalGatewayId(String airavataInternalGatewayId) { + this.airavataInternalGatewayId = airavataInternalGatewayId; + return this; + } + + public void unsetAiravataInternalGatewayId() { + this.airavataInternalGatewayId = null; + } + + /** Returns true if field airavataInternalGatewayId is set (has been assigned a value) and false otherwise */ + public boolean isSetAiravataInternalGatewayId() { + return this.airavataInternalGatewayId != null; + } + + public void setAiravataInternalGatewayIdIsSet(boolean value) { + if (!value) { + this.airavataInternalGatewayId = null; + } + } + public String getGatewayId() { return this.gatewayId; } - public void setGatewayId(String gatewayId) { + public Gateway setGatewayId(String gatewayId) { this.gatewayId = gatewayId; + return this; } public void unsetGatewayId() { @@ -392,7 +432,7 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields } /** - * + * * @see GatewayApprovalStatus */ public GatewayApprovalStatus getGatewayApprovalStatus() { @@ -400,11 +440,12 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields } /** - * + * * @see GatewayApprovalStatus */ - public void setGatewayApprovalStatus(GatewayApprovalStatus gatewayApprovalStatus) { + public Gateway setGatewayApprovalStatus(GatewayApprovalStatus gatewayApprovalStatus) { this.gatewayApprovalStatus = gatewayApprovalStatus; + return this; } public void unsetGatewayApprovalStatus() { @@ -426,8 +467,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayName; } - public void setGatewayName(String gatewayName) { + public Gateway setGatewayName(String gatewayName) { this.gatewayName = gatewayName; + return this; } public void unsetGatewayName() { @@ -449,8 +491,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.domain; } - public void setDomain(String domain) { + public Gateway setDomain(String domain) { this.domain = domain; + return this; } public void unsetDomain() { @@ -472,8 +515,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.emailAddress; } - public void setEmailAddress(String emailAddress) { + public Gateway setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; + return this; } public void unsetEmailAddress() { @@ -495,8 +539,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayAcronym; } - public void setGatewayAcronym(String gatewayAcronym) { + public Gateway setGatewayAcronym(String gatewayAcronym) { this.gatewayAcronym = gatewayAcronym; + return this; } public void unsetGatewayAcronym() { @@ -518,8 +563,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayURL; } - public void setGatewayURL(String gatewayURL) { + public Gateway setGatewayURL(String gatewayURL) { this.gatewayURL = gatewayURL; + return this; } public void unsetGatewayURL() { @@ -541,8 +587,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayPublicAbstract; } - public void setGatewayPublicAbstract(String gatewayPublicAbstract) { + public Gateway setGatewayPublicAbstract(String gatewayPublicAbstract) { this.gatewayPublicAbstract = gatewayPublicAbstract; + return this; } public void unsetGatewayPublicAbstract() { @@ -564,8 +611,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.reviewProposalDescription; } - public void setReviewProposalDescription(String reviewProposalDescription) { + public Gateway setReviewProposalDescription(String reviewProposalDescription) { this.reviewProposalDescription = reviewProposalDescription; + return this; } public void unsetReviewProposalDescription() { @@ -587,8 +635,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayAdminFirstName; } - public void setGatewayAdminFirstName(String gatewayAdminFirstName) { + public Gateway setGatewayAdminFirstName(String gatewayAdminFirstName) { this.gatewayAdminFirstName = gatewayAdminFirstName; + return this; } public void unsetGatewayAdminFirstName() { @@ -610,8 +659,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayAdminLastName; } - public void setGatewayAdminLastName(String gatewayAdminLastName) { + public Gateway setGatewayAdminLastName(String gatewayAdminLastName) { this.gatewayAdminLastName = gatewayAdminLastName; + return this; } public void unsetGatewayAdminLastName() { @@ -633,8 +683,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.gatewayAdminEmail; } - public void setGatewayAdminEmail(String gatewayAdminEmail) { + public Gateway setGatewayAdminEmail(String gatewayAdminEmail) { this.gatewayAdminEmail = gatewayAdminEmail; + return this; } public void unsetGatewayAdminEmail() { @@ -656,8 +707,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.identityServerUserName; } - public void setIdentityServerUserName(String identityServerUserName) { + public Gateway setIdentityServerUserName(String identityServerUserName) { this.identityServerUserName = identityServerUserName; + return this; } public void unsetIdentityServerUserName() { @@ -679,8 +731,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.identityServerPasswordToken; } - public void setIdentityServerPasswordToken(String identityServerPasswordToken) { + public Gateway setIdentityServerPasswordToken(String identityServerPasswordToken) { this.identityServerPasswordToken = identityServerPasswordToken; + return this; } public void unsetIdentityServerPasswordToken() { @@ -702,8 +755,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.declinedReason; } - public void setDeclinedReason(String declinedReason) { + public Gateway setDeclinedReason(String declinedReason) { this.declinedReason = declinedReason; + return this; } public void unsetDeclinedReason() { @@ -725,8 +779,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.oauthClientId; } - public void setOauthClientId(String oauthClientId) { + public Gateway setOauthClientId(String oauthClientId) { this.oauthClientId = oauthClientId; + return this; } public void unsetOauthClientId() { @@ -748,8 +803,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.oauthClientSecret; } - public void setOauthClientSecret(String oauthClientSecret) { + public Gateway setOauthClientSecret(String oauthClientSecret) { this.oauthClientSecret = oauthClientSecret; + return this; } public void unsetOauthClientSecret() { @@ -771,9 +827,10 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.requestCreationTime; } - public void setRequestCreationTime(long requestCreationTime) { + public Gateway setRequestCreationTime(long requestCreationTime) { this.requestCreationTime = requestCreationTime; setRequestCreationTimeIsSet(true); + return this; } public void unsetRequestCreationTime() { @@ -793,8 +850,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields return this.requesterUsername; } - public void setRequesterUsername(String requesterUsername) { + public Gateway setRequesterUsername(String requesterUsername) { this.requesterUsername = requesterUsername; + return this; } public void unsetRequesterUsername() { @@ -814,219 +872,230 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields public void setFieldValue(_Fields field, Object value) { switch (field) { - case GATEWAY_ID: - if (value == null) { - unsetGatewayId(); - } else { - setGatewayId((String)value); - } - break; + case AIRAVATA_INTERNAL_GATEWAY_ID: + if (value == null) { + unsetAiravataInternalGatewayId(); + } else { + setAiravataInternalGatewayId((String)value); + } + break; - case GATEWAY_APPROVAL_STATUS: - if (value == null) { - unsetGatewayApprovalStatus(); - } else { - setGatewayApprovalStatus((GatewayApprovalStatus)value); - } - break; + case GATEWAY_ID: + if (value == null) { + unsetGatewayId(); + } else { + setGatewayId((String)value); + } + break; - case GATEWAY_NAME: - if (value == null) { - unsetGatewayName(); - } else { - setGatewayName((String)value); - } - break; + case GATEWAY_APPROVAL_STATUS: + if (value == null) { + unsetGatewayApprovalStatus(); + } else { + setGatewayApprovalStatus((GatewayApprovalStatus)value); + } + break; - case DOMAIN: - if (value == null) { - unsetDomain(); - } else { - setDomain((String)value); - } - break; + case GATEWAY_NAME: + if (value == null) { + unsetGatewayName(); + } else { + setGatewayName((String)value); + } + break; - case EMAIL_ADDRESS: - if (value == null) { - unsetEmailAddress(); - } else { - setEmailAddress((String)value); - } - break; + case DOMAIN: + if (value == null) { + unsetDomain(); + } else { + setDomain((String)value); + } + break; - case GATEWAY_ACRONYM: - if (value == null) { - unsetGatewayAcronym(); - } else { - setGatewayAcronym((String)value); - } - break; + case EMAIL_ADDRESS: + if (value == null) { + unsetEmailAddress(); + } else { + setEmailAddress((String)value); + } + break; - case GATEWAY_URL: - if (value == null) { - unsetGatewayURL(); - } else { - setGatewayURL((String)value); - } - break; + case GATEWAY_ACRONYM: + if (value == null) { + unsetGatewayAcronym(); + } else { + setGatewayAcronym((String)value); + } + break; - case GATEWAY_PUBLIC_ABSTRACT: - if (value == null) { - unsetGatewayPublicAbstract(); - } else { - setGatewayPublicAbstract((String)value); - } - break; + case GATEWAY_URL: + if (value == null) { + unsetGatewayURL(); + } else { + setGatewayURL((String)value); + } + break; - case REVIEW_PROPOSAL_DESCRIPTION: - if (value == null) { - unsetReviewProposalDescription(); - } else { - setReviewProposalDescription((String)value); - } - break; + case GATEWAY_PUBLIC_ABSTRACT: + if (value == null) { + unsetGatewayPublicAbstract(); + } else { + setGatewayPublicAbstract((String)value); + } + break; - case GATEWAY_ADMIN_FIRST_NAME: - if (value == null) { - unsetGatewayAdminFirstName(); - } else { - setGatewayAdminFirstName((String)value); - } - break; + case REVIEW_PROPOSAL_DESCRIPTION: + if (value == null) { + unsetReviewProposalDescription(); + } else { + setReviewProposalDescription((String)value); + } + break; - case GATEWAY_ADMIN_LAST_NAME: - if (value == null) { - unsetGatewayAdminLastName(); - } else { - setGatewayAdminLastName((String)value); - } - break; + case GATEWAY_ADMIN_FIRST_NAME: + if (value == null) { + unsetGatewayAdminFirstName(); + } else { + setGatewayAdminFirstName((String)value); + } + break; - case GATEWAY_ADMIN_EMAIL: - if (value == null) { - unsetGatewayAdminEmail(); - } else { - setGatewayAdminEmail((String)value); - } - break; + case GATEWAY_ADMIN_LAST_NAME: + if (value == null) { + unsetGatewayAdminLastName(); + } else { + setGatewayAdminLastName((String)value); + } + break; - case IDENTITY_SERVER_USER_NAME: - if (value == null) { - unsetIdentityServerUserName(); - } else { - setIdentityServerUserName((String)value); - } - break; + case GATEWAY_ADMIN_EMAIL: + if (value == null) { + unsetGatewayAdminEmail(); + } else { + setGatewayAdminEmail((String)value); + } + break; - case IDENTITY_SERVER_PASSWORD_TOKEN: - if (value == null) { - unsetIdentityServerPasswordToken(); - } else { - setIdentityServerPasswordToken((String)value); - } - break; + case IDENTITY_SERVER_USER_NAME: + if (value == null) { + unsetIdentityServerUserName(); + } else { + setIdentityServerUserName((String)value); + } + break; - case DECLINED_REASON: - if (value == null) { - unsetDeclinedReason(); - } else { - setDeclinedReason((String)value); - } - break; + case IDENTITY_SERVER_PASSWORD_TOKEN: + if (value == null) { + unsetIdentityServerPasswordToken(); + } else { + setIdentityServerPasswordToken((String)value); + } + break; - case OAUTH_CLIENT_ID: - if (value == null) { - unsetOauthClientId(); - } else { - setOauthClientId((String)value); - } - break; + case DECLINED_REASON: + if (value == null) { + unsetDeclinedReason(); + } else { + setDeclinedReason((String)value); + } + break; - case OAUTH_CLIENT_SECRET: - if (value == null) { - unsetOauthClientSecret(); - } else { - setOauthClientSecret((String)value); - } - break; + case OAUTH_CLIENT_ID: + if (value == null) { + unsetOauthClientId(); + } else { + setOauthClientId((String)value); + } + break; - case REQUEST_CREATION_TIME: - if (value == null) { - unsetRequestCreationTime(); - } else { - setRequestCreationTime((Long)value); - } - break; + case OAUTH_CLIENT_SECRET: + if (value == null) { + unsetOauthClientSecret(); + } else { + setOauthClientSecret((String)value); + } + break; - case REQUESTER_USERNAME: - if (value == null) { - unsetRequesterUsername(); - } else { - setRequesterUsername((String)value); - } - break; + case REQUEST_CREATION_TIME: + if (value == null) { + unsetRequestCreationTime(); + } else { + setRequestCreationTime((Long)value); + } + break; + + case REQUESTER_USERNAME: + if (value == null) { + unsetRequesterUsername(); + } else { + setRequesterUsername((String)value); + } + break; } } public Object getFieldValue(_Fields field) { switch (field) { - case GATEWAY_ID: - return getGatewayId(); + case AIRAVATA_INTERNAL_GATEWAY_ID: + return getAiravataInternalGatewayId(); - case GATEWAY_APPROVAL_STATUS: - return getGatewayApprovalStatus(); + case GATEWAY_ID: + return getGatewayId(); - case GATEWAY_NAME: - return getGatewayName(); + case GATEWAY_APPROVAL_STATUS: + return getGatewayApprovalStatus(); - case DOMAIN: - return getDomain(); + case GATEWAY_NAME: + return getGatewayName(); - case EMAIL_ADDRESS: - return getEmailAddress(); + case DOMAIN: + return getDomain(); - case GATEWAY_ACRONYM: - return getGatewayAcronym(); + case EMAIL_ADDRESS: + return getEmailAddress(); - case GATEWAY_URL: - return getGatewayURL(); + case GATEWAY_ACRONYM: + return getGatewayAcronym(); - case GATEWAY_PUBLIC_ABSTRACT: - return getGatewayPublicAbstract(); + case GATEWAY_URL: + return getGatewayURL(); - case REVIEW_PROPOSAL_DESCRIPTION: - return getReviewProposalDescription(); + case GATEWAY_PUBLIC_ABSTRACT: + return getGatewayPublicAbstract(); - case GATEWAY_ADMIN_FIRST_NAME: - return getGatewayAdminFirstName(); + case REVIEW_PROPOSAL_DESCRIPTION: + return getReviewProposalDescription(); - case GATEWAY_ADMIN_LAST_NAME: - return getGatewayAdminLastName(); + case GATEWAY_ADMIN_FIRST_NAME: + return getGatewayAdminFirstName(); - case GATEWAY_ADMIN_EMAIL: - return getGatewayAdminEmail(); + case GATEWAY_ADMIN_LAST_NAME: + return getGatewayAdminLastName(); - case IDENTITY_SERVER_USER_NAME: - return getIdentityServerUserName(); + case GATEWAY_ADMIN_EMAIL: + return getGatewayAdminEmail(); - case IDENTITY_SERVER_PASSWORD_TOKEN: - return getIdentityServerPasswordToken(); + case IDENTITY_SERVER_USER_NAME: + return getIdentityServerUserName(); - case DECLINED_REASON: - return getDeclinedReason(); + case IDENTITY_SERVER_PASSWORD_TOKEN: + return getIdentityServerPasswordToken(); - case OAUTH_CLIENT_ID: - return getOauthClientId(); + case DECLINED_REASON: + return getDeclinedReason(); - case OAUTH_CLIENT_SECRET: - return getOauthClientSecret(); + case OAUTH_CLIENT_ID: + return getOauthClientId(); - case REQUEST_CREATION_TIME: - return getRequestCreationTime(); + case OAUTH_CLIENT_SECRET: + return getOauthClientSecret(); - case REQUESTER_USERNAME: - return getRequesterUsername(); + case REQUEST_CREATION_TIME: + return getRequestCreationTime(); + + case REQUESTER_USERNAME: + return getRequesterUsername(); } throw new IllegalStateException(); @@ -1039,44 +1108,46 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields } switch (field) { - case GATEWAY_ID: - return isSetGatewayId(); - case GATEWAY_APPROVAL_STATUS: - return isSetGatewayApprovalStatus(); - case GATEWAY_NAME: - return isSetGatewayName(); - case DOMAIN: - return isSetDomain(); - case EMAIL_ADDRESS: - return isSetEmailAddress(); - case GATEWAY_ACRONYM: - return isSetGatewayAcronym(); - case GATEWAY_URL: - return isSetGatewayURL(); - case GATEWAY_PUBLIC_ABSTRACT: - return isSetGatewayPublicAbstract(); - case REVIEW_PROPOSAL_DESCRIPTION: - return isSetReviewProposalDescription(); - case GATEWAY_ADMIN_FIRST_NAME: - return isSetGatewayAdminFirstName(); - case GATEWAY_ADMIN_LAST_NAME: - return isSetGatewayAdminLastName(); - case GATEWAY_ADMIN_EMAIL: - return isSetGatewayAdminEmail(); - case IDENTITY_SERVER_USER_NAME: - return isSetIdentityServerUserName(); - case IDENTITY_SERVER_PASSWORD_TOKEN: - return isSetIdentityServerPasswordToken(); - case DECLINED_REASON: - return isSetDeclinedReason(); - case OAUTH_CLIENT_ID: - return isSetOauthClientId(); - case OAUTH_CLIENT_SECRET: - return isSetOauthClientSecret(); - case REQUEST_CREATION_TIME: - return isSetRequestCreationTime(); - case REQUESTER_USERNAME: - return isSetRequesterUsername(); + case AIRAVATA_INTERNAL_GATEWAY_ID: + return isSetAiravataInternalGatewayId(); + case GATEWAY_ID: + return isSetGatewayId(); + case GATEWAY_APPROVAL_STATUS: + return isSetGatewayApprovalStatus(); + case GATEWAY_NAME: + return isSetGatewayName(); + case DOMAIN: + return isSetDomain(); + case EMAIL_ADDRESS: + return isSetEmailAddress(); + case GATEWAY_ACRONYM: + return isSetGatewayAcronym(); + case GATEWAY_URL: + return isSetGatewayURL(); + case GATEWAY_PUBLIC_ABSTRACT: + return isSetGatewayPublicAbstract(); + case REVIEW_PROPOSAL_DESCRIPTION: + return isSetReviewProposalDescription(); + case GATEWAY_ADMIN_FIRST_NAME: + return isSetGatewayAdminFirstName(); + case GATEWAY_ADMIN_LAST_NAME: + return isSetGatewayAdminLastName(); + case GATEWAY_ADMIN_EMAIL: + return isSetGatewayAdminEmail(); + case IDENTITY_SERVER_USER_NAME: + return isSetIdentityServerUserName(); + case IDENTITY_SERVER_PASSWORD_TOKEN: + return isSetIdentityServerPasswordToken(); + case DECLINED_REASON: + return isSetDeclinedReason(); + case OAUTH_CLIENT_ID: + return isSetOauthClientId(); + case OAUTH_CLIENT_SECRET: + return isSetOauthClientSecret(); + case REQUEST_CREATION_TIME: + return isSetRequestCreationTime(); + case REQUESTER_USERNAME: + return isSetRequesterUsername(); } throw new IllegalStateException(); } @@ -1094,6 +1165,15 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields if (that == null) return false; + boolean this_present_airavataInternalGatewayId = true && this.isSetAiravataInternalGatewayId(); + boolean that_present_airavataInternalGatewayId = true && that.isSetAiravataInternalGatewayId(); + if (this_present_airavataInternalGatewayId || that_present_airavataInternalGatewayId) { + if (!(this_present_airavataInternalGatewayId && that_present_airavataInternalGatewayId)) + return false; + if (!this.airavataInternalGatewayId.equals(that.airavataInternalGatewayId)) + return false; + } + boolean this_present_gatewayId = true && this.isSetGatewayId(); boolean that_present_gatewayId = true && that.isSetGatewayId(); if (this_present_gatewayId || that_present_gatewayId) { @@ -1272,6 +1352,11 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields public int hashCode() { List<Object> list = new ArrayList<Object>(); + boolean present_airavataInternalGatewayId = true && (isSetAiravataInternalGatewayId()); + list.add(present_airavataInternalGatewayId); + if (present_airavataInternalGatewayId) + list.add(airavataInternalGatewayId); + boolean present_gatewayId = true && (isSetGatewayId()); list.add(present_gatewayId); if (present_gatewayId) @@ -1378,6 +1463,16 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetAiravataInternalGatewayId()).compareTo(other.isSetAiravataInternalGatewayId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAiravataInternalGatewayId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataInternalGatewayId, other.airavataInternalGatewayId); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId()); if (lastComparison != 0) { return lastComparison; @@ -1588,6 +1683,16 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields StringBuilder sb = new StringBuilder("Gateway("); boolean first = true; + if (isSetAiravataInternalGatewayId()) { + sb.append("airavataInternalGatewayId:"); + if (this.airavataInternalGatewayId == null) { + sb.append("null"); + } else { + sb.append(this.airavataInternalGatewayId); + } + first = false; + } + if (!first) sb.append(", "); sb.append("gatewayId:"); if (this.gatewayId == null) { sb.append("null"); @@ -1775,14 +1880,12 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields public void validate() throws org.apache.thrift.TException { // check for required fields - if (!isSetGatewayId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' is unset! Struct:" + toString()); + if (gatewayId == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString()); } - - if (!isSetGatewayApprovalStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayApprovalStatus' is unset! Struct:" + toString()); + if (gatewayApprovalStatus == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayApprovalStatus' was not present! Struct: " + toString()); } - // check for sub-struct validity } @@ -1818,159 +1921,167 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { - case 1: // GATEWAY_ID + case 1: // AIRAVATA_INTERNAL_GATEWAY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.airavataInternalGatewayId = iprot.readString(); + struct.setAiravataInternalGatewayIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // GATEWAY_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayId = iprot.readString(); struct.setGatewayIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // GATEWAY_APPROVAL_STATUS + case 3: // GATEWAY_APPROVAL_STATUS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.gatewayApprovalStatus = org.apache.airavata.model.workspace.GatewayApprovalStatus.findByValue(iprot.readI32()); struct.setGatewayApprovalStatusIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // GATEWAY_NAME + case 4: // GATEWAY_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayName = iprot.readString(); struct.setGatewayNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // DOMAIN + case 5: // DOMAIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.domain = iprot.readString(); struct.setDomainIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // EMAIL_ADDRESS + case 6: // EMAIL_ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.emailAddress = iprot.readString(); struct.setEmailAddressIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 6: // GATEWAY_ACRONYM + case 7: // GATEWAY_ACRONYM if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayAcronym = iprot.readString(); struct.setGatewayAcronymIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 7: // GATEWAY_URL + case 8: // GATEWAY_URL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayURL = iprot.readString(); struct.setGatewayURLIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 8: // GATEWAY_PUBLIC_ABSTRACT + case 9: // GATEWAY_PUBLIC_ABSTRACT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayPublicAbstract = iprot.readString(); struct.setGatewayPublicAbstractIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 9: // REVIEW_PROPOSAL_DESCRIPTION + case 10: // REVIEW_PROPOSAL_DESCRIPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.reviewProposalDescription = iprot.readString(); struct.setReviewProposalDescriptionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 10: // GATEWAY_ADMIN_FIRST_NAME + case 11: // GATEWAY_ADMIN_FIRST_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayAdminFirstName = iprot.readString(); struct.setGatewayAdminFirstNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 11: // GATEWAY_ADMIN_LAST_NAME + case 12: // GATEWAY_ADMIN_LAST_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayAdminLastName = iprot.readString(); struct.setGatewayAdminLastNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 12: // GATEWAY_ADMIN_EMAIL + case 13: // GATEWAY_ADMIN_EMAIL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.gatewayAdminEmail = iprot.readString(); struct.setGatewayAdminEmailIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 13: // IDENTITY_SERVER_USER_NAME + case 14: // IDENTITY_SERVER_USER_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.identityServerUserName = iprot.readString(); struct.setIdentityServerUserNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 14: // IDENTITY_SERVER_PASSWORD_TOKEN + case 15: // IDENTITY_SERVER_PASSWORD_TOKEN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.identityServerPasswordToken = iprot.readString(); struct.setIdentityServerPasswordTokenIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 15: // DECLINED_REASON + case 16: // DECLINED_REASON if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.declinedReason = iprot.readString(); struct.setDeclinedReasonIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 16: // OAUTH_CLIENT_ID + case 17: // OAUTH_CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.oauthClientId = iprot.readString(); struct.setOauthClientIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 17: // OAUTH_CLIENT_SECRET + case 18: // OAUTH_CLIENT_SECRET if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.oauthClientSecret = iprot.readString(); struct.setOauthClientSecretIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 18: // REQUEST_CREATION_TIME + case 19: // REQUEST_CREATION_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.requestCreationTime = iprot.readI64(); struct.setRequestCreationTimeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 19: // REQUESTER_USERNAME + case 20: // REQUESTER_USERNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.requesterUsername = iprot.readString(); struct.setRequesterUsernameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1980,6 +2091,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields iprot.readFieldEnd(); } iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } @@ -1987,6 +2100,13 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.airavataInternalGatewayId != null) { + if (struct.isSetAiravataInternalGatewayId()) { + oprot.writeFieldBegin(AIRAVATA_INTERNAL_GATEWAY_ID_FIELD_DESC); + oprot.writeString(struct.airavataInternalGatewayId); + oprot.writeFieldEnd(); + } + } if (struct.gatewayId != null) { oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC); oprot.writeString(struct.gatewayId); @@ -2134,58 +2254,64 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields oprot.writeString(struct.gatewayId); oprot.writeI32(struct.gatewayApprovalStatus.getValue()); BitSet optionals = new BitSet(); - if (struct.isSetGatewayName()) { + if (struct.isSetAiravataInternalGatewayId()) { optionals.set(0); } - if (struct.isSetDomain()) { + if (struct.isSetGatewayName()) { optionals.set(1); } - if (struct.isSetEmailAddress()) { + if (struct.isSetDomain()) { optionals.set(2); } - if (struct.isSetGatewayAcronym()) { + if (struct.isSetEmailAddress()) { optionals.set(3); } - if (struct.isSetGatewayURL()) { + if (struct.isSetGatewayAcronym()) { optionals.set(4); } - if (struct.isSetGatewayPublicAbstract()) { + if (struct.isSetGatewayURL()) { optionals.set(5); } - if (struct.isSetReviewProposalDescription()) { + if (struct.isSetGatewayPublicAbstract()) { optionals.set(6); } - if (struct.isSetGatewayAdminFirstName()) { + if (struct.isSetReviewProposalDescription()) { optionals.set(7); } - if (struct.isSetGatewayAdminLastName()) { + if (struct.isSetGatewayAdminFirstName()) { optionals.set(8); } - if (struct.isSetGatewayAdminEmail()) { + if (struct.isSetGatewayAdminLastName()) { optionals.set(9); } - if (struct.isSetIdentityServerUserName()) { + if (struct.isSetGatewayAdminEmail()) { optionals.set(10); } - if (struct.isSetIdentityServerPasswordToken()) { + if (struct.isSetIdentityServerUserName()) { optionals.set(11); } - if (struct.isSetDeclinedReason()) { + if (struct.isSetIdentityServerPasswordToken()) { optionals.set(12); } - if (struct.isSetOauthClientId()) { + if (struct.isSetDeclinedReason()) { optionals.set(13); } - if (struct.isSetOauthClientSecret()) { + if (struct.isSetOauthClientId()) { optionals.set(14); } - if (struct.isSetRequestCreationTime()) { + if (struct.isSetOauthClientSecret()) { optionals.set(15); } - if (struct.isSetRequesterUsername()) { + if (struct.isSetRequestCreationTime()) { optionals.set(16); } - oprot.writeBitSet(optionals, 17); + if (struct.isSetRequesterUsername()) { + optionals.set(17); + } + oprot.writeBitSet(optionals, 18); + if (struct.isSetAiravataInternalGatewayId()) { + oprot.writeString(struct.airavataInternalGatewayId); + } if (struct.isSetGatewayName()) { oprot.writeString(struct.gatewayName); } @@ -2246,72 +2372,76 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields struct.setGatewayIdIsSet(true); struct.gatewayApprovalStatus = org.apache.airavata.model.workspace.GatewayApprovalStatus.findByValue(iprot.readI32()); struct.setGatewayApprovalStatusIsSet(true); - BitSet incoming = iprot.readBitSet(17); + BitSet incoming = iprot.readBitSet(18); if (incoming.get(0)) { + struct.airavataInternalGatewayId = iprot.readString(); + struct.setAiravataInternalGatewayIdIsSet(true); + } + if (incoming.get(1)) { struct.gatewayName = iprot.readString(); struct.setGatewayNameIsSet(true); } - if (incoming.get(1)) { + if (incoming.get(2)) { struct.domain = iprot.readString(); struct.setDomainIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(3)) { struct.emailAddress = iprot.readString(); struct.setEmailAddressIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(4)) { struct.gatewayAcronym = iprot.readString(); struct.setGatewayAcronymIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(5)) { struct.gatewayURL = iprot.readString(); struct.setGatewayURLIsSet(true); } - if (incoming.get(5)) { + if (incoming.get(6)) { struct.gatewayPublicAbstract = iprot.readString(); struct.setGatewayPublicAbstractIsSet(true); } - if (incoming.get(6)) { + if (incoming.get(7)) { struct.reviewProposalDescription = iprot.readString(); struct.setReviewProposalDescriptionIsSet(true); } - if (incoming.get(7)) { + if (incoming.get(8)) { struct.gatewayAdminFirstName = iprot.readString(); struct.setGatewayAdminFirstNameIsSet(true); } - if (incoming.get(8)) { + if (incoming.get(9)) { struct.gatewayAdminLastName = iprot.readString(); struct.setGatewayAdminLastNameIsSet(true); } - if (incoming.get(9)) { + if (incoming.get(10)) { struct.gatewayAdminEmail = iprot.readString(); struct.setGatewayAdminEmailIsSet(true); } - if (incoming.get(10)) { + if (incoming.get(11)) { struct.identityServerUserName = iprot.readString(); struct.setIdentityServerUserNameIsSet(true); } - if (incoming.get(11)) { + if (incoming.get(12)) { struct.identityServerPasswordToken = iprot.readString(); struct.setIdentityServerPasswordTokenIsSet(true); } - if (incoming.get(12)) { + if (incoming.get(13)) { struct.declinedReason = iprot.readString(); struct.setDeclinedReasonIsSet(true); } - if (incoming.get(13)) { + if (incoming.get(14)) { struct.oauthClientId = iprot.readString(); struct.setOauthClientIdIsSet(true); } - if (incoming.get(14)) { + if (incoming.get(15)) { struct.oauthClientSecret = iprot.readString(); struct.setOauthClientSecretIsSet(true); } - if (incoming.get(15)) { + if (incoming.get(16)) { struct.requestCreationTime = iprot.readI64(); struct.setRequestCreationTimeIsSet(true); } - if (incoming.get(16)) { + if (incoming.get(17)) { struct.requesterUsername = iprot.readString(); struct.setRequesterUsernameIsSet(true); } http://git-wip-us.apache.org/repos/asf/airavata/blob/29718e08/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java b/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java index 2dd918e..d63957f 100644 --- a/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java +++ b/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java @@ -17,7 +17,11 @@ public class QueryConstants { "where u.gatewayId LIKE :" + UserProfile._Fields.GATEWAY_ID.getFieldName() + ""; public static final String FIND_GATEWAY_BY_ID = "SELECT g FROM GatewayEntity g " + - "where g.gatewayId LIKE :" + Gateway._Fields.GATEWAY_ID.getFieldName() + ""; + "where g.gatewayId LIKE :" + Gateway._Fields.GATEWAY_ID.getFieldName() + + "AND g.gatewayApprovalStatus LIKE :" + Gateway._Fields.GATEWAY_APPROVAL_STATUS.getFieldName(); public static final String GET_ALL_GATEWAYS = "SELECT g FROM GatewayEntity g"; + + public static final String GET_USER_GATEWAYS = "SELECT g from GatewayEntity g" + + "where g.requesterUsername LIKE :" +Gateway._Fields.REQUESTER_USERNAME.getFieldName() + ""; } http://git-wip-us.apache.org/repos/asf/airavata/blob/29718e08/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java index 51fc841..b7f3d22 100644 --- a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java +++ b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java @@ -72,23 +72,26 @@ public class TenantProfileServiceHandler implements TenantProfileService.Iface { @SecurityCheck public String addGateway(AuthzToken authzToken, Gateway gateway) throws TenantProfileServiceException, AuthorizationException, TException { try { - if (!checkDuplicate(gateway)) { + if (!checkDuplicateGateway(gateway)) { gateway = tenantProfileRepository.create(gateway); - } - if (gateway != null) { - logger.info("Added Airavata Gateway with Id: " + gateway.getGatewayId()); - // replicate tenant at end-places only if status is APPROVED - if (gateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED)) { - logger.info("Gateway with ID: {}, is now APPROVED, replicating to subscribers.", gateway.getGatewayId()); - ProfileServiceUtils.getDbEventPublisher().publish( - ProfileServiceUtils.getDBEventMessageContext(EntityType.TENANT, CrudType.CREATE, gateway), - DBEventManagerConstants.getRoutingKey(DBEventService.DB_EVENT.toString()) - ); + if (gateway != null) { + logger.info("Added Airavata Gateway with Id: " + gateway.getGatewayId()); + // replicate tenant at end-places only if status is APPROVED + if (gateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED)) { + logger.info("Gateway with ID: {}, is now APPROVED, replicating to subscribers.", gateway.getGatewayId()); + ProfileServiceUtils.getDbEventPublisher().publish( + ProfileServiceUtils.getDBEventMessageContext(EntityType.TENANT, CrudType.CREATE, gateway), + DBEventManagerConstants.getRoutingKey(DBEventService.DB_EVENT.toString()) + ); + } + // return gatewayId + return gateway.getGatewayId(); + } else { + throw new Exception("Gateway object is null."); } - // return gatewayId - return gateway.getGatewayId(); - } else { - throw new Exception("Gateway object is null."); + } + else { + throw new TenantProfileServiceException("An approved Gateway already exists with the same GatewayId, Name or URL"); } } catch (Exception ex) { logger.error("Error adding gateway-profile, reason: " + ex.getMessage(), ex); @@ -140,18 +143,17 @@ public class TenantProfileServiceHandler implements TenantProfileService.Iface { @Override @SecurityCheck - public boolean deleteGateway(AuthzToken authzToken, String gatewayId) throws TenantProfileServiceException, AuthorizationException, TException { + public boolean deleteGateway(AuthzToken authzToken, String airavataInternalGatewayId, String gatewayId) throws TenantProfileServiceException, AuthorizationException, TException { try { - logger.debug("Deleting Airavata gateway-profile with ID: " + gatewayId); - boolean deleteSuccess = tenantProfileRepository.delete(gatewayId); + logger.debug("Deleting Airavata gateway-profile with ID: " + gatewayId + "Internal ID: " + airavataInternalGatewayId); + boolean deleteSuccess = tenantProfileRepository.delete(airavataInternalGatewayId); if (deleteSuccess) { // delete tenant at end-places ProfileServiceUtils.getDbEventPublisher().publish( ProfileServiceUtils.getDBEventMessageContext(EntityType.TENANT, CrudType.DELETE, // pass along gateway datamodel, with correct gatewayId; // approvalstatus is not used for delete, hence set dummy value - new Gateway( - gatewayId, + new Gateway(gatewayId, GatewayApprovalStatus.DEACTIVATED ) ), @@ -185,8 +187,7 @@ public class TenantProfileServiceHandler implements TenantProfileService.Iface { public boolean isGatewayExist(AuthzToken authzToken, String gatewayId) throws TenantProfileServiceException, AuthorizationException, TException { try { Gateway gateway = tenantProfileRepository.getGateway(gatewayId); - boolean checkStatus = gateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED); - return (gateway != null && checkStatus); + return (gateway != null); } catch (Exception ex) { logger.error("Error checking if gateway-profile exists, reason: " + ex.getMessage(), ex); TenantProfileServiceException exception = new TenantProfileServiceException(); @@ -195,10 +196,25 @@ public class TenantProfileServiceHandler implements TenantProfileService.Iface { } } - private boolean checkDuplicate(Gateway gateway) throws TenantProfileServiceException { + @Override + @SecurityCheck + public List<Gateway> getAllGatewaysForUser(AuthzToken authzToken, String requesterUsername) throws TenantProfileServiceException, AuthorizationException, TException { + try { + return tenantProfileRepository.getAllGatewaysForUser(); + } catch (Exception ex) { + logger.error("Error getting user's gateway-profiles, reason: " + ex.getMessage(), ex); + TenantProfileServiceException exception = new TenantProfileServiceException(); + exception.setMessage("Error getting user's gateway-profiles, reason: " + ex.getMessage()); + throw exception; + } + } + + private boolean checkDuplicateGateway(Gateway gateway) throws TenantProfileServiceException { try { Gateway duplicateGateway = tenantProfileRepository.getGateway(gateway.getGatewayId()); - return ((duplicateGateway.getGatewayId() == gateway.getGatewayId()) && (duplicateGateway.getGatewayName() == gateway.getGatewayName()) && (duplicateGateway.getGatewayURL() == gateway.getGatewayURL()) && (duplicateGateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED))); + return ((duplicateGateway.getGatewayId().equals(gateway.getGatewayId())) + || (duplicateGateway.getGatewayName().equals(gateway.getGatewayName())) + || (duplicateGateway.getGatewayURL().equals(gateway.getGatewayURL()))); } catch (Exception ex) { logger.error("Error checking if duplicate gateway-profile exists, reason: " + ex.getMessage(), ex); TenantProfileServiceException exception = new TenantProfileServiceException();
