You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by go...@apache.org on 2017/05/08 17:58:33 UTC
[1/3] airavata git commit: Remove references to userName and instead
use userId
Repository: airavata
Updated Branches:
refs/heads/develop d0f3f5c91 -> f5a4e9dd5
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/user/cpi/UserProfileService.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/user/cpi/UserProfileService.java b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/user/cpi/UserProfileService.java
index 21e1c36..a7332c5 100644
--- a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/user/cpi/UserProfileService.java
+++ b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/user/cpi/UserProfileService.java
@@ -65,9 +65,7 @@ public class UserProfileService {
public List<org.apache.airavata.model.user.UserProfile> getAllUserProfilesInGateway(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, int offset, int limit) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
- public org.apache.airavata.model.user.UserProfile getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
-
- public boolean doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+ public boolean doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
}
@@ -83,9 +81,7 @@ public class UserProfileService {
public void getAllUserProfilesInGateway(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
@@ -263,48 +259,17 @@ public class UserProfileService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUserProfilesInGateway failed: unknown result");
}
- public org.apache.airavata.model.user.UserProfile getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
- {
- send_getUserProfileByName(authzToken, userName, gatewayId);
- return recv_getUserProfileByName();
- }
-
- public void send_getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.thrift.TException
- {
- getUserProfileByName_args args = new getUserProfileByName_args();
- args.setAuthzToken(authzToken);
- args.setUserName(userName);
- args.setGatewayId(gatewayId);
- sendBase("getUserProfileByName", args);
- }
-
- public org.apache.airavata.model.user.UserProfile recv_getUserProfileByName() throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
- {
- getUserProfileByName_result result = new getUserProfileByName_result();
- receiveBase(result, "getUserProfileByName");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.upe != null) {
- throw result.upe;
- }
- if (result.ae != null) {
- throw result.ae;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserProfileByName failed: unknown result");
- }
-
- public boolean doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ public boolean doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
{
- send_doesUserExist(authzToken, userName, gatewayId);
+ send_doesUserExist(authzToken, userId, gatewayId);
return recv_doesUserExist();
}
- public void send_doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.thrift.TException
+ public void send_doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.thrift.TException
{
doesUserExist_args args = new doesUserExist_args();
args.setAuthzToken(authzToken);
- args.setUserName(userName);
+ args.setUserId(userId);
args.setGatewayId(gatewayId);
sendBase("doesUserExist", args);
}
@@ -530,59 +495,21 @@ public class UserProfileService {
}
}
- public void getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getUserProfileByName_call method_call = new getUserProfileByName_call(authzToken, userName, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getUserProfileByName_call extends org.apache.thrift.async.TAsyncMethodCall {
- private org.apache.airavata.model.security.AuthzToken authzToken;
- private String userName;
- private String gatewayId;
- public getUserProfileByName_call(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.authzToken = authzToken;
- this.userName = userName;
- this.gatewayId = gatewayId;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserProfileByName", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getUserProfileByName_args args = new getUserProfileByName_args();
- args.setAuthzToken(authzToken);
- args.setUserName(userName);
- args.setGatewayId(gatewayId);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public org.apache.airavata.model.user.UserProfile getResult() throws org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getUserProfileByName();
- }
- }
-
- public void doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void doesUserExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- doesUserExist_call method_call = new doesUserExist_call(authzToken, userName, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ doesUserExist_call method_call = new doesUserExist_call(authzToken, userId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class doesUserExist_call extends org.apache.thrift.async.TAsyncMethodCall {
private org.apache.airavata.model.security.AuthzToken authzToken;
- private String userName;
+ private String userId;
private String gatewayId;
- public doesUserExist_call(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ public doesUserExist_call(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.authzToken = authzToken;
- this.userName = userName;
+ this.userId = userId;
this.gatewayId = gatewayId;
}
@@ -590,7 +517,7 @@ public class UserProfileService {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("doesUserExist", org.apache.thrift.protocol.TMessageType.CALL, 0));
doesUserExist_args args = new doesUserExist_args();
args.setAuthzToken(authzToken);
- args.setUserName(userName);
+ args.setUserId(userId);
args.setGatewayId(gatewayId);
args.write(prot);
prot.writeMessageEnd();
@@ -624,7 +551,6 @@ public class UserProfileService {
processMap.put("getUserProfileById", new getUserProfileById());
processMap.put("deleteUserProfile", new deleteUserProfile());
processMap.put("getAllUserProfilesInGateway", new getAllUserProfilesInGateway());
- processMap.put("getUserProfileByName", new getUserProfileByName());
processMap.put("doesUserExist", new doesUserExist());
return processMap;
}
@@ -761,32 +687,6 @@ public class UserProfileService {
}
}
- public static class getUserProfileByName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserProfileByName_args> {
- public getUserProfileByName() {
- super("getUserProfileByName");
- }
-
- public getUserProfileByName_args getEmptyArgsInstance() {
- return new getUserProfileByName_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getUserProfileByName_result getResult(I iface, getUserProfileByName_args args) throws org.apache.thrift.TException {
- getUserProfileByName_result result = new getUserProfileByName_result();
- try {
- result.success = iface.getUserProfileByName(args.authzToken, args.userName, args.gatewayId);
- } catch (org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException upe) {
- result.upe = upe;
- } catch (org.apache.airavata.model.error.AuthorizationException ae) {
- result.ae = ae;
- }
- return result;
- }
- }
-
public static class doesUserExist<I extends Iface> extends org.apache.thrift.ProcessFunction<I, doesUserExist_args> {
public doesUserExist() {
super("doesUserExist");
@@ -803,7 +703,7 @@ public class UserProfileService {
public doesUserExist_result getResult(I iface, doesUserExist_args args) throws org.apache.thrift.TException {
doesUserExist_result result = new doesUserExist_result();
try {
- result.success = iface.doesUserExist(args.authzToken, args.userName, args.gatewayId);
+ result.success = iface.doesUserExist(args.authzToken, args.userId, args.gatewayId);
result.setSuccessIsSet(true);
} catch (org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException upe) {
result.upe = upe;
@@ -832,7 +732,6 @@ public class UserProfileService {
processMap.put("getUserProfileById", new getUserProfileById());
processMap.put("deleteUserProfile", new deleteUserProfile());
processMap.put("getAllUserProfilesInGateway", new getAllUserProfilesInGateway());
- processMap.put("getUserProfileByName", new getUserProfileByName());
processMap.put("doesUserExist", new doesUserExist());
return processMap;
}
@@ -1149,68 +1048,6 @@ public class UserProfileService {
}
}
- public static class getUserProfileByName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserProfileByName_args, org.apache.airavata.model.user.UserProfile> {
- public getUserProfileByName() {
- super("getUserProfileByName");
- }
-
- public getUserProfileByName_args getEmptyArgsInstance() {
- return new getUserProfileByName_args();
- }
-
- public AsyncMethodCallback<org.apache.airavata.model.user.UserProfile> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<org.apache.airavata.model.user.UserProfile>() {
- public void onComplete(org.apache.airavata.model.user.UserProfile o) {
- getUserProfileByName_result result = new getUserProfileByName_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- getUserProfileByName_result result = new getUserProfileByName_result();
- if (e instanceof org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException) {
- result.upe = (org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException) e;
- result.setUpeIsSet(true);
- msg = result;
- }
- else if (e instanceof org.apache.airavata.model.error.AuthorizationException) {
- result.ae = (org.apache.airavata.model.error.AuthorizationException) e;
- result.setAeIsSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, getUserProfileByName_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.user.UserProfile> resultHandler) throws TException {
- iface.getUserProfileByName(args.authzToken, args.userName, args.gatewayId,resultHandler);
- }
- }
-
public static class doesUserExist<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, doesUserExist_args, Boolean> {
public doesUserExist() {
super("doesUserExist");
@@ -1270,7 +1107,7 @@ public class UserProfileService {
}
public void start(I iface, doesUserExist_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.doesUserExist(args.authzToken, args.userName, args.gatewayId,resultHandler);
+ iface.doesUserExist(args.authzToken, args.userId, args.gatewayId,resultHandler);
}
}
@@ -6918,27 +6755,27 @@ public class UserProfileService {
}
- public static class getUserProfileByName_args implements org.apache.thrift.TBase<getUserProfileByName_args, getUserProfileByName_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserProfileByName_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserProfileByName_args");
+ public static class doesUserExist_args implements org.apache.thrift.TBase<doesUserExist_args, doesUserExist_args._Fields>, java.io.Serializable, Cloneable, Comparable<doesUserExist_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doesUserExist_args");
private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)2);
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)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
- schemes.put(StandardScheme.class, new getUserProfileByName_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getUserProfileByName_argsTupleSchemeFactory());
+ schemes.put(StandardScheme.class, new doesUserExist_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new doesUserExist_argsTupleSchemeFactory());
}
public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public String userName; // required
+ public String userId; // required
public String gatewayId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
AUTHZ_TOKEN((short)1, "authzToken"),
- USER_NAME((short)2, "userName"),
+ USER_ID((short)2, "userId"),
GATEWAY_ID((short)3, "gatewayId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -6956,8 +6793,8 @@ public class UserProfileService {
switch(fieldId) {
case 1: // AUTHZ_TOKEN
return AUTHZ_TOKEN;
- case 2: // USER_NAME
- return USER_NAME;
+ case 2: // USER_ID
+ return USER_ID;
case 3: // GATEWAY_ID
return GATEWAY_ID;
default:
@@ -7005,51 +6842,51 @@ public class UserProfileService {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
- tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.REQUIRED,
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserProfileByName_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doesUserExist_args.class, metaDataMap);
}
- public getUserProfileByName_args() {
+ public doesUserExist_args() {
}
- public getUserProfileByName_args(
+ public doesUserExist_args(
org.apache.airavata.model.security.AuthzToken authzToken,
- String userName,
+ String userId,
String gatewayId)
{
this();
this.authzToken = authzToken;
- this.userName = userName;
+ this.userId = userId;
this.gatewayId = gatewayId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public getUserProfileByName_args(getUserProfileByName_args other) {
+ public doesUserExist_args(doesUserExist_args other) {
if (other.isSetAuthzToken()) {
this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
}
- if (other.isSetUserName()) {
- this.userName = other.userName;
+ if (other.isSetUserId()) {
+ this.userId = other.userId;
}
if (other.isSetGatewayId()) {
this.gatewayId = other.gatewayId;
}
}
- public getUserProfileByName_args deepCopy() {
- return new getUserProfileByName_args(this);
+ public doesUserExist_args deepCopy() {
+ return new doesUserExist_args(this);
}
@Override
public void clear() {
this.authzToken = null;
- this.userName = null;
+ this.userId = null;
this.gatewayId = null;
}
@@ -7057,7 +6894,7 @@ public class UserProfileService {
return this.authzToken;
}
- public getUserProfileByName_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
+ public doesUserExist_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
this.authzToken = authzToken;
return this;
}
@@ -7077,27 +6914,27 @@ public class UserProfileService {
}
}
- public String getUserName() {
- return this.userName;
+ public String getUserId() {
+ return this.userId;
}
- public getUserProfileByName_args setUserName(String userName) {
- this.userName = userName;
+ public doesUserExist_args setUserId(String userId) {
+ this.userId = userId;
return this;
}
- public void unsetUserName() {
- this.userName = null;
+ public void unsetUserId() {
+ this.userId = null;
}
- /** Returns true if field userName is set (has been assigned a value) and false otherwise */
- public boolean isSetUserName() {
- return this.userName != null;
+ /** Returns true if field userId is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserId() {
+ return this.userId != null;
}
- public void setUserNameIsSet(boolean value) {
+ public void setUserIdIsSet(boolean value) {
if (!value) {
- this.userName = null;
+ this.userId = null;
}
}
@@ -7105,7 +6942,7 @@ public class UserProfileService {
return this.gatewayId;
}
- public getUserProfileByName_args setGatewayId(String gatewayId) {
+ public doesUserExist_args setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
return this;
}
@@ -7135,11 +6972,11 @@ public class UserProfileService {
}
break;
- case USER_NAME:
+ case USER_ID:
if (value == null) {
- unsetUserName();
+ unsetUserId();
} else {
- setUserName((String)value);
+ setUserId((String)value);
}
break;
@@ -7159,8 +6996,8 @@ public class UserProfileService {
case AUTHZ_TOKEN:
return getAuthzToken();
- case USER_NAME:
- return getUserName();
+ case USER_ID:
+ return getUserId();
case GATEWAY_ID:
return getGatewayId();
@@ -7178,8 +7015,8 @@ public class UserProfileService {
switch (field) {
case AUTHZ_TOKEN:
return isSetAuthzToken();
- case USER_NAME:
- return isSetUserName();
+ case USER_ID:
+ return isSetUserId();
case GATEWAY_ID:
return isSetGatewayId();
}
@@ -7190,12 +7027,12 @@ public class UserProfileService {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof getUserProfileByName_args)
- return this.equals((getUserProfileByName_args)that);
+ if (that instanceof doesUserExist_args)
+ return this.equals((doesUserExist_args)that);
return false;
}
- public boolean equals(getUserProfileByName_args that) {
+ public boolean equals(doesUserExist_args that) {
if (that == null)
return false;
@@ -7208,12 +7045,12 @@ public class UserProfileService {
return false;
}
- boolean this_present_userName = true && this.isSetUserName();
- boolean that_present_userName = true && that.isSetUserName();
- if (this_present_userName || that_present_userName) {
- if (!(this_present_userName && that_present_userName))
+ boolean this_present_userId = true && this.isSetUserId();
+ boolean that_present_userId = true && that.isSetUserId();
+ if (this_present_userId || that_present_userId) {
+ if (!(this_present_userId && that_present_userId))
return false;
- if (!this.userName.equals(that.userName))
+ if (!this.userId.equals(that.userId))
return false;
}
@@ -7238,10 +7075,10 @@ public class UserProfileService {
if (present_authzToken)
list.add(authzToken);
- boolean present_userName = true && (isSetUserName());
- list.add(present_userName);
- if (present_userName)
- list.add(userName);
+ boolean present_userId = true && (isSetUserId());
+ list.add(present_userId);
+ if (present_userId)
+ list.add(userId);
boolean present_gatewayId = true && (isSetGatewayId());
list.add(present_gatewayId);
@@ -7252,7 +7089,7 @@ public class UserProfileService {
}
@Override
- public int compareTo(getUserProfileByName_args other) {
+ public int compareTo(doesUserExist_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
@@ -7269,12 +7106,12 @@ public class UserProfileService {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetUserName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ if (isSetUserId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId);
if (lastComparison != 0) {
return lastComparison;
}
@@ -7306,7 +7143,7 @@ public class UserProfileService {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("getUserProfileByName_args(");
+ StringBuilder sb = new StringBuilder("doesUserExist_args(");
boolean first = true;
sb.append("authzToken:");
@@ -7317,11 +7154,11 @@ public class UserProfileService {
}
first = false;
if (!first) sb.append(", ");
- sb.append("userName:");
- if (this.userName == null) {
+ sb.append("userId:");
+ if (this.userId == null) {
sb.append("null");
} else {
- sb.append(this.userName);
+ sb.append(this.userId);
}
first = false;
if (!first) sb.append(", ");
@@ -7341,8 +7178,8 @@ public class UserProfileService {
if (authzToken == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
}
- if (userName == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
+ if (userId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'userId' was not present! Struct: " + toString());
}
if (gatewayId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
@@ -7369,15 +7206,15 @@ public class UserProfileService {
}
}
- private static class getUserProfileByName_argsStandardSchemeFactory implements SchemeFactory {
- public getUserProfileByName_argsStandardScheme getScheme() {
- return new getUserProfileByName_argsStandardScheme();
+ private static class doesUserExist_argsStandardSchemeFactory implements SchemeFactory {
+ public doesUserExist_argsStandardScheme getScheme() {
+ return new doesUserExist_argsStandardScheme();
}
}
- private static class getUserProfileByName_argsStandardScheme extends StandardScheme<getUserProfileByName_args> {
+ private static class doesUserExist_argsStandardScheme extends StandardScheme<doesUserExist_args> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, doesUserExist_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -7396,10 +7233,10 @@ public class UserProfileService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 2: // USER_NAME
+ case 2: // USER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
+ struct.userId = iprot.readString();
+ struct.setUserIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -7423,7 +7260,7 @@ public class UserProfileService {
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, doesUserExist_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
@@ -7432,9 +7269,9 @@ public class UserProfileService {
struct.authzToken.write(oprot);
oprot.writeFieldEnd();
}
- if (struct.userName != null) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
+ if (struct.userId != null) {
+ oprot.writeFieldBegin(USER_ID_FIELD_DESC);
+ oprot.writeString(struct.userId);
oprot.writeFieldEnd();
}
if (struct.gatewayId != null) {
@@ -7448,1171 +7285,30 @@ public class UserProfileService {
}
- private static class getUserProfileByName_argsTupleSchemeFactory implements SchemeFactory {
- public getUserProfileByName_argsTupleScheme getScheme() {
- return new getUserProfileByName_argsTupleScheme();
+ private static class doesUserExist_argsTupleSchemeFactory implements SchemeFactory {
+ public doesUserExist_argsTupleScheme getScheme() {
+ return new doesUserExist_argsTupleScheme();
}
}
- private static class getUserProfileByName_argsTupleScheme extends TupleScheme<getUserProfileByName_args> {
+ private static class doesUserExist_argsTupleScheme extends TupleScheme<doesUserExist_args> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, doesUserExist_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.authzToken.write(oprot);
- oprot.writeString(struct.userName);
+ oprot.writeString(struct.userId);
oprot.writeString(struct.gatewayId);
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, doesUserExist_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
struct.authzToken.read(iprot);
struct.setAuthzTokenIsSet(true);
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- struct.gatewayId = iprot.readString();
- struct.setGatewayIdIsSet(true);
- }
- }
-
- }
-
- public static class getUserProfileByName_result implements org.apache.thrift.TBase<getUserProfileByName_result, getUserProfileByName_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserProfileByName_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserProfileByName_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
- private static final org.apache.thrift.protocol.TField UPE_FIELD_DESC = new org.apache.thrift.protocol.TField("upe", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField AE_FIELD_DESC = new org.apache.thrift.protocol.TField("ae", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getUserProfileByName_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getUserProfileByName_resultTupleSchemeFactory());
- }
-
- public org.apache.airavata.model.user.UserProfile success; // required
- public org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException upe; // required
- public org.apache.airavata.model.error.AuthorizationException ae; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success"),
- UPE((short)1, "upe"),
- AE((short)2, "ae");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- case 1: // UPE
- return UPE;
- case 2: // AE
- return AE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.user.UserProfile.class)));
- tmpMap.put(_Fields.UPE, new org.apache.thrift.meta_data.FieldMetaData("upe", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserProfileByName_result.class, metaDataMap);
- }
-
- public getUserProfileByName_result() {
- }
-
- public getUserProfileByName_result(
- org.apache.airavata.model.user.UserProfile success,
- org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException upe,
- org.apache.airavata.model.error.AuthorizationException ae)
- {
- this();
- this.success = success;
- this.upe = upe;
- this.ae = ae;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getUserProfileByName_result(getUserProfileByName_result other) {
- if (other.isSetSuccess()) {
- this.success = new org.apache.airavata.model.user.UserProfile(other.success);
- }
- if (other.isSetUpe()) {
- this.upe = new org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException(other.upe);
- }
- if (other.isSetAe()) {
- this.ae = new org.apache.airavata.model.error.AuthorizationException(other.ae);
- }
- }
-
- public getUserProfileByName_result deepCopy() {
- return new getUserProfileByName_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- this.upe = null;
- this.ae = null;
- }
-
- public org.apache.airavata.model.user.UserProfile getSuccess() {
- return this.success;
- }
-
- public getUserProfileByName_result setSuccess(org.apache.airavata.model.user.UserProfile success) {
- this.success = success;
- return this;
- }
-
- public void unsetSuccess() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return this.success != null;
- }
-
- public void setSuccessIsSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException getUpe() {
- return this.upe;
- }
-
- public getUserProfileByName_result setUpe(org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException upe) {
- this.upe = upe;
- return this;
- }
-
- public void unsetUpe() {
- this.upe = null;
- }
-
- /** Returns true if field upe is set (has been assigned a value) and false otherwise */
- public boolean isSetUpe() {
- return this.upe != null;
- }
-
- public void setUpeIsSet(boolean value) {
- if (!value) {
- this.upe = null;
- }
- }
-
- public org.apache.airavata.model.error.AuthorizationException getAe() {
- return this.ae;
- }
-
- public getUserProfileByName_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
- this.ae = ae;
- return this;
- }
-
- public void unsetAe() {
- this.ae = null;
- }
-
- /** Returns true if field ae is set (has been assigned a value) and false otherwise */
- public boolean isSetAe() {
- return this.ae != null;
- }
-
- public void setAeIsSet(boolean value) {
- if (!value) {
- this.ae = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((org.apache.airavata.model.user.UserProfile)value);
- }
- break;
-
- case UPE:
- if (value == null) {
- unsetUpe();
- } else {
- setUpe((org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException)value);
- }
- break;
-
- case AE:
- if (value == null) {
- unsetAe();
- } else {
- setAe((org.apache.airavata.model.error.AuthorizationException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return getSuccess();
-
- case UPE:
- return getUpe();
-
- case AE:
- return getAe();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- case UPE:
- return isSetUpe();
- case AE:
- return isSetAe();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getUserProfileByName_result)
- return this.equals((getUserProfileByName_result)that);
- return false;
- }
-
- public boolean equals(getUserProfileByName_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.isSetSuccess();
- boolean that_present_success = true && that.isSetSuccess();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- boolean this_present_upe = true && this.isSetUpe();
- boolean that_present_upe = true && that.isSetUpe();
- if (this_present_upe || that_present_upe) {
- if (!(this_present_upe && that_present_upe))
- return false;
- if (!this.upe.equals(that.upe))
- return false;
- }
-
- boolean this_present_ae = true && this.isSetAe();
- boolean that_present_ae = true && that.isSetAe();
- if (this_present_ae || that_present_ae) {
- if (!(this_present_ae && that_present_ae))
- return false;
- if (!this.ae.equals(that.ae))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_success = true && (isSetSuccess());
- list.add(present_success);
- if (present_success)
- list.add(success);
-
- boolean present_upe = true && (isSetUpe());
- list.add(present_upe);
- if (present_upe)
- list.add(upe);
-
- boolean present_ae = true && (isSetAe());
- list.add(present_ae);
- if (present_ae)
- list.add(ae);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(getUserProfileByName_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetUpe()).compareTo(other.isSetUpe());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUpe()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.upe, other.upe);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAe()).compareTo(other.isSetAe());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAe()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ae, other.ae);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getUserProfileByName_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("upe:");
- if (this.upe == null) {
- sb.append("null");
- } else {
- sb.append(this.upe);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("ae:");
- if (this.ae == null) {
- sb.append("null");
- } else {
- sb.append(this.ae);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (success != null) {
- success.validate();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getUserProfileByName_resultStandardSchemeFactory implements SchemeFactory {
- public getUserProfileByName_resultStandardScheme getScheme() {
- return new getUserProfileByName_resultStandardScheme();
- }
- }
-
- private static class getUserProfileByName_resultStandardScheme extends StandardScheme<getUserProfileByName_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.success = new org.apache.airavata.model.user.UserProfile();
- struct.success.read(iprot);
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 1: // UPE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.upe = new org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException();
- struct.upe.read(iprot);
- struct.setUpeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // AE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.ae = new org.apache.airavata.model.error.AuthorizationException();
- struct.ae.read(iprot);
- struct.setAeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- struct.success.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.upe != null) {
- oprot.writeFieldBegin(UPE_FIELD_DESC);
- struct.upe.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.ae != null) {
- oprot.writeFieldBegin(AE_FIELD_DESC);
- struct.ae.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getUserProfileByName_resultTupleSchemeFactory implements SchemeFactory {
- public getUserProfileByName_resultTupleScheme getScheme() {
- return new getUserProfileByName_resultTupleScheme();
- }
- }
-
- private static class getUserProfileByName_resultTupleScheme extends TupleScheme<getUserProfileByName_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
- if (struct.isSetUpe()) {
- optionals.set(1);
- }
- if (struct.isSetAe()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.isSetSuccess()) {
- struct.success.write(oprot);
- }
- if (struct.isSetUpe()) {
- struct.upe.write(oprot);
- }
- if (struct.isSetAe()) {
- struct.ae.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.success = new org.apache.airavata.model.user.UserProfile();
- struct.success.read(iprot);
- struct.setSuccessIsSet(true);
- }
- if (incoming.get(1)) {
- struct.upe = new org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException();
- struct.upe.read(iprot);
- struct.setUpeIsSet(true);
- }
- if (incoming.get(2)) {
- struct.ae = new org.apache.airavata.model.error.AuthorizationException();
- struct.ae.read(iprot);
- struct.setAeIsSet(true);
- }
- }
- }
-
- }
-
- public static class doesUserExist_args implements org.apache.thrift.TBase<doesUserExist_args, doesUserExist_args._Fields>, java.io.Serializable, Cloneable, Comparable<doesUserExist_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doesUserExist_args");
-
- private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
- 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)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new doesUserExist_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new doesUserExist_argsTupleSchemeFactory());
- }
-
- public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public String userName; // required
- public String gatewayId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- AUTHZ_TOKEN((short)1, "authzToken"),
- USER_NAME((short)2, "userName"),
- GATEWAY_ID((short)3, "gatewayId");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // AUTHZ_TOKEN
- return AUTHZ_TOKEN;
- case 2: // USER_NAME
- return USER_NAME;
- case 3: // GATEWAY_ID
- return GATEWAY_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
- tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doesUserExist_args.class, metaDataMap);
- }
-
- public doesUserExist_args() {
- }
-
- public doesUserExist_args(
- org.apache.airavata.model.security.AuthzToken authzToken,
- String userName,
- String gatewayId)
- {
- this();
- this.authzToken = authzToken;
- this.userName = userName;
- this.gatewayId = gatewayId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public doesUserExist_args(doesUserExist_args other) {
- if (other.isSetAuthzToken()) {
- this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
- }
- if (other.isSetUserName()) {
- this.userName = other.userName;
- }
- if (other.isSetGatewayId()) {
- this.gatewayId = other.gatewayId;
- }
- }
-
- public doesUserExist_args deepCopy() {
- return new doesUserExist_args(this);
- }
-
- @Override
- public void clear() {
- this.authzToken = null;
- this.userName = null;
- this.gatewayId = null;
- }
-
- public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
- return this.authzToken;
- }
-
- public doesUserExist_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
- this.authzToken = authzToken;
- return this;
- }
-
- public void unsetAuthzToken() {
- this.authzToken = null;
- }
-
- /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
- public boolean isSetAuthzToken() {
- return this.authzToken != null;
- }
-
- public void setAuthzTokenIsSet(boolean value) {
- if (!value) {
- this.authzToken = null;
- }
- }
-
- public String getUserName() {
- return this.userName;
- }
-
- public doesUserExist_args setUserName(String userName) {
- this.userName = userName;
- return this;
- }
-
- public void unsetUserName() {
- this.userName = null;
- }
-
- /** Returns true if field userName is set (has been assigned a value) and false otherwise */
- public boolean isSetUserName() {
- return this.userName != null;
- }
-
- public void setUserNameIsSet(boolean value) {
- if (!value) {
- this.userName = null;
- }
- }
-
- public String getGatewayId() {
- return this.gatewayId;
- }
-
- public doesUserExist_args setGatewayId(String gatewayId) {
- this.gatewayId = gatewayId;
- return this;
- }
-
- public void unsetGatewayId() {
- this.gatewayId = null;
- }
-
- /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
- public boolean isSetGatewayId() {
- return this.gatewayId != null;
- }
-
- public void setGatewayIdIsSet(boolean value) {
- if (!value) {
- this.gatewayId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case AUTHZ_TOKEN:
- if (value == null) {
- unsetAuthzToken();
- } else {
- setAuthzToken((org.apache.airavata.model.security.AuthzToken)value);
- }
- break;
-
- case USER_NAME:
- if (value == null) {
- unsetUserName();
- } else {
- setUserName((String)value);
- }
- break;
-
- case GATEWAY_ID:
- if (value == null) {
- unsetGatewayId();
- } else {
- setGatewayId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case AUTHZ_TOKEN:
- return getAuthzToken();
-
- case USER_NAME:
- return getUserName();
-
- case GATEWAY_ID:
- return getGatewayId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case AUTHZ_TOKEN:
- return isSetAuthzToken();
- case USER_NAME:
- return isSetUserName();
- case GATEWAY_ID:
- return isSetGatewayId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof doesUserExist_args)
- return this.equals((doesUserExist_args)that);
- return false;
- }
-
- public boolean equals(doesUserExist_args that) {
- if (that == null)
- return false;
-
- boolean this_present_authzToken = true && this.isSetAuthzToken();
- boolean that_present_authzToken = true && that.isSetAuthzToken();
- if (this_present_authzToken || that_present_authzToken) {
- if (!(this_present_authzToken && that_present_authzToken))
- return false;
- if (!this.authzToken.equals(that.authzToken))
- return false;
- }
-
- boolean this_present_userName = true && this.isSetUserName();
- boolean that_present_userName = true && that.isSetUserName();
- if (this_present_userName || that_present_userName) {
- if (!(this_present_userName && that_present_userName))
- return false;
- if (!this.userName.equals(that.userName))
- return false;
- }
-
- boolean this_present_gatewayId = true && this.isSetGatewayId();
- boolean that_present_gatewayId = true && that.isSetGatewayId();
- if (this_present_gatewayId || that_present_gatewayId) {
- if (!(this_present_gatewayId && that_present_gatewayId))
- return false;
- if (!this.gatewayId.equals(that.gatewayId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_authzToken = true && (isSetAuthzToken());
- list.add(present_authzToken);
- if (present_authzToken)
- list.add(authzToken);
-
- boolean present_userName = true && (isSetUserName());
- list.add(present_userName);
- if (present_userName)
- list.add(userName);
-
- boolean present_gatewayId = true && (isSetGatewayId());
- list.add(present_gatewayId);
- if (present_gatewayId)
- list.add(gatewayId);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(doesUserExist_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAuthzToken()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUserName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetGatewayId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("doesUserExist_args(");
- boolean first = true;
-
- sb.append("authzToken:");
- if (this.authzToken == null) {
- sb.append("null");
- } else {
- sb.append(this.authzToken);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("userName:");
- if (this.userName == null) {
- sb.append("null");
- } else {
- sb.append(this.userName);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("gatewayId:");
- if (this.gatewayId == null) {
- sb.append("null");
- } else {
- sb.append(this.gatewayId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (authzToken == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
- }
- if (userName == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
- }
- if (gatewayId == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
- }
- // check for sub-struct validity
- if (authzToken != null) {
- authzToken.validate();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class doesUserExist_argsStandardSchemeFactory implements SchemeFactory {
- public doesUserExist_argsStandardScheme getScheme() {
- return new doesUserExist_argsStandardScheme();
- }
- }
-
- private static class doesUserExist_argsStandardScheme extends StandardScheme<doesUserExist_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, doesUserExist_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // AUTHZ_TOKEN
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
- struct.authzToken.read(iprot);
- struct.setAuthzTokenIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // USER_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // GATEWAY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.gatewayId = iprot.readString();
- struct.setGatewayIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, doesUserExist_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.authzToken != null) {
- oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
- struct.authzToken.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.userName != null) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
- oprot.writeFieldEnd();
- }
- if (struct.gatewayId != null) {
- oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
- oprot.writeString(struct.gatewayId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class doesUserExist_argsTupleSchemeFactory implements SchemeFactory {
- public doesUserExist_argsTupleScheme getScheme() {
- return new doesUserExist_argsTupleScheme();
- }
- }
-
- private static class doesUserExist_argsTupleScheme extends TupleScheme<doesUserExist_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, doesUserExist_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.authzToken.write(oprot);
- oprot.writeString(struct.userName);
- oprot.writeString(struct.gatewayId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, doesUserExist_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
- struct.authzToken.read(iprot);
- struct.setAuthzTokenIsSet(true);
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
+ struct.userId = iprot.readString();
+ struct.setUserIdIsSet(true);
struct.gatewayId = iprot.readString();
struct.setGatewayIdIsSet(true);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/profile-user-core/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/profile-user-core/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java b/airavata-services/profile-service/profile-user-core/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
index ff14c7f..5398e27 100644
--- a/airavata-services/profile-service/profile-user-core/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
+++ b/airavata-services/profile-service/profile-user-core/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
@@ -72,22 +72,6 @@ public class UserProfileRepository extends AbstractRepository<UserProfile, UserP
return resultList;
}
- public UserProfile getUserProfileByNameAndGateWay(String name, String gatewayId) {
-
- UserProfile userProfile = null;
-
- Map<String, Object> queryParam = new HashMap<String, Object>();
- queryParam.put(UserProfile._Fields.USER_NAME.getFieldName(), name);
- queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), gatewayId);
- List<UserProfile> resultList = select(QueryConstants.FIND_USER_PROFILE_BY_USER_NAME, 1, 0, queryParam);
- logger.info("List: " + resultList);
-
- if (resultList != null && resultList.size() > 0)
- userProfile = resultList.get(0);
-
- return userProfile;
- }
-
// public static void main(String args[]) {
// Mapper mapper = ObjectMapperSingleton.getInstance();
// UserProfile up = new UserProfile();
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index ea63c09..cd4368a 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -3848,11 +3848,11 @@ public class RegistryServerHandler implements RegistryService.Iface {
try {
//FIXME: figure out a way to get password
logger.info("Adding User in Registry: " + userProfile);
- if (isUserExists(userProfile.getGatewayId(), userProfile.getUserName())) {
- throw new DuplicateEntryException("User already exists, with userName: " +
- userProfile.getUserName() + ", and gatewayId: " + userProfile.getGatewayId());
+ if (isUserExists(userProfile.getGatewayId(), userProfile.getUserId())) {
+ throw new DuplicateEntryException("User already exists, with userId: " +
+ userProfile.getUserId() + ", and gatewayId: " + userProfile.getGatewayId());
}
- ExpCatResourceUtils.addUser(userProfile.getUserName(), null, userProfile.getGatewayId());
+ ExpCatResourceUtils.addUser(userProfile.getUserId(), null, userProfile.getGatewayId());
return userProfile.getUserId();
} catch (RegistryException ex) {
logger.error("Error while adding user in registry: " + ex, ex);
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/utils/ThriftDataModelConversion.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/utils/ThriftDataModelConversion.java
index 53d8d2e..99db7f1 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/utils/ThriftDataModelConversion.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/utils/ThriftDataModelConversion.java
@@ -21,7 +21,7 @@ public class ThriftDataModelConversion {
User user = new User();
user.setUserId(userProfile.getUserId());
user.setDomainId(userProfile.getGatewayId());
- user.setUserName(userProfile.getUserName());
+ user.setUserName(userProfile.getFirstName() + " " + userProfile.getLastName());
user.setEmail(userProfile.getEmails().get(0));
return user;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/modules/user-profile-migration/src/main/java/org/apache/airavata/MigrationManager.java
----------------------------------------------------------------------
diff --git a/modules/user-profile-migration/src/main/java/org/apache/airavata/MigrationManager.java b/modules/user-profile-migration/src/main/java/org/apache/airavata/MigrationManager.java
index e9df594..1b4c649 100644
--- a/modules/user-profile-migration/src/main/java/org/apache/airavata/MigrationManager.java
+++ b/modules/user-profile-migration/src/main/java/org/apache/airavata/MigrationManager.java
@@ -110,7 +110,8 @@ public class MigrationManager {
UserProfile airavataUserProfile = new UserProfile();
// Here are the data associations...
for(UserProfileDAO ISProfile : ISProfileList){
- airavataUserProfile.setUserName(ISProfile.getFirstName()+" "+ISProfile.getLastName());
+ airavataUserProfile.setFirstName(ISProfile.getFirstName());
+ airavataUserProfile.setLastName(ISProfile.getLastName());
airavataUserProfile.setUserId(ISProfile.getUserName());
airavataUserProfile.setGatewayId(ISProfile.getGatewayID());
List<String> emails = new ArrayList<String>();
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index e952abb..9cd5c9e 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -3498,13 +3498,7 @@ bool createGroup(1: required security_model.AuthzToken authzToken, 2: required g
3: airavata_errors.AiravataSystemException ase,
4: airavata_errors.AuthorizationException ae)
- user_profile_model.UserProfile getUserProfileByName(1: required security_model.AuthzToken authzToken, 2: required string userName, 3: required string gatewayId)
- throws (1: airavata_errors.InvalidRequestException ire,
- 2: airavata_errors.AiravataClientException ace,
- 3: airavata_errors.AiravataSystemException ase,
- 4: airavata_errors.AuthorizationException ae)
-
- bool doesUserProfileExist(1: required security_model.AuthzToken authzToken, 2: required string userName, 3: required string gatewayId)
+ bool doesUserProfileExist(1: required security_model.AuthzToken authzToken, 2: required string userId, 3: required string gatewayId)
throws (1: airavata_errors.InvalidRequestException ire,
2: airavata_errors.AiravataClientException ace,
3: airavata_errors.AiravataSystemException ase,
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/thrift-interface-descriptions/data-models/user-tenant-group-models/user_profile_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/user-tenant-group-models/user_profile_model.thrift b/thrift-interface-descriptions/data-models/user-tenant-group-models/user_profile_model.thrift
index 638eb01..101f297 100644
--- a/thrift-interface-descriptions/data-models/user-tenant-group-models/user_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/user-tenant-group-models/user_profile_model.thrift
@@ -178,20 +178,19 @@ struct UserProfile {
8: optional string middleName,
9: optional string namePrefix,
10: optional string nameSuffix,
- 11: optional string userName,
- 12: optional string orcidId,
- 13: optional list<string> phones,
- 14: optional string country,
- 15: optional list<string> nationality,
- 16: optional string homeOrganization,
- 17: optional string orginationAffiliation,
- 18: required i64 creationTime,
- 19: required i64 lastAccessTime,
- 20: required i64 validUntil,
- 21: required Status State,
- 22: optional string comments,
- 23: optional list<string> labeledURI,
- 24: optional string gpgKey,
- 25: optional string timeZone,
- 26: optional NSFDemographics nsfDemographics
+ 11: optional string orcidId,
+ 12: optional list<string> phones,
+ 13: optional string country,
+ 14: optional list<string> nationality,
+ 15: optional string homeOrganization,
+ 16: optional string orginationAffiliation,
+ 17: required i64 creationTime,
+ 18: required i64 lastAccessTime,
+ 19: required i64 validUntil,
+ 20: required Status State,
+ 21: optional string comments,
+ 22: optional list<string> labeledURI,
+ 23: optional string gpgKey,
+ 24: optional string timeZone,
+ 25: optional NSFDemographics nsfDemographics
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/thrift-interface-descriptions/service-cpis/profile-service/profile-user/profile-user-cpi.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/service-cpis/profile-service/profile-user/profile-user-cpi.thrift b/thrift-interface-descriptions/service-cpis/profile-service/profile-user/profile-user-cpi.thrift
index 13f6a5c..937156f 100644
--- a/thrift-interface-descriptions/service-cpis/profile-service/profile-user/profile-user-cpi.thrift
+++ b/thrift-interface-descriptions/service-cpis/profile-service/profile-user/profile-user-cpi.thrift
@@ -65,14 +65,8 @@ service UserProfileService {
throws (1: profile_user_cpi_errors.UserProfileServiceException upe,
2: airavata_errors.AuthorizationException ae);
- user_profile_model.UserProfile getUserProfileByName (1: required security_model.AuthzToken authzToken,
- 2: required string userName,
- 3: required string gatewayId)
- throws (1: profile_user_cpi_errors.UserProfileServiceException upe,
- 2: airavata_errors.AuthorizationException ae);
-
bool doesUserExist (1: required security_model.AuthzToken authzToken,
- 2: required string userName,
+ 2: required string userId,
3: required string gatewayId)
throws (1: profile_user_cpi_errors.UserProfileServiceException upe,
2: airavata_errors.AuthorizationException ae);
[3/3] airavata git commit: Remove references to userName and instead
use userId
Posted by go...@apache.org.
Remove references to userName and instead use userId
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/f5a4e9dd
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/f5a4e9dd
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/f5a4e9dd
Branch: refs/heads/develop
Commit: f5a4e9dd574b2dafa6a070951f6f6cd5f3fa1b20
Parents: d0f3f5c
Author: Gourav Shenoy <go...@apache.org>
Authored: Mon May 8 13:58:26 2017 -0400
Committer: Gourav Shenoy <go...@apache.org>
Committed: Mon May 8 13:58:26 2017 -0400
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 16 -
.../java/org/apache/airavata/api/Airavata.java | 1710 +-----------------
.../apache/airavata/model/user/UserProfile.java | 274 +--
.../core/impl/TenantManagementKeycloakImpl.java | 3 +-
.../services/core/tests/SetupNewGateway.java | 3 +-
.../client/samples/UserProfileSample.java | 18 +-
.../profile/commons/utils/QueryConstants.java | 4 -
.../handlers/UserProfileServiceHandler.java | 26 +-
.../profile/user/cpi/UserProfileService.java | 1500 +--------------
.../repositories/UserProfileRepository.java | 16 -
.../service/handler/RegistryServerHandler.java | 8 +-
.../utils/ThriftDataModelConversion.java | 2 +-
.../org/apache/airavata/MigrationManager.java | 3 +-
.../airavata-apis/airavata_api.thrift | 8 +-
.../user_profile_model.thrift | 31 +-
.../profile-user/profile-user-cpi.thrift | 8 +-
16 files changed, 306 insertions(+), 3324 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index e69f773..14fc841 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -4871,22 +4871,6 @@ public class AiravataServerHandler implements Airavata.Iface {
@Override
@SecurityCheck
- public UserProfile getUserProfileByName(AuthzToken authzToken, String userName, String gatewayId)
- throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-
- try {
- return getUserProfileServiceClient().getUserProfileByName(authzToken, userName, gatewayId);
- } catch (Exception e) {
- String msg = MessageFormat.format("Error getting user profile for [{0}] in [{1}]", userName, gatewayId);
- logger.error(msg, e);
- AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage(msg + " More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- @SecurityCheck
public boolean doesUserProfileExist(AuthzToken authzToken, String userName, String gatewayId)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index 14e75c4..cc00868 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -3031,9 +3031,7 @@ public class Airavata {
public List<org.apache.airavata.model.user.UserProfile> getAllUserProfilesInGateway(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, int offset, int limit) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
- public org.apache.airavata.model.user.UserProfile getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
-
- public boolean doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+ public boolean doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
}
@@ -3387,9 +3385,7 @@ public class Airavata {
public void getAllUserProfilesInGateway(org.apache.airavata.model.security.AuthzToken authzToken, String gatewayId, int offset, int limit, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
- public void getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
@@ -9811,54 +9807,17 @@ public class Airavata {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllUserProfilesInGateway failed: unknown result");
}
- public org.apache.airavata.model.user.UserProfile getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
- {
- send_getUserProfileByName(authzToken, userName, gatewayId);
- return recv_getUserProfileByName();
- }
-
- public void send_getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.thrift.TException
+ public boolean doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
{
- getUserProfileByName_args args = new getUserProfileByName_args();
- args.setAuthzToken(authzToken);
- args.setUserName(userName);
- args.setGatewayId(gatewayId);
- sendBase("getUserProfileByName", args);
- }
-
- public org.apache.airavata.model.user.UserProfile recv_getUserProfileByName() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
- {
- getUserProfileByName_result result = new getUserProfileByName_result();
- receiveBase(result, "getUserProfileByName");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ire != null) {
- throw result.ire;
- }
- if (result.ace != null) {
- throw result.ace;
- }
- if (result.ase != null) {
- throw result.ase;
- }
- if (result.ae != null) {
- throw result.ae;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserProfileByName failed: unknown result");
- }
-
- public boolean doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
- {
- send_doesUserProfileExist(authzToken, userName, gatewayId);
+ send_doesUserProfileExist(authzToken, userId, gatewayId);
return recv_doesUserProfileExist();
}
- public void send_doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId) throws org.apache.thrift.TException
+ public void send_doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId) throws org.apache.thrift.TException
{
doesUserProfileExist_args args = new doesUserProfileExist_args();
args.setAuthzToken(authzToken);
- args.setUserName(userName);
+ args.setUserId(userId);
args.setGatewayId(gatewayId);
sendBase("doesUserProfileExist", args);
}
@@ -16422,59 +16381,21 @@ public class Airavata {
}
}
- public void getUserProfileByName(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ public void doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
- getUserProfileByName_call method_call = new getUserProfileByName_call(authzToken, userName, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getUserProfileByName_call extends org.apache.thrift.async.TAsyncMethodCall {
- private org.apache.airavata.model.security.AuthzToken authzToken;
- private String userName;
- private String gatewayId;
- public getUserProfileByName_call(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.authzToken = authzToken;
- this.userName = userName;
- this.gatewayId = gatewayId;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserProfileByName", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getUserProfileByName_args args = new getUserProfileByName_args();
- args.setAuthzToken(authzToken);
- args.setUserName(userName);
- args.setGatewayId(gatewayId);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public org.apache.airavata.model.user.UserProfile getResult() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getUserProfileByName();
- }
- }
-
- public void doesUserProfileExist(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- doesUserProfileExist_call method_call = new doesUserProfileExist_call(authzToken, userName, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ doesUserProfileExist_call method_call = new doesUserProfileExist_call(authzToken, userId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class doesUserProfileExist_call extends org.apache.thrift.async.TAsyncMethodCall {
private org.apache.airavata.model.security.AuthzToken authzToken;
- private String userName;
+ private String userId;
private String gatewayId;
- public doesUserProfileExist_call(org.apache.airavata.model.security.AuthzToken authzToken, String userName, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ public doesUserProfileExist_call(org.apache.airavata.model.security.AuthzToken authzToken, String userId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.authzToken = authzToken;
- this.userName = userName;
+ this.userId = userId;
this.gatewayId = gatewayId;
}
@@ -16482,7 +16403,7 @@ public class Airavata {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("doesUserProfileExist", org.apache.thrift.protocol.TMessageType.CALL, 0));
doesUserProfileExist_args args = new doesUserProfileExist_args();
args.setAuthzToken(authzToken);
- args.setUserName(userName);
+ args.setUserId(userId);
args.setGatewayId(gatewayId);
args.write(prot);
prot.writeMessageEnd();
@@ -16685,7 +16606,6 @@ public class Airavata {
processMap.put("getUserProfileById", new getUserProfileById());
processMap.put("deleteUserProfile", new deleteUserProfile());
processMap.put("getAllUserProfilesInGateway", new getAllUserProfilesInGateway());
- processMap.put("getUserProfileByName", new getUserProfileByName());
processMap.put("doesUserProfileExist", new doesUserProfileExist());
return processMap;
}
@@ -21982,36 +21902,6 @@ public class Airavata {
}
}
- public static class getUserProfileByName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserProfileByName_args> {
- public getUserProfileByName() {
- super("getUserProfileByName");
- }
-
- public getUserProfileByName_args getEmptyArgsInstance() {
- return new getUserProfileByName_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getUserProfileByName_result getResult(I iface, getUserProfileByName_args args) throws org.apache.thrift.TException {
- getUserProfileByName_result result = new getUserProfileByName_result();
- try {
- result.success = iface.getUserProfileByName(args.authzToken, args.userName, args.gatewayId);
- } catch (org.apache.airavata.model.error.InvalidRequestException ire) {
- result.ire = ire;
- } catch (org.apache.airavata.model.error.AiravataClientException ace) {
- result.ace = ace;
- } catch (org.apache.airavata.model.error.AiravataSystemException ase) {
- result.ase = ase;
- } catch (org.apache.airavata.model.error.AuthorizationException ae) {
- result.ae = ae;
- }
- return result;
- }
- }
-
public static class doesUserProfileExist<I extends Iface> extends org.apache.thrift.ProcessFunction<I, doesUserProfileExist_args> {
public doesUserProfileExist() {
super("doesUserProfileExist");
@@ -22028,7 +21918,7 @@ public class Airavata {
public doesUserProfileExist_result getResult(I iface, doesUserProfileExist_args args) throws org.apache.thrift.TException {
doesUserProfileExist_result result = new doesUserProfileExist_result();
try {
- result.success = iface.doesUserProfileExist(args.authzToken, args.userName, args.gatewayId);
+ result.success = iface.doesUserProfileExist(args.authzToken, args.userId, args.gatewayId);
result.setSuccessIsSet(true);
} catch (org.apache.airavata.model.error.InvalidRequestException ire) {
result.ire = ire;
@@ -22230,7 +22120,6 @@ public class Airavata {
processMap.put("getUserProfileById", new getUserProfileById());
processMap.put("deleteUserProfile", new deleteUserProfile());
processMap.put("getAllUserProfilesInGateway", new getAllUserProfilesInGateway());
- processMap.put("getUserProfileByName", new getUserProfileByName());
processMap.put("doesUserProfileExist", new doesUserProfileExist());
return processMap;
}
@@ -34842,78 +34731,6 @@ public class Airavata {
}
}
- public static class getUserProfileByName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserProfileByName_args, org.apache.airavata.model.user.UserProfile> {
- public getUserProfileByName() {
- super("getUserProfileByName");
- }
-
- public getUserProfileByName_args getEmptyArgsInstance() {
- return new getUserProfileByName_args();
- }
-
- public AsyncMethodCallback<org.apache.airavata.model.user.UserProfile> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<org.apache.airavata.model.user.UserProfile>() {
- public void onComplete(org.apache.airavata.model.user.UserProfile o) {
- getUserProfileByName_result result = new getUserProfileByName_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- getUserProfileByName_result result = new getUserProfileByName_result();
- if (e instanceof org.apache.airavata.model.error.InvalidRequestException) {
- result.ire = (org.apache.airavata.model.error.InvalidRequestException) e;
- result.setIreIsSet(true);
- msg = result;
- }
- else if (e instanceof org.apache.airavata.model.error.AiravataClientException) {
- result.ace = (org.apache.airavata.model.error.AiravataClientException) e;
- result.setAceIsSet(true);
- msg = result;
- }
- else if (e instanceof org.apache.airavata.model.error.AiravataSystemException) {
- result.ase = (org.apache.airavata.model.error.AiravataSystemException) e;
- result.setAseIsSet(true);
- msg = result;
- }
- else if (e instanceof org.apache.airavata.model.error.AuthorizationException) {
- result.ae = (org.apache.airavata.model.error.AuthorizationException) e;
- result.setAeIsSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, getUserProfileByName_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.user.UserProfile> resultHandler) throws TException {
- iface.getUserProfileByName(args.authzToken, args.userName, args.gatewayId,resultHandler);
- }
- }
-
public static class doesUserProfileExist<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, doesUserProfileExist_args, Boolean> {
public doesUserProfileExist() {
super("doesUserProfileExist");
@@ -34983,7 +34800,7 @@ public class Airavata {
}
public void start(I iface, doesUserProfileExist_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.doesUserProfileExist(args.authzToken, args.userName, args.gatewayId,resultHandler);
+ iface.doesUserProfileExist(args.authzToken, args.userId, args.gatewayId,resultHandler);
}
}
@@ -269549,27 +269366,27 @@ public class Airavata {
}
- public static class getUserProfileByName_args implements org.apache.thrift.TBase<getUserProfileByName_args, getUserProfileByName_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserProfileByName_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserProfileByName_args");
+ public static class doesUserProfileExist_args implements org.apache.thrift.TBase<doesUserProfileExist_args, doesUserProfileExist_args._Fields>, java.io.Serializable, Cloneable, Comparable<doesUserProfileExist_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doesUserProfileExist_args");
private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)2);
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)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
- schemes.put(StandardScheme.class, new getUserProfileByName_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getUserProfileByName_argsTupleSchemeFactory());
+ schemes.put(StandardScheme.class, new doesUserProfileExist_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new doesUserProfileExist_argsTupleSchemeFactory());
}
public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public String userName; // required
+ public String userId; // required
public String gatewayId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
AUTHZ_TOKEN((short)1, "authzToken"),
- USER_NAME((short)2, "userName"),
+ USER_ID((short)2, "userId"),
GATEWAY_ID((short)3, "gatewayId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -269587,8 +269404,8 @@ public class Airavata {
switch(fieldId) {
case 1: // AUTHZ_TOKEN
return AUTHZ_TOKEN;
- case 2: // USER_NAME
- return USER_NAME;
+ case 2: // USER_ID
+ return USER_ID;
case 3: // GATEWAY_ID
return GATEWAY_ID;
default:
@@ -269636,51 +269453,51 @@ public class Airavata {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
- tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.REQUIRED,
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserProfileByName_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doesUserProfileExist_args.class, metaDataMap);
}
- public getUserProfileByName_args() {
+ public doesUserProfileExist_args() {
}
- public getUserProfileByName_args(
+ public doesUserProfileExist_args(
org.apache.airavata.model.security.AuthzToken authzToken,
- String userName,
+ String userId,
String gatewayId)
{
this();
this.authzToken = authzToken;
- this.userName = userName;
+ this.userId = userId;
this.gatewayId = gatewayId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public getUserProfileByName_args(getUserProfileByName_args other) {
+ public doesUserProfileExist_args(doesUserProfileExist_args other) {
if (other.isSetAuthzToken()) {
this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
}
- if (other.isSetUserName()) {
- this.userName = other.userName;
+ if (other.isSetUserId()) {
+ this.userId = other.userId;
}
if (other.isSetGatewayId()) {
this.gatewayId = other.gatewayId;
}
}
- public getUserProfileByName_args deepCopy() {
- return new getUserProfileByName_args(this);
+ public doesUserProfileExist_args deepCopy() {
+ return new doesUserProfileExist_args(this);
}
@Override
public void clear() {
this.authzToken = null;
- this.userName = null;
+ this.userId = null;
this.gatewayId = null;
}
@@ -269688,7 +269505,7 @@ public class Airavata {
return this.authzToken;
}
- public getUserProfileByName_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
+ public doesUserProfileExist_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
this.authzToken = authzToken;
return this;
}
@@ -269708,27 +269525,27 @@ public class Airavata {
}
}
- public String getUserName() {
- return this.userName;
+ public String getUserId() {
+ return this.userId;
}
- public getUserProfileByName_args setUserName(String userName) {
- this.userName = userName;
+ public doesUserProfileExist_args setUserId(String userId) {
+ this.userId = userId;
return this;
}
- public void unsetUserName() {
- this.userName = null;
+ public void unsetUserId() {
+ this.userId = null;
}
- /** Returns true if field userName is set (has been assigned a value) and false otherwise */
- public boolean isSetUserName() {
- return this.userName != null;
+ /** Returns true if field userId is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserId() {
+ return this.userId != null;
}
- public void setUserNameIsSet(boolean value) {
+ public void setUserIdIsSet(boolean value) {
if (!value) {
- this.userName = null;
+ this.userId = null;
}
}
@@ -269736,7 +269553,7 @@ public class Airavata {
return this.gatewayId;
}
- public getUserProfileByName_args setGatewayId(String gatewayId) {
+ public doesUserProfileExist_args setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
return this;
}
@@ -269766,11 +269583,11 @@ public class Airavata {
}
break;
- case USER_NAME:
+ case USER_ID:
if (value == null) {
- unsetUserName();
+ unsetUserId();
} else {
- setUserName((String)value);
+ setUserId((String)value);
}
break;
@@ -269790,8 +269607,8 @@ public class Airavata {
case AUTHZ_TOKEN:
return getAuthzToken();
- case USER_NAME:
- return getUserName();
+ case USER_ID:
+ return getUserId();
case GATEWAY_ID:
return getGatewayId();
@@ -269809,8 +269626,8 @@ public class Airavata {
switch (field) {
case AUTHZ_TOKEN:
return isSetAuthzToken();
- case USER_NAME:
- return isSetUserName();
+ case USER_ID:
+ return isSetUserId();
case GATEWAY_ID:
return isSetGatewayId();
}
@@ -269821,12 +269638,12 @@ public class Airavata {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof getUserProfileByName_args)
- return this.equals((getUserProfileByName_args)that);
+ if (that instanceof doesUserProfileExist_args)
+ return this.equals((doesUserProfileExist_args)that);
return false;
}
- public boolean equals(getUserProfileByName_args that) {
+ public boolean equals(doesUserProfileExist_args that) {
if (that == null)
return false;
@@ -269839,12 +269656,12 @@ public class Airavata {
return false;
}
- boolean this_present_userName = true && this.isSetUserName();
- boolean that_present_userName = true && that.isSetUserName();
- if (this_present_userName || that_present_userName) {
- if (!(this_present_userName && that_present_userName))
+ boolean this_present_userId = true && this.isSetUserId();
+ boolean that_present_userId = true && that.isSetUserId();
+ if (this_present_userId || that_present_userId) {
+ if (!(this_present_userId && that_present_userId))
return false;
- if (!this.userName.equals(that.userName))
+ if (!this.userId.equals(that.userId))
return false;
}
@@ -269869,10 +269686,10 @@ public class Airavata {
if (present_authzToken)
list.add(authzToken);
- boolean present_userName = true && (isSetUserName());
- list.add(present_userName);
- if (present_userName)
- list.add(userName);
+ boolean present_userId = true && (isSetUserId());
+ list.add(present_userId);
+ if (present_userId)
+ list.add(userId);
boolean present_gatewayId = true && (isSetGatewayId());
list.add(present_gatewayId);
@@ -269883,7 +269700,7 @@ public class Airavata {
}
@Override
- public int compareTo(getUserProfileByName_args other) {
+ public int compareTo(doesUserProfileExist_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
@@ -269900,12 +269717,12 @@ public class Airavata {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
+ lastComparison = Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetUserName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
+ if (isSetUserId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId);
if (lastComparison != 0) {
return lastComparison;
}
@@ -269937,7 +269754,7 @@ public class Airavata {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("getUserProfileByName_args(");
+ StringBuilder sb = new StringBuilder("doesUserProfileExist_args(");
boolean first = true;
sb.append("authzToken:");
@@ -269948,11 +269765,11 @@ public class Airavata {
}
first = false;
if (!first) sb.append(", ");
- sb.append("userName:");
- if (this.userName == null) {
+ sb.append("userId:");
+ if (this.userId == null) {
sb.append("null");
} else {
- sb.append(this.userName);
+ sb.append(this.userId);
}
first = false;
if (!first) sb.append(", ");
@@ -269972,1363 +269789,8 @@ public class Airavata {
if (authzToken == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
}
- if (userName == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
- }
- if (gatewayId == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
- }
- // check for sub-struct validity
- if (authzToken != null) {
- authzToken.validate();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getUserProfileByName_argsStandardSchemeFactory implements SchemeFactory {
- public getUserProfileByName_argsStandardScheme getScheme() {
- return new getUserProfileByName_argsStandardScheme();
- }
- }
-
- private static class getUserProfileByName_argsStandardScheme extends StandardScheme<getUserProfileByName_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // AUTHZ_TOKEN
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
- struct.authzToken.read(iprot);
- struct.setAuthzTokenIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // USER_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // GATEWAY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.gatewayId = iprot.readString();
- struct.setGatewayIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.authzToken != null) {
- oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
- struct.authzToken.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.userName != null) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
- oprot.writeFieldEnd();
- }
- if (struct.gatewayId != null) {
- oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
- oprot.writeString(struct.gatewayId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getUserProfileByName_argsTupleSchemeFactory implements SchemeFactory {
- public getUserProfileByName_argsTupleScheme getScheme() {
- return new getUserProfileByName_argsTupleScheme();
- }
- }
-
- private static class getUserProfileByName_argsTupleScheme extends TupleScheme<getUserProfileByName_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.authzToken.write(oprot);
- oprot.writeString(struct.userName);
- oprot.writeString(struct.gatewayId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
- struct.authzToken.read(iprot);
- struct.setAuthzTokenIsSet(true);
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- struct.gatewayId = iprot.readString();
- struct.setGatewayIdIsSet(true);
- }
- }
-
- }
-
- public static class getUserProfileByName_result implements org.apache.thrift.TBase<getUserProfileByName_result, getUserProfileByName_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserProfileByName_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserProfileByName_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
- private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField ACE_FIELD_DESC = new org.apache.thrift.protocol.TField("ace", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField ASE_FIELD_DESC = new org.apache.thrift.protocol.TField("ase", org.apache.thrift.protocol.TType.STRUCT, (short)3);
- private static final org.apache.thrift.protocol.TField AE_FIELD_DESC = new org.apache.thrift.protocol.TField("ae", org.apache.thrift.protocol.TType.STRUCT, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getUserProfileByName_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getUserProfileByName_resultTupleSchemeFactory());
- }
-
- public org.apache.airavata.model.user.UserProfile success; // required
- public org.apache.airavata.model.error.InvalidRequestException ire; // required
- public org.apache.airavata.model.error.AiravataClientException ace; // required
- public org.apache.airavata.model.error.AiravataSystemException ase; // required
- public org.apache.airavata.model.error.AuthorizationException ae; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success"),
- IRE((short)1, "ire"),
- ACE((short)2, "ace"),
- ASE((short)3, "ase"),
- AE((short)4, "ae");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- case 1: // IRE
- return IRE;
- case 2: // ACE
- return ACE;
- case 3: // ASE
- return ASE;
- case 4: // AE
- return AE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.user.UserProfile.class)));
- tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- tmpMap.put(_Fields.ACE, new org.apache.thrift.meta_data.FieldMetaData("ace", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- tmpMap.put(_Fields.ASE, new org.apache.thrift.meta_data.FieldMetaData("ase", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserProfileByName_result.class, metaDataMap);
- }
-
- public getUserProfileByName_result() {
- }
-
- public getUserProfileByName_result(
- org.apache.airavata.model.user.UserProfile success,
- org.apache.airavata.model.error.InvalidRequestException ire,
- org.apache.airavata.model.error.AiravataClientException ace,
- org.apache.airavata.model.error.AiravataSystemException ase,
- org.apache.airavata.model.error.AuthorizationException ae)
- {
- this();
- this.success = success;
- this.ire = ire;
- this.ace = ace;
- this.ase = ase;
- this.ae = ae;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getUserProfileByName_result(getUserProfileByName_result other) {
- if (other.isSetSuccess()) {
- this.success = new org.apache.airavata.model.user.UserProfile(other.success);
- }
- if (other.isSetIre()) {
- this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
- }
- if (other.isSetAce()) {
- this.ace = new org.apache.airavata.model.error.AiravataClientException(other.ace);
- }
- if (other.isSetAse()) {
- this.ase = new org.apache.airavata.model.error.AiravataSystemException(other.ase);
- }
- if (other.isSetAe()) {
- this.ae = new org.apache.airavata.model.error.AuthorizationException(other.ae);
- }
- }
-
- public getUserProfileByName_result deepCopy() {
- return new getUserProfileByName_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- this.ire = null;
- this.ace = null;
- this.ase = null;
- this.ae = null;
- }
-
- public org.apache.airavata.model.user.UserProfile getSuccess() {
- return this.success;
- }
-
- public getUserProfileByName_result setSuccess(org.apache.airavata.model.user.UserProfile success) {
- this.success = success;
- return this;
- }
-
- public void unsetSuccess() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return this.success != null;
- }
-
- public void setSuccessIsSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public org.apache.airavata.model.error.InvalidRequestException getIre() {
- return this.ire;
- }
-
- public getUserProfileByName_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
- this.ire = ire;
- return this;
- }
-
- public void unsetIre() {
- this.ire = null;
- }
-
- /** Returns true if field ire is set (has been assigned a value) and false otherwise */
- public boolean isSetIre() {
- return this.ire != null;
- }
-
- public void setIreIsSet(boolean value) {
- if (!value) {
- this.ire = null;
- }
- }
-
- public org.apache.airavata.model.error.AiravataClientException getAce() {
- return this.ace;
- }
-
- public getUserProfileByName_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
- this.ace = ace;
- return this;
- }
-
- public void unsetAce() {
- this.ace = null;
- }
-
- /** Returns true if field ace is set (has been assigned a value) and false otherwise */
- public boolean isSetAce() {
- return this.ace != null;
- }
-
- public void setAceIsSet(boolean value) {
- if (!value) {
- this.ace = null;
- }
- }
-
- public org.apache.airavata.model.error.AiravataSystemException getAse() {
- return this.ase;
- }
-
- public getUserProfileByName_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
- this.ase = ase;
- return this;
- }
-
- public void unsetAse() {
- this.ase = null;
- }
-
- /** Returns true if field ase is set (has been assigned a value) and false otherwise */
- public boolean isSetAse() {
- return this.ase != null;
- }
-
- public void setAseIsSet(boolean value) {
- if (!value) {
- this.ase = null;
- }
- }
-
- public org.apache.airavata.model.error.AuthorizationException getAe() {
- return this.ae;
- }
-
- public getUserProfileByName_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
- this.ae = ae;
- return this;
- }
-
- public void unsetAe() {
- this.ae = null;
- }
-
- /** Returns true if field ae is set (has been assigned a value) and false otherwise */
- public boolean isSetAe() {
- return this.ae != null;
- }
-
- public void setAeIsSet(boolean value) {
- if (!value) {
- this.ae = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((org.apache.airavata.model.user.UserProfile)value);
- }
- break;
-
- case IRE:
- if (value == null) {
- unsetIre();
- } else {
- setIre((org.apache.airavata.model.error.InvalidRequestException)value);
- }
- break;
-
- case ACE:
- if (value == null) {
- unsetAce();
- } else {
- setAce((org.apache.airavata.model.error.AiravataClientException)value);
- }
- break;
-
- case ASE:
- if (value == null) {
- unsetAse();
- } else {
- setAse((org.apache.airavata.model.error.AiravataSystemException)value);
- }
- break;
-
- case AE:
- if (value == null) {
- unsetAe();
- } else {
- setAe((org.apache.airavata.model.error.AuthorizationException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return getSuccess();
-
- case IRE:
- return getIre();
-
- case ACE:
- return getAce();
-
- case ASE:
- return getAse();
-
- case AE:
- return getAe();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- case IRE:
- return isSetIre();
- case ACE:
- return isSetAce();
- case ASE:
- return isSetAse();
- case AE:
- return isSetAe();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getUserProfileByName_result)
- return this.equals((getUserProfileByName_result)that);
- return false;
- }
-
- public boolean equals(getUserProfileByName_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.isSetSuccess();
- boolean that_present_success = true && that.isSetSuccess();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- boolean this_present_ire = true && this.isSetIre();
- boolean that_present_ire = true && that.isSetIre();
- if (this_present_ire || that_present_ire) {
- if (!(this_present_ire && that_present_ire))
- return false;
- if (!this.ire.equals(that.ire))
- return false;
- }
-
- boolean this_present_ace = true && this.isSetAce();
- boolean that_present_ace = true && that.isSetAce();
- if (this_present_ace || that_present_ace) {
- if (!(this_present_ace && that_present_ace))
- return false;
- if (!this.ace.equals(that.ace))
- return false;
- }
-
- boolean this_present_ase = true && this.isSetAse();
- boolean that_present_ase = true && that.isSetAse();
- if (this_present_ase || that_present_ase) {
- if (!(this_present_ase && that_present_ase))
- return false;
- if (!this.ase.equals(that.ase))
- return false;
- }
-
- boolean this_present_ae = true && this.isSetAe();
- boolean that_present_ae = true && that.isSetAe();
- if (this_present_ae || that_present_ae) {
- if (!(this_present_ae && that_present_ae))
- return false;
- if (!this.ae.equals(that.ae))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_success = true && (isSetSuccess());
- list.add(present_success);
- if (present_success)
- list.add(success);
-
- boolean present_ire = true && (isSetIre());
- list.add(present_ire);
- if (present_ire)
- list.add(ire);
-
- boolean present_ace = true && (isSetAce());
- list.add(present_ace);
- if (present_ace)
- list.add(ace);
-
- boolean present_ase = true && (isSetAse());
- list.add(present_ase);
- if (present_ase)
- list.add(ase);
-
- boolean present_ae = true && (isSetAe());
- list.add(present_ae);
- if (present_ae)
- list.add(ae);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(getUserProfileByName_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetIre()).compareTo(other.isSetIre());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetIre()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, other.ire);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAce()).compareTo(other.isSetAce());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAce()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ace, other.ace);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAse()).compareTo(other.isSetAse());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAse()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ase, other.ase);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAe()).compareTo(other.isSetAe());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAe()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ae, other.ae);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getUserProfileByName_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("ire:");
- if (this.ire == null) {
- sb.append("null");
- } else {
- sb.append(this.ire);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("ace:");
- if (this.ace == null) {
- sb.append("null");
- } else {
- sb.append(this.ace);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("ase:");
- if (this.ase == null) {
- sb.append("null");
- } else {
- sb.append(this.ase);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("ae:");
- if (this.ae == null) {
- sb.append("null");
- } else {
- sb.append(this.ae);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (success != null) {
- success.validate();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getUserProfileByName_resultStandardSchemeFactory implements SchemeFactory {
- public getUserProfileByName_resultStandardScheme getScheme() {
- return new getUserProfileByName_resultStandardScheme();
- }
- }
-
- private static class getUserProfileByName_resultStandardScheme extends StandardScheme<getUserProfileByName_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.success = new org.apache.airavata.model.user.UserProfile();
- struct.success.read(iprot);
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 1: // IRE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
- struct.ire.read(iprot);
- struct.setIreIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ACE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.ace = new org.apache.airavata.model.error.AiravataClientException();
- struct.ace.read(iprot);
- struct.setAceIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // ASE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
- struct.ase.read(iprot);
- struct.setAseIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // AE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.ae = new org.apache.airavata.model.error.AuthorizationException();
- struct.ae.read(iprot);
- struct.setAeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- struct.success.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.ire != null) {
- oprot.writeFieldBegin(IRE_FIELD_DESC);
- struct.ire.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.ace != null) {
- oprot.writeFieldBegin(ACE_FIELD_DESC);
- struct.ace.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.ase != null) {
- oprot.writeFieldBegin(ASE_FIELD_DESC);
- struct.ase.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.ae != null) {
- oprot.writeFieldBegin(AE_FIELD_DESC);
- struct.ae.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getUserProfileByName_resultTupleSchemeFactory implements SchemeFactory {
- public getUserProfileByName_resultTupleScheme getScheme() {
- return new getUserProfileByName_resultTupleScheme();
- }
- }
-
- private static class getUserProfileByName_resultTupleScheme extends TupleScheme<getUserProfileByName_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
- if (struct.isSetIre()) {
- optionals.set(1);
- }
- if (struct.isSetAce()) {
- optionals.set(2);
- }
- if (struct.isSetAse()) {
- optionals.set(3);
- }
- if (struct.isSetAe()) {
- optionals.set(4);
- }
- oprot.writeBitSet(optionals, 5);
- if (struct.isSetSuccess()) {
- struct.success.write(oprot);
- }
- if (struct.isSetIre()) {
- struct.ire.write(oprot);
- }
- if (struct.isSetAce()) {
- struct.ace.write(oprot);
- }
- if (struct.isSetAse()) {
- struct.ase.write(oprot);
- }
- if (struct.isSetAe()) {
- struct.ae.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getUserProfileByName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(5);
- if (incoming.get(0)) {
- struct.success = new org.apache.airavata.model.user.UserProfile();
- struct.success.read(iprot);
- struct.setSuccessIsSet(true);
- }
- if (incoming.get(1)) {
- struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
- struct.ire.read(iprot);
- struct.setIreIsSet(true);
- }
- if (incoming.get(2)) {
- struct.ace = new org.apache.airavata.model.error.AiravataClientException();
- struct.ace.read(iprot);
- struct.setAceIsSet(true);
- }
- if (incoming.get(3)) {
- struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
- struct.ase.read(iprot);
- struct.setAseIsSet(true);
- }
- if (incoming.get(4)) {
- struct.ae = new org.apache.airavata.model.error.AuthorizationException();
- struct.ae.read(iprot);
- struct.setAeIsSet(true);
- }
- }
- }
-
- }
-
- public static class doesUserProfileExist_args implements org.apache.thrift.TBase<doesUserProfileExist_args, doesUserProfileExist_args._Fields>, java.io.Serializable, Cloneable, Comparable<doesUserProfileExist_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doesUserProfileExist_args");
-
- private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)2);
- 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)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new doesUserProfileExist_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new doesUserProfileExist_argsTupleSchemeFactory());
- }
-
- public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public String userName; // required
- public String gatewayId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- AUTHZ_TOKEN((short)1, "authzToken"),
- USER_NAME((short)2, "userName"),
- GATEWAY_ID((short)3, "gatewayId");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // AUTHZ_TOKEN
- return AUTHZ_TOKEN;
- case 2: // USER_NAME
- return USER_NAME;
- case 3: // GATEWAY_ID
- return GATEWAY_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
- tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doesUserProfileExist_args.class, metaDataMap);
- }
-
- public doesUserProfileExist_args() {
- }
-
- public doesUserProfileExist_args(
- org.apache.airavata.model.security.AuthzToken authzToken,
- String userName,
- String gatewayId)
- {
- this();
- this.authzToken = authzToken;
- this.userName = userName;
- this.gatewayId = gatewayId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public doesUserProfileExist_args(doesUserProfileExist_args other) {
- if (other.isSetAuthzToken()) {
- this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
- }
- if (other.isSetUserName()) {
- this.userName = other.userName;
- }
- if (other.isSetGatewayId()) {
- this.gatewayId = other.gatewayId;
- }
- }
-
- public doesUserProfileExist_args deepCopy() {
- return new doesUserProfileExist_args(this);
- }
-
- @Override
- public void clear() {
- this.authzToken = null;
- this.userName = null;
- this.gatewayId = null;
- }
-
- public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
- return this.authzToken;
- }
-
- public doesUserProfileExist_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
- this.authzToken = authzToken;
- return this;
- }
-
- public void unsetAuthzToken() {
- this.authzToken = null;
- }
-
- /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
- public boolean isSetAuthzToken() {
- return this.authzToken != null;
- }
-
- public void setAuthzTokenIsSet(boolean value) {
- if (!value) {
- this.authzToken = null;
- }
- }
-
- public String getUserName() {
- return this.userName;
- }
-
- public doesUserProfileExist_args setUserName(String userName) {
- this.userName = userName;
- return this;
- }
-
- public void unsetUserName() {
- this.userName = null;
- }
-
- /** Returns true if field userName is set (has been assigned a value) and false otherwise */
- public boolean isSetUserName() {
- return this.userName != null;
- }
-
- public void setUserNameIsSet(boolean value) {
- if (!value) {
- this.userName = null;
- }
- }
-
- public String getGatewayId() {
- return this.gatewayId;
- }
-
- public doesUserProfileExist_args setGatewayId(String gatewayId) {
- this.gatewayId = gatewayId;
- return this;
- }
-
- public void unsetGatewayId() {
- this.gatewayId = null;
- }
-
- /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
- public boolean isSetGatewayId() {
- return this.gatewayId != null;
- }
-
- public void setGatewayIdIsSet(boolean value) {
- if (!value) {
- this.gatewayId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case AUTHZ_TOKEN:
- if (value == null) {
- unsetAuthzToken();
- } else {
- setAuthzToken((org.apache.airavata.model.security.AuthzToken)value);
- }
- break;
-
- case USER_NAME:
- if (value == null) {
- unsetUserName();
- } else {
- setUserName((String)value);
- }
- break;
-
- case GATEWAY_ID:
- if (value == null) {
- unsetGatewayId();
- } else {
- setGatewayId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case AUTHZ_TOKEN:
- return getAuthzToken();
-
- case USER_NAME:
- return getUserName();
-
- case GATEWAY_ID:
- return getGatewayId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case AUTHZ_TOKEN:
- return isSetAuthzToken();
- case USER_NAME:
- return isSetUserName();
- case GATEWAY_ID:
- return isSetGatewayId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof doesUserProfileExist_args)
- return this.equals((doesUserProfileExist_args)that);
- return false;
- }
-
- public boolean equals(doesUserProfileExist_args that) {
- if (that == null)
- return false;
-
- boolean this_present_authzToken = true && this.isSetAuthzToken();
- boolean that_present_authzToken = true && that.isSetAuthzToken();
- if (this_present_authzToken || that_present_authzToken) {
- if (!(this_present_authzToken && that_present_authzToken))
- return false;
- if (!this.authzToken.equals(that.authzToken))
- return false;
- }
-
- boolean this_present_userName = true && this.isSetUserName();
- boolean that_present_userName = true && that.isSetUserName();
- if (this_present_userName || that_present_userName) {
- if (!(this_present_userName && that_present_userName))
- return false;
- if (!this.userName.equals(that.userName))
- return false;
- }
-
- boolean this_present_gatewayId = true && this.isSetGatewayId();
- boolean that_present_gatewayId = true && that.isSetGatewayId();
- if (this_present_gatewayId || that_present_gatewayId) {
- if (!(this_present_gatewayId && that_present_gatewayId))
- return false;
- if (!this.gatewayId.equals(that.gatewayId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_authzToken = true && (isSetAuthzToken());
- list.add(present_authzToken);
- if (present_authzToken)
- list.add(authzToken);
-
- boolean present_userName = true && (isSetUserName());
- list.add(present_userName);
- if (present_userName)
- list.add(userName);
-
- boolean present_gatewayId = true && (isSetGatewayId());
- list.add(present_gatewayId);
- if (present_gatewayId)
- list.add(gatewayId);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(doesUserProfileExist_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAuthzToken()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUserName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetGatewayId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("doesUserProfileExist_args(");
- boolean first = true;
-
- sb.append("authzToken:");
- if (this.authzToken == null) {
- sb.append("null");
- } else {
- sb.append(this.authzToken);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("userName:");
- if (this.userName == null) {
- sb.append("null");
- } else {
- sb.append(this.userName);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("gatewayId:");
- if (this.gatewayId == null) {
- sb.append("null");
- } else {
- sb.append(this.gatewayId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (authzToken == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
- }
- if (userName == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'userName' was not present! Struct: " + toString());
+ if (userId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'userId' was not present! Struct: " + toString());
}
if (gatewayId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
@@ -271382,10 +269844,10 @@ public class Airavata {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 2: // USER_NAME
+ case 2: // USER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
+ struct.userId = iprot.readString();
+ struct.setUserIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -271418,9 +269880,9 @@ public class Airavata {
struct.authzToken.write(oprot);
oprot.writeFieldEnd();
}
- if (struct.userName != null) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
+ if (struct.userId != null) {
+ oprot.writeFieldBegin(USER_ID_FIELD_DESC);
+ oprot.writeString(struct.userId);
oprot.writeFieldEnd();
}
if (struct.gatewayId != null) {
@@ -271446,7 +269908,7 @@ public class Airavata {
public void write(org.apache.thrift.protocol.TProtocol prot, doesUserProfileExist_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.authzToken.write(oprot);
- oprot.writeString(struct.userName);
+ oprot.writeString(struct.userId);
oprot.writeString(struct.gatewayId);
}
@@ -271456,8 +269918,8 @@ public class Airavata {
struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
struct.authzToken.read(iprot);
struct.setAuthzTokenIsSet(true);
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
+ struct.userId = iprot.readString();
+ struct.setUserIdIsSet(true);
struct.gatewayId = iprot.readString();
struct.setGatewayIdIsSet(true);
}
[2/3] airavata git commit: Remove references to userName and instead
use userId
Posted by go...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java
index 7c6fd74..60c1e55 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java
@@ -123,22 +123,21 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
private static final org.apache.thrift.protocol.TField MIDDLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("middleName", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final org.apache.thrift.protocol.TField NAME_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("namePrefix", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.protocol.TField NAME_SUFFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("nameSuffix", org.apache.thrift.protocol.TType.STRING, (short)10);
- private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)11);
- private static final org.apache.thrift.protocol.TField ORCID_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orcidId", org.apache.thrift.protocol.TType.STRING, (short)12);
- private static final org.apache.thrift.protocol.TField PHONES_FIELD_DESC = new org.apache.thrift.protocol.TField("phones", org.apache.thrift.protocol.TType.LIST, (short)13);
- private static final org.apache.thrift.protocol.TField COUNTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("country", org.apache.thrift.protocol.TType.STRING, (short)14);
- private static final org.apache.thrift.protocol.TField NATIONALITY_FIELD_DESC = new org.apache.thrift.protocol.TField("nationality", org.apache.thrift.protocol.TType.LIST, (short)15);
- private static final org.apache.thrift.protocol.TField HOME_ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("homeOrganization", org.apache.thrift.protocol.TType.STRING, (short)16);
- private static final org.apache.thrift.protocol.TField ORGINATION_AFFILIATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orginationAffiliation", org.apache.thrift.protocol.TType.STRING, (short)17);
- private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)18);
- private static final org.apache.thrift.protocol.TField LAST_ACCESS_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastAccessTime", org.apache.thrift.protocol.TType.I64, (short)19);
- private static final org.apache.thrift.protocol.TField VALID_UNTIL_FIELD_DESC = new org.apache.thrift.protocol.TField("validUntil", org.apache.thrift.protocol.TType.I64, (short)20);
- private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("State", org.apache.thrift.protocol.TType.I32, (short)21);
- private static final org.apache.thrift.protocol.TField COMMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("comments", org.apache.thrift.protocol.TType.STRING, (short)22);
- private static final org.apache.thrift.protocol.TField LABELED_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("labeledURI", org.apache.thrift.protocol.TType.LIST, (short)23);
- private static final org.apache.thrift.protocol.TField GPG_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("gpgKey", org.apache.thrift.protocol.TType.STRING, (short)24);
- private static final org.apache.thrift.protocol.TField TIME_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeZone", org.apache.thrift.protocol.TType.STRING, (short)25);
- private static final org.apache.thrift.protocol.TField NSF_DEMOGRAPHICS_FIELD_DESC = new org.apache.thrift.protocol.TField("nsfDemographics", org.apache.thrift.protocol.TType.STRUCT, (short)26);
+ private static final org.apache.thrift.protocol.TField ORCID_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orcidId", org.apache.thrift.protocol.TType.STRING, (short)11);
+ private static final org.apache.thrift.protocol.TField PHONES_FIELD_DESC = new org.apache.thrift.protocol.TField("phones", org.apache.thrift.protocol.TType.LIST, (short)12);
+ private static final org.apache.thrift.protocol.TField COUNTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("country", org.apache.thrift.protocol.TType.STRING, (short)13);
+ private static final org.apache.thrift.protocol.TField NATIONALITY_FIELD_DESC = new org.apache.thrift.protocol.TField("nationality", org.apache.thrift.protocol.TType.LIST, (short)14);
+ private static final org.apache.thrift.protocol.TField HOME_ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("homeOrganization", org.apache.thrift.protocol.TType.STRING, (short)15);
+ private static final org.apache.thrift.protocol.TField ORGINATION_AFFILIATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orginationAffiliation", org.apache.thrift.protocol.TType.STRING, (short)16);
+ private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)17);
+ private static final org.apache.thrift.protocol.TField LAST_ACCESS_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastAccessTime", org.apache.thrift.protocol.TType.I64, (short)18);
+ private static final org.apache.thrift.protocol.TField VALID_UNTIL_FIELD_DESC = new org.apache.thrift.protocol.TField("validUntil", org.apache.thrift.protocol.TType.I64, (short)19);
+ private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("State", org.apache.thrift.protocol.TType.I32, (short)20);
+ private static final org.apache.thrift.protocol.TField COMMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("comments", org.apache.thrift.protocol.TType.STRING, (short)21);
+ private static final org.apache.thrift.protocol.TField LABELED_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("labeledURI", org.apache.thrift.protocol.TType.LIST, (short)22);
+ private static final org.apache.thrift.protocol.TField GPG_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("gpgKey", org.apache.thrift.protocol.TType.STRING, (short)23);
+ private static final org.apache.thrift.protocol.TField TIME_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeZone", org.apache.thrift.protocol.TType.STRING, (short)24);
+ private static final org.apache.thrift.protocol.TField NSF_DEMOGRAPHICS_FIELD_DESC = new org.apache.thrift.protocol.TField("nsfDemographics", org.apache.thrift.protocol.TType.STRUCT, (short)25);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -156,7 +155,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
private String middleName; // optional
private String namePrefix; // optional
private String nameSuffix; // optional
- private String userName; // optional
private String orcidId; // optional
private List<String> phones; // optional
private String country; // optional
@@ -185,26 +183,25 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
MIDDLE_NAME((short)8, "middleName"),
NAME_PREFIX((short)9, "namePrefix"),
NAME_SUFFIX((short)10, "nameSuffix"),
- USER_NAME((short)11, "userName"),
- ORCID_ID((short)12, "orcidId"),
- PHONES((short)13, "phones"),
- COUNTRY((short)14, "country"),
- NATIONALITY((short)15, "nationality"),
- HOME_ORGANIZATION((short)16, "homeOrganization"),
- ORGINATION_AFFILIATION((short)17, "orginationAffiliation"),
- CREATION_TIME((short)18, "creationTime"),
- LAST_ACCESS_TIME((short)19, "lastAccessTime"),
- VALID_UNTIL((short)20, "validUntil"),
+ ORCID_ID((short)11, "orcidId"),
+ PHONES((short)12, "phones"),
+ COUNTRY((short)13, "country"),
+ NATIONALITY((short)14, "nationality"),
+ HOME_ORGANIZATION((short)15, "homeOrganization"),
+ ORGINATION_AFFILIATION((short)16, "orginationAffiliation"),
+ CREATION_TIME((short)17, "creationTime"),
+ LAST_ACCESS_TIME((short)18, "lastAccessTime"),
+ VALID_UNTIL((short)19, "validUntil"),
/**
*
* @see Status
*/
- STATE((short)21, "State"),
- COMMENTS((short)22, "comments"),
- LABELED_URI((short)23, "labeledURI"),
- GPG_KEY((short)24, "gpgKey"),
- TIME_ZONE((short)25, "timeZone"),
- NSF_DEMOGRAPHICS((short)26, "nsfDemographics");
+ STATE((short)20, "State"),
+ COMMENTS((short)21, "comments"),
+ LABELED_URI((short)22, "labeledURI"),
+ GPG_KEY((short)23, "gpgKey"),
+ TIME_ZONE((short)24, "timeZone"),
+ NSF_DEMOGRAPHICS((short)25, "nsfDemographics");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -239,37 +236,35 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
return NAME_PREFIX;
case 10: // NAME_SUFFIX
return NAME_SUFFIX;
- case 11: // USER_NAME
- return USER_NAME;
- case 12: // ORCID_ID
+ case 11: // ORCID_ID
return ORCID_ID;
- case 13: // PHONES
+ case 12: // PHONES
return PHONES;
- case 14: // COUNTRY
+ case 13: // COUNTRY
return COUNTRY;
- case 15: // NATIONALITY
+ case 14: // NATIONALITY
return NATIONALITY;
- case 16: // HOME_ORGANIZATION
+ case 15: // HOME_ORGANIZATION
return HOME_ORGANIZATION;
- case 17: // ORGINATION_AFFILIATION
+ case 16: // ORGINATION_AFFILIATION
return ORGINATION_AFFILIATION;
- case 18: // CREATION_TIME
+ case 17: // CREATION_TIME
return CREATION_TIME;
- case 19: // LAST_ACCESS_TIME
+ case 18: // LAST_ACCESS_TIME
return LAST_ACCESS_TIME;
- case 20: // VALID_UNTIL
+ case 19: // VALID_UNTIL
return VALID_UNTIL;
- case 21: // STATE
+ case 20: // STATE
return STATE;
- case 22: // COMMENTS
+ case 21: // COMMENTS
return COMMENTS;
- case 23: // LABELED_URI
+ case 22: // LABELED_URI
return LABELED_URI;
- case 24: // GPG_KEY
+ case 23: // GPG_KEY
return GPG_KEY;
- case 25: // TIME_ZONE
+ case 24: // TIME_ZONE
return TIME_ZONE;
- case 26: // NSF_DEMOGRAPHICS
+ case 25: // NSF_DEMOGRAPHICS
return NSF_DEMOGRAPHICS;
default:
return null;
@@ -315,7 +310,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
private static final int __LASTACCESSTIME_ISSET_ID = 1;
private static final int __VALIDUNTIL_ISSET_ID = 2;
private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.MIDDLE_NAME,_Fields.NAME_PREFIX,_Fields.NAME_SUFFIX,_Fields.USER_NAME,_Fields.ORCID_ID,_Fields.PHONES,_Fields.COUNTRY,_Fields.NATIONALITY,_Fields.HOME_ORGANIZATION,_Fields.ORGINATION_AFFILIATION,_Fields.COMMENTS,_Fields.LABELED_URI,_Fields.GPG_KEY,_Fields.TIME_ZONE,_Fields.NSF_DEMOGRAPHICS};
+ private static final _Fields optionals[] = {_Fields.MIDDLE_NAME,_Fields.NAME_PREFIX,_Fields.NAME_SUFFIX,_Fields.ORCID_ID,_Fields.PHONES,_Fields.COUNTRY,_Fields.NATIONALITY,_Fields.HOME_ORGANIZATION,_Fields.ORGINATION_AFFILIATION,_Fields.COMMENTS,_Fields.LABELED_URI,_Fields.GPG_KEY,_Fields.TIME_ZONE,_Fields.NSF_DEMOGRAPHICS};
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);
@@ -340,8 +335,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NAME_SUFFIX, new org.apache.thrift.meta_data.FieldMetaData("nameSuffix", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ORCID_ID, new org.apache.thrift.meta_data.FieldMetaData("orcidId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PHONES, new org.apache.thrift.meta_data.FieldMetaData("phones", org.apache.thrift.TFieldRequirementType.OPTIONAL,
@@ -452,9 +445,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
if (other.isSetNameSuffix()) {
this.nameSuffix = other.nameSuffix;
}
- if (other.isSetUserName()) {
- this.userName = other.userName;
- }
if (other.isSetOrcidId()) {
this.orcidId = other.orcidId;
}
@@ -517,7 +507,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
this.middleName = null;
this.namePrefix = null;
this.nameSuffix = null;
- this.userName = null;
this.orcidId = null;
this.phones = null;
this.country = null;
@@ -783,29 +772,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
}
- public String getUserName() {
- return this.userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public void unsetUserName() {
- this.userName = null;
- }
-
- /** Returns true if field userName is set (has been assigned a value) and false otherwise */
- public boolean isSetUserName() {
- return this.userName != null;
- }
-
- public void setUserNameIsSet(boolean value) {
- if (!value) {
- this.userName = null;
- }
- }
-
public String getOrcidId() {
return this.orcidId;
}
@@ -1283,14 +1249,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
break;
- case USER_NAME:
- if (value == null) {
- unsetUserName();
- } else {
- setUserName((String)value);
- }
- break;
-
case ORCID_ID:
if (value == null) {
unsetOrcidId();
@@ -1446,9 +1404,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
case NAME_SUFFIX:
return getNameSuffix();
- case USER_NAME:
- return getUserName();
-
case ORCID_ID:
return getOrcidId();
@@ -1525,8 +1480,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
return isSetNamePrefix();
case NAME_SUFFIX:
return isSetNameSuffix();
- case USER_NAME:
- return isSetUserName();
case ORCID_ID:
return isSetOrcidId();
case PHONES:
@@ -1664,15 +1617,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
return false;
}
- boolean this_present_userName = true && this.isSetUserName();
- boolean that_present_userName = true && that.isSetUserName();
- if (this_present_userName || that_present_userName) {
- if (!(this_present_userName && that_present_userName))
- return false;
- if (!this.userName.equals(that.userName))
- return false;
- }
-
boolean this_present_orcidId = true && this.isSetOrcidId();
boolean that_present_orcidId = true && that.isSetOrcidId();
if (this_present_orcidId || that_present_orcidId) {
@@ -1865,11 +1809,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
if (present_nameSuffix)
list.add(nameSuffix);
- boolean present_userName = true && (isSetUserName());
- list.add(present_userName);
- if (present_userName)
- list.add(userName);
-
boolean present_orcidId = true && (isSetOrcidId());
list.add(present_orcidId);
if (present_orcidId)
@@ -2056,16 +1995,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUserName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
lastComparison = Boolean.valueOf(isSetOrcidId()).compareTo(other.isSetOrcidId());
if (lastComparison != 0) {
return lastComparison;
@@ -2321,16 +2250,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
first = false;
}
- if (isSetUserName()) {
- if (!first) sb.append(", ");
- sb.append("userName:");
- if (this.userName == null) {
- sb.append("null");
- } else {
- sb.append(this.userName);
- }
- first = false;
- }
if (isSetOrcidId()) {
if (!first) sb.append(", ");
sb.append("orcidId:");
@@ -2643,15 +2562,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 11: // USER_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 12: // ORCID_ID
+ case 11: // ORCID_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.orcidId = iprot.readString();
struct.setOrcidIdIsSet(true);
@@ -2659,7 +2570,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 13: // PHONES
+ case 12: // PHONES
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list27 = iprot.readListBegin();
@@ -2677,7 +2588,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 14: // COUNTRY
+ case 13: // COUNTRY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.country = iprot.readString();
struct.setCountryIsSet(true);
@@ -2685,7 +2596,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 15: // NATIONALITY
+ case 14: // NATIONALITY
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
@@ -2703,7 +2614,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 16: // HOME_ORGANIZATION
+ case 15: // HOME_ORGANIZATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.homeOrganization = iprot.readString();
struct.setHomeOrganizationIsSet(true);
@@ -2711,7 +2622,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 17: // ORGINATION_AFFILIATION
+ case 16: // ORGINATION_AFFILIATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.orginationAffiliation = iprot.readString();
struct.setOrginationAffiliationIsSet(true);
@@ -2719,7 +2630,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 18: // CREATION_TIME
+ case 17: // CREATION_TIME
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.creationTime = iprot.readI64();
struct.setCreationTimeIsSet(true);
@@ -2727,7 +2638,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 19: // LAST_ACCESS_TIME
+ case 18: // LAST_ACCESS_TIME
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.lastAccessTime = iprot.readI64();
struct.setLastAccessTimeIsSet(true);
@@ -2735,7 +2646,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 20: // VALID_UNTIL
+ case 19: // VALID_UNTIL
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.validUntil = iprot.readI64();
struct.setValidUntilIsSet(true);
@@ -2743,7 +2654,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 21: // STATE
+ case 20: // STATE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.State = org.apache.airavata.model.user.Status.findByValue(iprot.readI32());
struct.setStateIsSet(true);
@@ -2751,7 +2662,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 22: // COMMENTS
+ case 21: // COMMENTS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.comments = iprot.readString();
struct.setCommentsIsSet(true);
@@ -2759,7 +2670,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 23: // LABELED_URI
+ case 22: // LABELED_URI
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
@@ -2777,7 +2688,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 24: // GPG_KEY
+ case 23: // GPG_KEY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.gpgKey = iprot.readString();
struct.setGpgKeyIsSet(true);
@@ -2785,7 +2696,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 25: // TIME_ZONE
+ case 24: // TIME_ZONE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.timeZone = iprot.readString();
struct.setTimeZoneIsSet(true);
@@ -2793,7 +2704,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 26: // NSF_DEMOGRAPHICS
+ case 25: // NSF_DEMOGRAPHICS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.nsfDemographics = new NSFDemographics();
struct.nsfDemographics.read(iprot);
@@ -2878,13 +2789,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
oprot.writeFieldEnd();
}
}
- if (struct.userName != null) {
- if (struct.isSetUserName()) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
- oprot.writeFieldEnd();
- }
- }
if (struct.orcidId != null) {
if (struct.isSetOrcidId()) {
oprot.writeFieldBegin(ORCID_ID_FIELD_DESC);
@@ -3041,43 +2945,40 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
if (struct.isSetNameSuffix()) {
optionals.set(2);
}
- if (struct.isSetUserName()) {
- optionals.set(3);
- }
if (struct.isSetOrcidId()) {
- optionals.set(4);
+ optionals.set(3);
}
if (struct.isSetPhones()) {
- optionals.set(5);
+ optionals.set(4);
}
if (struct.isSetCountry()) {
- optionals.set(6);
+ optionals.set(5);
}
if (struct.isSetNationality()) {
- optionals.set(7);
+ optionals.set(6);
}
if (struct.isSetHomeOrganization()) {
- optionals.set(8);
+ optionals.set(7);
}
if (struct.isSetOrginationAffiliation()) {
- optionals.set(9);
+ optionals.set(8);
}
if (struct.isSetComments()) {
- optionals.set(10);
+ optionals.set(9);
}
if (struct.isSetLabeledURI()) {
- optionals.set(11);
+ optionals.set(10);
}
if (struct.isSetGpgKey()) {
- optionals.set(12);
+ optionals.set(11);
}
if (struct.isSetTimeZone()) {
- optionals.set(13);
+ optionals.set(12);
}
if (struct.isSetNsfDemographics()) {
- optionals.set(14);
+ optionals.set(13);
}
- oprot.writeBitSet(optionals, 15);
+ oprot.writeBitSet(optionals, 14);
if (struct.isSetMiddleName()) {
oprot.writeString(struct.middleName);
}
@@ -3087,9 +2988,6 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
if (struct.isSetNameSuffix()) {
oprot.writeString(struct.nameSuffix);
}
- if (struct.isSetUserName()) {
- oprot.writeString(struct.userName);
- }
if (struct.isSetOrcidId()) {
oprot.writeString(struct.orcidId);
}
@@ -3177,7 +3075,7 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
struct.setValidUntilIsSet(true);
struct.State = org.apache.airavata.model.user.Status.findByValue(iprot.readI32());
struct.setStateIsSet(true);
- BitSet incoming = iprot.readBitSet(15);
+ BitSet incoming = iprot.readBitSet(14);
if (incoming.get(0)) {
struct.middleName = iprot.readString();
struct.setMiddleNameIsSet(true);
@@ -3191,14 +3089,10 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
struct.setNameSuffixIsSet(true);
}
if (incoming.get(3)) {
- struct.userName = iprot.readString();
- struct.setUserNameIsSet(true);
- }
- if (incoming.get(4)) {
struct.orcidId = iprot.readString();
struct.setOrcidIdIsSet(true);
}
- if (incoming.get(5)) {
+ if (incoming.get(4)) {
{
org.apache.thrift.protocol.TList _list47 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.phones = new ArrayList<String>(_list47.size);
@@ -3211,11 +3105,11 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
struct.setPhonesIsSet(true);
}
- if (incoming.get(6)) {
+ if (incoming.get(5)) {
struct.country = iprot.readString();
struct.setCountryIsSet(true);
}
- if (incoming.get(7)) {
+ if (incoming.get(6)) {
{
org.apache.thrift.protocol.TList _list50 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.nationality = new ArrayList<String>(_list50.size);
@@ -3228,19 +3122,19 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
struct.setNationalityIsSet(true);
}
- if (incoming.get(8)) {
+ if (incoming.get(7)) {
struct.homeOrganization = iprot.readString();
struct.setHomeOrganizationIsSet(true);
}
- if (incoming.get(9)) {
+ if (incoming.get(8)) {
struct.orginationAffiliation = iprot.readString();
struct.setOrginationAffiliationIsSet(true);
}
- if (incoming.get(10)) {
+ if (incoming.get(9)) {
struct.comments = iprot.readString();
struct.setCommentsIsSet(true);
}
- if (incoming.get(11)) {
+ if (incoming.get(10)) {
{
org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.labeledURI = new ArrayList<String>(_list53.size);
@@ -3253,15 +3147,15 @@ public class UserProfile implements org.apache.thrift.TBase<UserProfile, UserPro
}
struct.setLabeledURIIsSet(true);
}
- if (incoming.get(12)) {
+ if (incoming.get(11)) {
struct.gpgKey = iprot.readString();
struct.setGpgKeyIsSet(true);
}
- if (incoming.get(13)) {
+ if (incoming.get(12)) {
struct.timeZone = iprot.readString();
struct.setTimeZoneIsSet(true);
}
- if (incoming.get(14)) {
+ if (incoming.get(13)) {
struct.nsfDemographics = new NSFDemographics();
struct.nsfDemographics.read(iprot);
struct.setNsfDemographicsIsSet(true);
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
index d385b70..df0ecab 100644
--- a/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
+++ b/airavata-services/profile-service/iam-admin-services-core/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
@@ -316,7 +316,8 @@ public class TenantManagementKeycloakImpl implements TenantManagementInterface {
for(UserRepresentation user : retrieveUserList){
UserProfile profile = new UserProfile();
profile.setUserId(user.getUsername());
- profile.setUserName(user.getFirstName());
+ profile.setFirstName(user.getFirstName());
+ profile.setLastName(user.getLastName());
profile.setEmails(Arrays.asList(new String[]{user.getEmail()}));
userList.add(profile);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/iam-admin-services-core/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/iam-admin-services-core/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java b/airavata-services/profile-service/iam-admin-services-core/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
index 91479bf..6ae81a6 100644
--- a/airavata-services/profile-service/iam-admin-services-core/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
+++ b/airavata-services/profile-service/iam-admin-services-core/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
@@ -50,7 +50,8 @@ public class SetupNewGateway {
public static void UserRegistration(){
UserProfile user = new UserProfile();
user.setUserId("testuser");
- user.setUserName("Some Man");
+ user.setFirstName("test-firstname");
+ user.setLastName("test-lastname");
List<String> emails = new ArrayList<>();
emails.add("some.man@outlook.com");
user.setGatewayId("maven.test.gateway");
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/profile-service-client-sdks/java-client-samples/src/main/java/org/apache/airavata/service/profile/client/samples/UserProfileSample.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/profile-service-client-sdks/java-client-samples/src/main/java/org/apache/airavata/service/profile/client/samples/UserProfileSample.java b/airavata-services/profile-service/profile-service-client-sdks/java-client-samples/src/main/java/org/apache/airavata/service/profile/client/samples/UserProfileSample.java
index 861f2f5..90ace42 100644
--- a/airavata-services/profile-service/profile-service-client-sdks/java-client-samples/src/main/java/org/apache/airavata/service/profile/client/samples/UserProfileSample.java
+++ b/airavata-services/profile-service/profile-service-client-sdks/java-client-samples/src/main/java/org/apache/airavata/service/profile/client/samples/UserProfileSample.java
@@ -56,11 +56,11 @@ public class UserProfileSample {
// test update-user-profile : update name
userProfile = getUserProfile(testUserId);
- String newUserName = userProfile.getUserName().replaceAll("username", "username-updated");
- userProfile.setUserName(newUserName);
+ String newFName = userProfile.getFirstName().replaceAll("fname", "fname-updated");
+ userProfile.setFirstName(newFName);
boolean updateSuccess = userProfileClient.updateUserProfile(authzToken, userProfile);
- assert (updateSuccess) : "User update with new userName: [" + newUserName + "], Failed!";
- System.out.println("User update with new userName: [" + newUserName + "], Successful!");
+ assert (updateSuccess) : "User update with new firstName: [" + newFName + "], Failed!";
+ System.out.println("User update with new firstName: [" + newFName + "], Successful!");
// test get-all-userprofiles
List<UserProfile> userProfileList = userProfileClient.getAllUserProfilesInGateway(authzToken, testGatewayId, 0, 5);
@@ -70,18 +70,13 @@ public class UserProfileSample {
System.out.println("\t [UserProfile] userId: " + userProfile1.getUserId());
}
- // test find-user-profile-by-name
- userProfile = userProfileClient.getUserProfileByName(authzToken, newUserName, testGatewayId);
- assert (userProfile != null) : "Could not find user with userName: " + newUserName;
- System.out.println("UserProfile: " + userProfile);
-
// test delete-user-profile
boolean deleteSuccess = userProfileClient.deleteUserProfile(authzToken, testUserId, testGatewayId);
assert (deleteSuccess) : "Delete user failed for userId: " + testUserId;
System.out.println("Successfully deleted user with userId: " + testUserId);
// test-check-user-exist
- boolean userExists = userProfileClient.doesUserExist(authzToken, newUserName, testGatewayId);
+ boolean userExists = userProfileClient.doesUserExist(authzToken, testUserId, testGatewayId);
assert (!userExists) : "User should not exist, but it does.";
System.out.println("User was deleted, hence does not exist!");
System.out.println("*** DONE ***");
@@ -102,10 +97,11 @@ public class UserProfileSample {
userProfile.setUserModelVersion("model-" + userIdValue);
userProfile.setAiravataInternalUserId("test-user-internal-" + userIdValue);
userProfile.setUserId("test-user-" + userIdValue);
+ userProfile.setFirstName("test-user-fname");
+ userProfile.setLastName("test-user-lname");
userProfile.setGatewayId(testGatewayId);
userProfile.addToEmails("test-user-" + userIdValue + "@domain1.com");
userProfile.addToEmails("test-user-" + userIdValue + "@domain2.com");
- userProfile.setUserName("test-username-" + userIdValue);
userProfile.setCreationTime(new Date().getTime());
userProfile.setLastAccessTime(new Date().getTime());
userProfile.setValidUntil(new Date().getTime());
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/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 2597aea..2dd918e 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
@@ -16,10 +16,6 @@ public class QueryConstants {
public static final String FIND_ALL_USER_PROFILES_BY_GATEWAY_ID = "SELECT u FROM UserProfileEntity u " +
"where u.gatewayId LIKE :" + UserProfile._Fields.GATEWAY_ID.getFieldName() + "";
- public static final String FIND_USER_PROFILE_BY_USER_NAME = "SELECT u FROM UserProfileEntity u " +
- "where u.userName LIKE :" + UserProfile._Fields.USER_NAME.getFieldName() + " " +
- "AND 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() + "";
http://git-wip-us.apache.org/repos/asf/airavata/blob/f5a4e9dd/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
----------------------------------------------------------------------
diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
index 7b93bc5..6ade73c 100644
--- a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
+++ b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
@@ -159,30 +159,10 @@ public class UserProfileServiceHandler implements UserProfileService.Iface {
}
@Override
- @SecurityCheck
- public UserProfile getUserProfileByName(AuthzToken authzToken, String userName, String gatewayId) throws UserProfileServiceException, AuthorizationException, TException {
- try{
- UserProfile userProfile = userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId);
- if(userProfile != null)
- return userProfile;
- else
- throw new Exception("User with userName: " + userName + ", in Gateway: " + gatewayId + ", does not exist.");
- } catch (Exception e) {
- logger.error("Error while retrieving user profile", e);
- UserProfileServiceException exception = new UserProfileServiceException();
- exception.setMessage("Error while retrieving user profile. More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- @SecurityCheck
- public boolean doesUserExist(AuthzToken authzToken, String userName, String gatewayId) throws UserProfileServiceException, AuthorizationException, TException {
+ public boolean doesUserExist(AuthzToken authzToken, String userId, String gatewayId) throws UserProfileServiceException, AuthorizationException, TException {
try{
- UserProfile userProfile = userProfileRepository.getUserProfileByNameAndGateWay(userName, gatewayId);
- if (null != userProfile)
- return true;
- return false;
+ UserProfile userProfile = userProfileRepository.getUserProfileByIdAndGateWay(userId, gatewayId);
+ return null != userProfile;
} catch (Exception e) {
logger.error("Error while finding user profile", e);
UserProfileServiceException exception = new UserProfileServiceException();