You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2016/08/26 15:43:29 UTC
[34/50] [abbrv] airavata git commit: adding requester username to
gateway
adding requester username to gateway
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d0c6957c
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d0c6957c
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d0c6957c
Branch: refs/heads/lahiru/AIRAVATA-2057
Commit: d0c6957cfb0fe298e740a5c564d7dcf2aef769ce
Parents: 779cc37
Author: scnakandala <su...@gmail.com>
Authored: Thu Aug 18 11:53:35 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Thu Aug 18 11:53:35 2016 -0400
----------------------------------------------------------------------
.../lib/airavata/workspace_model_types.cpp | 30 ++++-
.../lib/airavata/workspace_model_types.h | 15 ++-
.../lib/Airavata/Model/Workspace/Types.php | 25 ++++
.../apache/airavata/model/workspace/ttypes.py | 18 ++-
.../airavata/model/workspace/Gateway.java | 114 ++++++++++++++++++-
.../model/workspace/GatewayApprovalStatus.java | 5 +-
.../catalog/impl/GatewayRegistry.java | 1 +
.../core/experiment/catalog/model/Gateway.java | 10 ++
.../catalog/resources/GatewayResource.java | 11 ++
.../experiment/catalog/resources/Utils.java | 2 +-
.../utils/ThriftDataModelConversion.java | 1 +
.../src/main/resources/expcatalog-derby.sql | 14 +++
.../src/main/resources/expcatalog-mysql.sql | 14 +++
.../workspace_model.thrift | 6 +-
14 files changed, 251 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.cpp
index 0eccc15..edd4822 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.cpp
@@ -36,7 +36,8 @@ int _kGatewayApprovalStatusValues[] = {
GatewayApprovalStatus::ACTIVE,
GatewayApprovalStatus::DEACTIVATED,
GatewayApprovalStatus::CANCELLED,
- GatewayApprovalStatus::DENIED
+ GatewayApprovalStatus::DENIED,
+ GatewayApprovalStatus::CREATED
};
const char* _kGatewayApprovalStatusNames[] = {
"REQUESTED",
@@ -44,9 +45,10 @@ const char* _kGatewayApprovalStatusNames[] = {
"ACTIVE",
"DEACTIVATED",
"CANCELLED",
- "DENIED"
+ "DENIED",
+ "CREATED"
};
-const std::map<int, const char*> _GatewayApprovalStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kGatewayApprovalStatusValues, _kGatewayApprovalStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+const std::map<int, const char*> _GatewayApprovalStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(7, _kGatewayApprovalStatusValues, _kGatewayApprovalStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
int _kNotificationPriorityValues[] = {
NotificationPriority::LOW,
@@ -750,6 +752,11 @@ void Gateway::__set_requestCreationTime(const int64_t val) {
__isset.requestCreationTime = true;
}
+void Gateway::__set_requesterUsername(const std::string& val) {
+ this->requesterUsername = val;
+__isset.requesterUsername = true;
+}
+
uint32_t Gateway::read(::apache::thrift::protocol::TProtocol* iprot) {
apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
@@ -919,6 +926,14 @@ uint32_t Gateway::read(::apache::thrift::protocol::TProtocol* iprot) {
xfer += iprot->skip(ftype);
}
break;
+ case 19:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->requesterUsername);
+ this->__isset.requesterUsername = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
default:
xfer += iprot->skip(ftype);
break;
@@ -1028,6 +1043,11 @@ uint32_t Gateway::write(::apache::thrift::protocol::TProtocol* oprot) const {
xfer += oprot->writeI64(this->requestCreationTime);
xfer += oprot->writeFieldEnd();
}
+ if (this->__isset.requesterUsername) {
+ xfer += oprot->writeFieldBegin("requesterUsername", ::apache::thrift::protocol::T_STRING, 19);
+ xfer += oprot->writeString(this->requesterUsername);
+ xfer += oprot->writeFieldEnd();
+ }
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
@@ -1053,6 +1073,7 @@ void swap(Gateway &a, Gateway &b) {
swap(a.oauthClientId, b.oauthClientId);
swap(a.oauthClientSecret, b.oauthClientSecret);
swap(a.requestCreationTime, b.requestCreationTime);
+ swap(a.requesterUsername, b.requesterUsername);
swap(a.__isset, b.__isset);
}
@@ -1075,6 +1096,7 @@ Gateway::Gateway(const Gateway& other19) {
oauthClientId = other19.oauthClientId;
oauthClientSecret = other19.oauthClientSecret;
requestCreationTime = other19.requestCreationTime;
+ requesterUsername = other19.requesterUsername;
__isset = other19.__isset;
}
Gateway& Gateway::operator=(const Gateway& other20) {
@@ -1096,6 +1118,7 @@ Gateway& Gateway::operator=(const Gateway& other20) {
oauthClientId = other20.oauthClientId;
oauthClientSecret = other20.oauthClientSecret;
requestCreationTime = other20.requestCreationTime;
+ requesterUsername = other20.requesterUsername;
__isset = other20.__isset;
return *this;
}
@@ -1120,6 +1143,7 @@ void Gateway::printTo(std::ostream& out) const {
out << ", " << "oauthClientId="; (__isset.oauthClientId ? (out << to_string(oauthClientId)) : (out << "<null>"));
out << ", " << "oauthClientSecret="; (__isset.oauthClientSecret ? (out << to_string(oauthClientSecret)) : (out << "<null>"));
out << ", " << "requestCreationTime="; (__isset.requestCreationTime ? (out << to_string(requestCreationTime)) : (out << "<null>"));
+ out << ", " << "requesterUsername="; (__isset.requesterUsername ? (out << to_string(requesterUsername)) : (out << "<null>"));
out << ")";
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.h
index e30bb92..d6db351 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/workspace_model_types.h
@@ -44,7 +44,8 @@ struct GatewayApprovalStatus {
ACTIVE = 2,
DEACTIVATED = 3,
CANCELLED = 4,
- DENIED = 5
+ DENIED = 5,
+ CREATED = 6
};
};
@@ -298,7 +299,7 @@ inline std::ostream& operator<<(std::ostream& out, const User& obj)
}
typedef struct _Gateway__isset {
- _Gateway__isset() : gatewayName(false), domain(false), emailAddress(false), gatewayAcronym(false), gatewayURL(false), gatewayPublicAbstract(false), reviewProposalDescription(false), gatewayAdminFirstName(false), gatewayAdminLastName(false), gatewayAdminEmail(false), identityServerUserName(false), identityServerPasswordToken(false), declinedReason(false), oauthClientId(false), oauthClientSecret(false), requestCreationTime(false) {}
+ _Gateway__isset() : gatewayName(false), domain(false), emailAddress(false), gatewayAcronym(false), gatewayURL(false), gatewayPublicAbstract(false), reviewProposalDescription(false), gatewayAdminFirstName(false), gatewayAdminLastName(false), gatewayAdminEmail(false), identityServerUserName(false), identityServerPasswordToken(false), declinedReason(false), oauthClientId(false), oauthClientSecret(false), requestCreationTime(false), requesterUsername(false) {}
bool gatewayName :1;
bool domain :1;
bool emailAddress :1;
@@ -315,6 +316,7 @@ typedef struct _Gateway__isset {
bool oauthClientId :1;
bool oauthClientSecret :1;
bool requestCreationTime :1;
+ bool requesterUsername :1;
} _Gateway__isset;
class Gateway {
@@ -322,7 +324,7 @@ class Gateway {
Gateway(const Gateway&);
Gateway& operator=(const Gateway&);
- Gateway() : gatewayId(), gatewayApprovalStatus((GatewayApprovalStatus::type)0), gatewayName(), domain(), emailAddress(), gatewayAcronym(), gatewayURL(), gatewayPublicAbstract(), reviewProposalDescription(), gatewayAdminFirstName(), gatewayAdminLastName(), gatewayAdminEmail(), identityServerUserName(), identityServerPasswordToken(), declinedReason(), oauthClientId(), oauthClientSecret(), requestCreationTime(0) {
+ Gateway() : gatewayId(), gatewayApprovalStatus((GatewayApprovalStatus::type)0), gatewayName(), domain(), emailAddress(), gatewayAcronym(), gatewayURL(), gatewayPublicAbstract(), reviewProposalDescription(), gatewayAdminFirstName(), gatewayAdminLastName(), gatewayAdminEmail(), identityServerUserName(), identityServerPasswordToken(), declinedReason(), oauthClientId(), oauthClientSecret(), requestCreationTime(0), requesterUsername() {
}
virtual ~Gateway() throw();
@@ -344,6 +346,7 @@ class Gateway {
std::string oauthClientId;
std::string oauthClientSecret;
int64_t requestCreationTime;
+ std::string requesterUsername;
_Gateway__isset __isset;
@@ -383,6 +386,8 @@ class Gateway {
void __set_requestCreationTime(const int64_t val);
+ void __set_requesterUsername(const std::string& val);
+
bool operator == (const Gateway & rhs) const
{
if (!(gatewayId == rhs.gatewayId))
@@ -453,6 +458,10 @@ class Gateway {
return false;
else if (__isset.requestCreationTime && !(requestCreationTime == rhs.requestCreationTime))
return false;
+ if (__isset.requesterUsername != rhs.__isset.requesterUsername)
+ return false;
+ else if (__isset.requesterUsername && !(requesterUsername == rhs.requesterUsername))
+ return false;
return true;
}
bool operator != (const Gateway &rhs) const {
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Types.php
index 71a2eca..098511f 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Workspace/Types.php
@@ -24,6 +24,7 @@ final class GatewayApprovalStatus {
const DEACTIVATED = 3;
const CANCELLED = 4;
const DENIED = 5;
+ const CREATED = 6;
static public $__names = array(
0 => 'REQUESTED',
1 => 'APPROVED',
@@ -31,6 +32,7 @@ final class GatewayApprovalStatus {
3 => 'DEACTIVATED',
4 => 'CANCELLED',
5 => 'DENIED',
+ 6 => 'CREATED',
);
}
@@ -696,6 +698,10 @@ class Gateway {
* @var int
*/
public $requestCreationTime = null;
+ /**
+ * @var string
+ */
+ public $requesterUsername = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -772,6 +778,10 @@ class Gateway {
'var' => 'requestCreationTime',
'type' => TType::I64,
),
+ 19 => array(
+ 'var' => 'requesterUsername',
+ 'type' => TType::STRING,
+ ),
);
}
if (is_array($vals)) {
@@ -829,6 +839,9 @@ class Gateway {
if (isset($vals['requestCreationTime'])) {
$this->requestCreationTime = $vals['requestCreationTime'];
}
+ if (isset($vals['requesterUsername'])) {
+ $this->requesterUsername = $vals['requesterUsername'];
+ }
}
}
@@ -977,6 +990,13 @@ class Gateway {
$xfer += $input->skip($ftype);
}
break;
+ case 19:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->requesterUsername);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
default:
$xfer += $input->skip($ftype);
break;
@@ -1080,6 +1100,11 @@ class Gateway {
$xfer += $output->writeI64($this->requestCreationTime);
$xfer += $output->writeFieldEnd();
}
+ if ($this->requesterUsername !== null) {
+ $xfer += $output->writeFieldBegin('requesterUsername', TType::STRING, 19);
+ $xfer += $output->writeString($this->requesterUsername);
+ $xfer += $output->writeFieldEnd();
+ }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/ttypes.py
index 77a3116..d3e6914 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/ttypes.py
@@ -25,6 +25,7 @@ class GatewayApprovalStatus:
DEACTIVATED = 3
CANCELLED = 4
DENIED = 5
+ CREATED = 6
_VALUES_TO_NAMES = {
0: "REQUESTED",
@@ -33,6 +34,7 @@ class GatewayApprovalStatus:
3: "DEACTIVATED",
4: "CANCELLED",
5: "DENIED",
+ 6: "CREATED",
}
_NAMES_TO_VALUES = {
@@ -42,6 +44,7 @@ class GatewayApprovalStatus:
"DEACTIVATED": 3,
"CANCELLED": 4,
"DENIED": 5,
+ "CREATED": 6,
}
class NotificationPriority:
@@ -477,6 +480,7 @@ class Gateway:
- oauthClientId
- oauthClientSecret
- requestCreationTime
+ - requesterUsername
"""
thrift_spec = (
@@ -499,9 +503,10 @@ class Gateway:
(16, TType.STRING, 'oauthClientId', None, None, ), # 16
(17, TType.STRING, 'oauthClientSecret', None, None, ), # 17
(18, TType.I64, 'requestCreationTime', None, None, ), # 18
+ (19, TType.STRING, 'requesterUsername', None, None, ), # 19
)
- def __init__(self, gatewayId=None, gatewayApprovalStatus=None, gatewayName=None, domain=None, emailAddress=None, gatewayAcronym=None, gatewayURL=None, gatewayPublicAbstract=None, reviewProposalDescription=None, gatewayAdminFirstName=None, gatewayAdminLastName=None, gatewayAdminEmail=None, identityServerUserName=None, identityServerPasswordToken=None, declinedReason=None, oauthClientId=None, oauthClientSecret=None, requestCreationTime=None,):
+ def __init__(self, gatewayId=None, gatewayApprovalStatus=None, gatewayName=None, domain=None, emailAddress=None, gatewayAcronym=None, gatewayURL=None, gatewayPublicAbstract=None, reviewProposalDescription=None, gatewayAdminFirstName=None, gatewayAdminLastName=None, gatewayAdminEmail=None, identityServerUserName=None, identityServerPasswordToken=None, declinedReason=None, oauthClientId=None, oauthClientSecret=None, requestCreationTime=None, requesterUsername=None,):
self.gatewayId = gatewayId
self.gatewayApprovalStatus = gatewayApprovalStatus
self.gatewayName = gatewayName
@@ -520,6 +525,7 @@ class Gateway:
self.oauthClientId = oauthClientId
self.oauthClientSecret = oauthClientSecret
self.requestCreationTime = requestCreationTime
+ self.requesterUsername = requesterUsername
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -620,6 +626,11 @@ class Gateway:
self.requestCreationTime = iprot.readI64()
else:
iprot.skip(ftype)
+ elif fid == 19:
+ if ftype == TType.STRING:
+ self.requesterUsername = iprot.readString()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -702,6 +713,10 @@ class Gateway:
oprot.writeFieldBegin('requestCreationTime', TType.I64, 18)
oprot.writeI64(self.requestCreationTime)
oprot.writeFieldEnd()
+ if self.requesterUsername is not None:
+ oprot.writeFieldBegin('requesterUsername', TType.STRING, 19)
+ oprot.writeString(self.requesterUsername)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -733,6 +748,7 @@ class Gateway:
value = (value * 31) ^ hash(self.oauthClientId)
value = (value * 31) ^ hash(self.oauthClientSecret)
value = (value * 31) ^ hash(self.requestCreationTime)
+ value = (value * 31) ^ hash(self.requesterUsername)
return value
def __repr__(self):
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/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 cfe04d3..c32cc0d 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
@@ -73,6 +73,7 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -98,6 +99,7 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
private String oauthClientId; // optional
private String oauthClientSecret; // optional
private long requestCreationTime; // optional
+ private 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 {
@@ -122,7 +124,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
DECLINED_REASON((short)15, "declinedReason"),
OAUTH_CLIENT_ID((short)16, "oauthClientId"),
OAUTH_CLIENT_SECRET((short)17, "oauthClientSecret"),
- REQUEST_CREATION_TIME((short)18, "requestCreationTime");
+ REQUEST_CREATION_TIME((short)18, "requestCreationTime"),
+ REQUESTER_USERNAME((short)19, "requesterUsername");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -173,6 +176,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
return OAUTH_CLIENT_SECRET;
case 18: // REQUEST_CREATION_TIME
return REQUEST_CREATION_TIME;
+ case 19: // REQUESTER_USERNAME
+ return REQUESTER_USERNAME;
default:
return null;
}
@@ -215,7 +220,7 @@ 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};
+ 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};
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);
@@ -255,6 +260,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
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);
}
@@ -328,6 +335,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
this.oauthClientSecret = other.oauthClientSecret;
}
this.requestCreationTime = other.requestCreationTime;
+ if (other.isSetRequesterUsername()) {
+ this.requesterUsername = other.requesterUsername;
+ }
}
public Gateway deepCopy() {
@@ -355,6 +365,7 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
this.oauthClientSecret = null;
setRequestCreationTimeIsSet(false);
this.requestCreationTime = 0;
+ this.requesterUsername = null;
}
public String getGatewayId() {
@@ -778,6 +789,29 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTCREATIONTIME_ISSET_ID, value);
}
+ public String getRequesterUsername() {
+ return this.requesterUsername;
+ }
+
+ public void setRequesterUsername(String requesterUsername) {
+ this.requesterUsername = requesterUsername;
+ }
+
+ public void unsetRequesterUsername() {
+ this.requesterUsername = null;
+ }
+
+ /** Returns true if field requesterUsername is set (has been assigned a value) and false otherwise */
+ public boolean isSetRequesterUsername() {
+ return this.requesterUsername != null;
+ }
+
+ public void setRequesterUsernameIsSet(boolean value) {
+ if (!value) {
+ this.requesterUsername = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GATEWAY_ID:
@@ -924,6 +958,14 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
}
break;
+ case REQUESTER_USERNAME:
+ if (value == null) {
+ unsetRequesterUsername();
+ } else {
+ setRequesterUsername((String)value);
+ }
+ break;
+
}
}
@@ -983,6 +1025,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
case REQUEST_CREATION_TIME:
return getRequestCreationTime();
+ case REQUESTER_USERNAME:
+ return getRequesterUsername();
+
}
throw new IllegalStateException();
}
@@ -1030,6 +1075,8 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
return isSetOauthClientSecret();
case REQUEST_CREATION_TIME:
return isSetRequestCreationTime();
+ case REQUESTER_USERNAME:
+ return isSetRequesterUsername();
}
throw new IllegalStateException();
}
@@ -1209,6 +1256,15 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
return false;
}
+ boolean this_present_requesterUsername = true && this.isSetRequesterUsername();
+ boolean that_present_requesterUsername = true && that.isSetRequesterUsername();
+ if (this_present_requesterUsername || that_present_requesterUsername) {
+ if (!(this_present_requesterUsername && that_present_requesterUsername))
+ return false;
+ if (!this.requesterUsername.equals(that.requesterUsername))
+ return false;
+ }
+
return true;
}
@@ -1306,6 +1362,11 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
if (present_requestCreationTime)
list.add(requestCreationTime);
+ boolean present_requesterUsername = true && (isSetRequesterUsername());
+ list.add(present_requesterUsername);
+ if (present_requesterUsername)
+ list.add(requesterUsername);
+
return list.hashCode();
}
@@ -1497,6 +1558,16 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetRequesterUsername()).compareTo(other.isSetRequesterUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRequesterUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requesterUsername, other.requesterUsername);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -1688,6 +1759,16 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
sb.append(this.requestCreationTime);
first = false;
}
+ if (isSetRequesterUsername()) {
+ if (!first) sb.append(", ");
+ sb.append("requesterUsername:");
+ if (this.requesterUsername == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.requesterUsername);
+ }
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -1885,6 +1966,14 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 19: // REQUESTER_USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.requesterUsername = iprot.readString();
+ struct.setRequesterUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -2018,6 +2107,13 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
oprot.writeI64(struct.requestCreationTime);
oprot.writeFieldEnd();
}
+ if (struct.requesterUsername != null) {
+ if (struct.isSetRequesterUsername()) {
+ oprot.writeFieldBegin(REQUESTER_USERNAME_FIELD_DESC);
+ oprot.writeString(struct.requesterUsername);
+ oprot.writeFieldEnd();
+ }
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -2086,7 +2182,10 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
if (struct.isSetRequestCreationTime()) {
optionals.set(15);
}
- oprot.writeBitSet(optionals, 16);
+ if (struct.isSetRequesterUsername()) {
+ optionals.set(16);
+ }
+ oprot.writeBitSet(optionals, 17);
if (struct.isSetGatewayName()) {
oprot.writeString(struct.gatewayName);
}
@@ -2135,6 +2234,9 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
if (struct.isSetRequestCreationTime()) {
oprot.writeI64(struct.requestCreationTime);
}
+ if (struct.isSetRequesterUsername()) {
+ oprot.writeString(struct.requesterUsername);
+ }
}
@Override
@@ -2144,7 +2246,7 @@ 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(16);
+ BitSet incoming = iprot.readBitSet(17);
if (incoming.get(0)) {
struct.gatewayName = iprot.readString();
struct.setGatewayNameIsSet(true);
@@ -2209,6 +2311,10 @@ public class Gateway implements org.apache.thrift.TBase<Gateway, Gateway._Fields
struct.requestCreationTime = iprot.readI64();
struct.setRequestCreationTimeIsSet(true);
}
+ if (incoming.get(16)) {
+ struct.requesterUsername = iprot.readString();
+ struct.setRequesterUsernameIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayApprovalStatus.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayApprovalStatus.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayApprovalStatus.java
index 64faff9..e53ee20 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayApprovalStatus.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/GatewayApprovalStatus.java
@@ -34,7 +34,8 @@ public enum GatewayApprovalStatus implements org.apache.thrift.TEnum {
ACTIVE(2),
DEACTIVATED(3),
CANCELLED(4),
- DENIED(5);
+ DENIED(5),
+ CREATED(6);
private final int value;
@@ -67,6 +68,8 @@ public enum GatewayApprovalStatus implements org.apache.thrift.TEnum {
return CANCELLED;
case 5:
return DENIED;
+ case 6:
+ return CREATED;
default:
return null;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/GatewayRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/GatewayRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/GatewayRegistry.java
index 515b83b..83d67f2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/GatewayRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/GatewayRegistry.java
@@ -67,6 +67,7 @@ public class GatewayRegistry {
resource.setOauthClientId(gateway.getOauthClientId());
resource.setOauthClientSecret(gateway.getOauthClientSecret());
resource.setRequestCreationTime(new Timestamp(System.currentTimeMillis()));
+ resource.setRequesterUsername(gateway.getRequesterUsername());
resource.save();
return gateway.getGatewayId();
}catch (RegistryException e){
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
index e3f4113..afb67a1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
@@ -49,6 +49,7 @@ public class Gateway {
private String oauthClientId;
private String getOauthClientSecret;
private Timestamp requestCreationTime;
+ private String requesterUsername;
private Collection<GatewayWorker> gatewayWorkers;
private Collection<Project> projects;
@@ -179,6 +180,15 @@ public class Gateway {
this.identityServerPasswordToken = identityServerPasswordToken;
}
+ @Column(name = "REQUESTER_USERNAME")
+ public String getRequesterUsername() {
+ return requesterUsername;
+ }
+
+ public void setRequesterUsername(String requesterUsername) {
+ this.requesterUsername = requesterUsername;
+ }
+
@Column(name = "DECLINED_REASON")
public String getDeclinedReason() {
return declinedReason;
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
index 54bee96..646594e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
@@ -56,6 +56,7 @@ public class GatewayResource extends AbstractExpCatResource {
private String oauthClientId;
private String oauthClientSecret;
private Timestamp requestCreationTime;
+ private String requesterUsername;
public String getGatewayAdminFirstName() {
return gatewayAdminFirstName;
@@ -185,6 +186,14 @@ public class GatewayResource extends AbstractExpCatResource {
this.requestCreationTime = requestCreationTime;
}
+ public String getRequesterUsername() {
+ return requesterUsername;
+ }
+
+ public void setRequesterUsername(String requesterUsername) {
+ this.requesterUsername = requesterUsername;
+ }
+
/**
*
* @param gatewayId gateway name
@@ -473,6 +482,7 @@ public class GatewayResource extends AbstractExpCatResource {
gateway.setOauthClientId(oauthClientId);
gateway.setGetOauthClientSecret(oauthClientSecret);
gateway.setRequestCreationTime(requestCreationTime);
+ gateway.setRequesterUsername(requesterUsername);
if (existingGateway != null) {
existingGateway.setDomain(domain);
existingGateway.setGatewayApprovalStatus(gatewayApprovalStatus);
@@ -492,6 +502,7 @@ public class GatewayResource extends AbstractExpCatResource {
existingGateway.setOauthClientId(oauthClientId);
existingGateway.setGetOauthClientSecret(oauthClientSecret);
existingGateway.setRequestCreationTime(requestCreationTime);
+ existingGateway.setRequesterUsername(requesterUsername);
em.merge(existingGateway);
} else {
em.persist(gateway);
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index ff5f4e3..4852467 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -359,7 +359,7 @@ public class Utils {
gatewayResource.setDeclinedReason(o.getDeclinedReason());
gatewayResource.setOauthClientId(o.getOauthClientId());
gatewayResource.setRequestCreationTime(o.getRequestCreationTime());
- gatewayResource.setRequestCreationTime(o.getRequestCreationTime());
+ gatewayResource.setRequesterUsername(o.getRequesterUsername());
gatewayResource.setOauthClientSecret(o.getGetOauthClientSecret());
return gatewayResource;
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index 97a83cb..2fec213 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -96,6 +96,7 @@ public class ThriftDataModelConversion {
if (resource.getRequestCreationTime() != null) {
gateway.setRequestCreationTime(resource.getRequestCreationTime().getTime());
}
+ gateway.setRequesterUsername(resource.getRequesterUsername());
return gateway;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index ea5b758..275c772 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -24,6 +24,20 @@ CREATE TABLE GATEWAY
GATEWAY_NAME VARCHAR(255),
DOMAIN VARCHAR(255),
EMAIL_ADDRESS VARCHAR(255),
+ GATEWAY_ACRONYM varchar(255),
+ GATEWAY_ADMIN_EMAIL varchar(255),
+ GATEWAY_ADMIN_FIRST_NAME varchar(255),
+ GATEWAY_APPROVAL_STATUS varchar(255),
+ GATEWAY_PUBLIC_ABSTRACT varchar(255),
+ GATEWAY_URL varchar(255),
+ GATEWAY_ADMIN_LAST_NAME varchar(255),
+ IDENTITY_SERVER_PASSWORD_TOKEN varchar(255),
+ IDENTITY_SERVER_USERNAME varchar(255),
+ GATEWAY_REVIEW_PROPOSAL_DESCRIPTION varchar(255),
+ DECLINED_REASON varchar(255),
+ OAUTH_CLIENT_SECRET varchar(255),
+ OAUTH_CLIENT_ID varchar(255),
+ REQUEST_CREATION_TIME datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (GATEWAY_ID)
);
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index c9a38f0..e5d6b09 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -24,6 +24,20 @@ CREATE TABLE GATEWAY
GATEWAY_NAME VARCHAR(255),
DOMAIN VARCHAR(255),
EMAIL_ADDRESS VARCHAR(255),
+ GATEWAY_ACRONYM varchar(255),
+ GATEWAY_ADMIN_EMAIL varchar(255),
+ GATEWAY_ADMIN_FIRST_NAME varchar(255),
+ GATEWAY_APPROVAL_STATUS varchar(255),
+ GATEWAY_PUBLIC_ABSTRACT varchar(255),
+ GATEWAY_URL varchar(255),
+ GATEWAY_ADMIN_LAST_NAME varchar(255),
+ IDENTITY_SERVER_PASSWORD_TOKEN varchar(255),
+ IDENTITY_SERVER_USERNAME varchar(255),
+ GATEWAY_REVIEW_PROPOSAL_DESCRIPTION varchar(255),
+ DECLINED_REASON varchar(255),
+ OAUTH_CLIENT_SECRET varchar(255),
+ OAUTH_CLIENT_ID varchar(255),
+ REQUEST_CREATION_TIME datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (GATEWAY_ID)
);
http://git-wip-us.apache.org/repos/asf/airavata/blob/d0c6957c/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
index 8ece13f..61659c5 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/workspace_model.thrift
@@ -66,7 +66,8 @@ enum GatewayApprovalStatus {
ACTIVE,
DEACTIVATED,
CANCELLED,
- DENIED
+ DENIED,
+ CREATED
}
struct Gateway {
@@ -87,7 +88,8 @@ struct Gateway {
15: optional string declinedReason,
16: optional string oauthClientId,
17: optional string oauthClientSecret,
- 18: optional i64 requestCreationTime
+ 18: optional i64 requestCreationTime,
+ 19: optional string requesterUsername
}
enum NotificationPriority {