You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/01/31 18:24:10 UTC
[airavata] branch group-based-auth updated: Add getGroups() method
to GroupManagerService
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/group-based-auth by this push:
new 2e933a7 Add getGroups() method to GroupManagerService
2e933a7 is described below
commit 2e933a76b129b1b87852504c263aac5376d89405
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jan 31 13:23:42 2018 -0500
Add getGroups() method to GroupManagerService
---
.../handlers/GroupManagerServiceHandler.java | 80 +-
.../groupmanager/cpi/GroupManagerService.java | 1518 +++++++++++++++++---
.../exception/GroupManagerServiceException.java | 4 +-
.../cpi/group_manager_cpiConstants.java | 2 +-
.../group-manager/group-manager-cpi.thrift | 4 +
5 files changed, 1402 insertions(+), 206 deletions(-)
diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
index 1b7ebfb..9e1de3b 100644
--- a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
+++ b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
@@ -111,17 +111,10 @@ public class GroupManagerServiceHandler implements GroupManagerService.Iface {
public GroupModel getGroup(AuthzToken authzToken, String groupId) throws GroupManagerServiceException, AuthorizationException, TException {
try {
SharingRegistryService.Client sharingClient = getSharingRegistryServiceClient();
- UserGroup userGroup = sharingClient.getGroup(authzToken.getClaimsMap().get(Constants.GATEWAY_ID), groupId);
+ final String domainId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
+ UserGroup userGroup = sharingClient.getGroup(domainId, groupId);
- GroupModel groupModel = new GroupModel();
- groupModel.setId(userGroup.getGroupId());
- groupModel.setName(userGroup.getName());
- groupModel.setDescription(userGroup.getDescription());
- groupModel.setOwnerId(userGroup.getOwnerId());
-
- sharingClient.getGroupMembersOfTypeUser(authzToken.getClaimsMap().get(Constants.GATEWAY_ID), groupId, 0, -1).stream().forEach(user->
- groupModel.addToMembers(user.getUserId())
- );
+ GroupModel groupModel = convertToGroupModel(userGroup, sharingClient);
return groupModel;
}
@@ -134,23 +127,59 @@ public class GroupManagerServiceHandler implements GroupManagerService.Iface {
}
}
+ private GroupModel convertToGroupModel(UserGroup userGroup, SharingRegistryService.Client sharingClient) throws TException {
+ GroupModel groupModel = new GroupModel();
+ groupModel.setId(userGroup.getGroupId());
+ groupModel.setName(userGroup.getName());
+ groupModel.setDescription(userGroup.getDescription());
+ groupModel.setOwnerId(userGroup.getOwnerId());
+
+ sharingClient.getGroupMembersOfTypeUser(userGroup.getDomainId(), userGroup.getGroupId(), 0, -1).stream().forEach(user->
+ groupModel.addToMembers(user.getUserId())
+ );
+ return groupModel;
+ }
+
+ @Override
+ @SecurityCheck
+ public List<GroupModel> getGroups(AuthzToken authzToken) throws GroupManagerServiceException, AuthorizationException, TException {
+ final String domainId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
+ SharingRegistryService.Client sharingClient = null;
+ try {
+ sharingClient = getSharingRegistryServiceClient();
+ List<UserGroup> userGroups = sharingClient.getGroups(domainId, 0, -1);
+
+ List<GroupModel> groupModels = new ArrayList<>();
+
+ for (UserGroup userGroup: userGroups) {
+ GroupModel groupModel = convertToGroupModel(userGroup, sharingClient);
+
+ groupModels.add(groupModel);
+ }
+ return groupModels;
+ }
+ catch (Exception e) {
+ String msg = "Error Retrieving Groups. Domain ID: " + domainId;
+ logger.error(msg, e);
+ GroupManagerServiceException exception = new GroupManagerServiceException();
+ exception.setMessage(msg + " More info : " + e.getMessage());
+ throw exception;
+ } finally {
+ closeSharingClient(sharingClient);
+ }
+ }
+
@Override
@SecurityCheck
public List<GroupModel> getAllGroupsUserBelongs(AuthzToken authzToken, String userName) throws GroupManagerServiceException, AuthorizationException, TException {
try {
SharingRegistryService.Client sharingClient = getSharingRegistryServiceClient();
List<GroupModel> groupModels = new ArrayList<GroupModel>();
- List<UserGroup> userGroups = sharingClient.getAllMemberGroupsForUser(authzToken.getClaimsMap().get(Constants.GATEWAY_ID), userName);
+ final String domainId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
+ List<UserGroup> userGroups = sharingClient.getAllMemberGroupsForUser(domainId, userName);
for (UserGroup userGroup: userGroups) {
- GroupModel groupModel = new GroupModel();
- groupModel.setId(userGroup.getGroupId());
- groupModel.setName(userGroup.getName());
- groupModel.setDescription(userGroup.getDescription());
- groupModel.setOwnerId(userGroup.getOwnerId());
-
- sharingClient.getGroupMembersOfTypeUser(authzToken.getClaimsMap().get(Constants.GATEWAY_ID), userGroup.getGroupId(), 0, -1).stream().forEach(user->
- groupModel.addToMembers(user.getUserId()));
+ GroupModel groupModel = convertToGroupModel(userGroup, sharingClient);
groupModels.add(groupModel);
}
@@ -246,6 +275,7 @@ public class GroupManagerServiceHandler implements GroupManagerService.Iface {
}
}
+ // TODO: replace these methods with ThriftClientPool (see AIRAVATA-2607)
private SharingRegistryService.Client getSharingRegistryServiceClient() throws TException, ApplicationSettingsException {
final int serverPort = Integer.parseInt(ServerSettings.getSharingRegistryPort());
final String serverHost = ServerSettings.getSharingRegistryHost();
@@ -255,4 +285,16 @@ public class GroupManagerServiceHandler implements GroupManagerService.Iface {
throw new TException("Unable to create sharing registry client...", e);
}
}
+
+ private void closeSharingClient(SharingRegistryService.Client sharingClient) {
+ if (sharingClient != null) {
+ if (sharingClient.getInputProtocol().getTransport().isOpen()) {
+ sharingClient.getInputProtocol().getTransport().close();
+ }
+ if (sharingClient.getOutputProtocol().getTransport().isOpen()) {
+ sharingClient.getOutputProtocol().getTransport().close();
+ }
+ }
+ }
+
}
diff --git a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/GroupManagerService.java b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/GroupManagerService.java
index 9387fd7..0c91bdc 100644
--- a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/GroupManagerService.java
+++ b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/GroupManagerService.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (1.0.0-dev)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -23,7 +23,7 @@
package org.apache.airavata.service.profile.groupmanager.cpi;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class GroupManagerService {
public interface Iface {
@@ -36,6 +36,8 @@ public class GroupManagerService {
public org.apache.airavata.model.group.GroupModel getGroup(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String groupId) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+ public java.util.List<org.apache.airavata.model.group.GroupModel> getGroups(org.apache.airavata.model.security.AuthzToken authzToken) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+
public java.util.List<org.apache.airavata.model.group.GroupModel> getAllGroupsUserBelongs(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String userName) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
public boolean transferGroupOwnership(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String groupId, java.lang.String newOwnerId) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
@@ -60,6 +62,8 @@ public class GroupManagerService {
public void getGroup(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String groupId, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.model.group.GroupModel> resultHandler) throws org.apache.thrift.TException;
+ public void getGroups(org.apache.airavata.model.security.AuthzToken authzToken, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> resultHandler) throws org.apache.thrift.TException;
+
public void getAllGroupsUserBelongs(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> resultHandler) throws org.apache.thrift.TException;
public void transferGroupOwnership(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String groupId, java.lang.String newOwnerId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
@@ -215,6 +219,35 @@ public class GroupManagerService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroup failed: unknown result");
}
+ public java.util.List<org.apache.airavata.model.group.GroupModel> getGroups(org.apache.airavata.model.security.AuthzToken authzToken) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ {
+ send_getGroups(authzToken);
+ return recv_getGroups();
+ }
+
+ public void send_getGroups(org.apache.airavata.model.security.AuthzToken authzToken) throws org.apache.thrift.TException
+ {
+ getGroups_args args = new getGroups_args();
+ args.setAuthzToken(authzToken);
+ sendBase("getGroups", args);
+ }
+
+ public java.util.List<org.apache.airavata.model.group.GroupModel> recv_getGroups() throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ {
+ getGroups_result result = new getGroups_result();
+ receiveBase(result, "getGroups");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.gse != null) {
+ throw result.gse;
+ }
+ if (result.ae != null) {
+ throw result.ae;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroups failed: unknown result");
+ }
+
public java.util.List<org.apache.airavata.model.group.GroupModel> getAllGroupsUserBelongs(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String userName) throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
{
send_getAllGroupsUserBelongs(authzToken, userName);
@@ -561,6 +594,38 @@ public class GroupManagerService {
}
}
+ public void getGroups(org.apache.airavata.model.security.AuthzToken authzToken, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getGroups_call method_call = new getGroups_call(authzToken, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getGroups_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.airavata.model.group.GroupModel>> {
+ private org.apache.airavata.model.security.AuthzToken authzToken;
+ public getGroups_call(org.apache.airavata.model.security.AuthzToken authzToken, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> 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;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGroups", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getGroups_args args = new getGroups_args();
+ args.setAuthzToken(authzToken);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public java.util.List<org.apache.airavata.model.group.GroupModel> getResult() throws org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new java.lang.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_getGroups();
+ }
+ }
+
public void getAllGroupsUserBelongs(org.apache.airavata.model.security.AuthzToken authzToken, java.lang.String userName, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> resultHandler) throws org.apache.thrift.TException {
checkReady();
getAllGroupsUserBelongs_call method_call = new getAllGroupsUserBelongs_call(authzToken, userName, resultHandler, this, ___protocolFactory, ___transport);
@@ -803,6 +868,7 @@ public class GroupManagerService {
processMap.put("updateGroup", new updateGroup());
processMap.put("deleteGroup", new deleteGroup());
processMap.put("getGroup", new getGroup());
+ processMap.put("getGroups", new getGroups());
processMap.put("getAllGroupsUserBelongs", new getAllGroupsUserBelongs());
processMap.put("transferGroupOwnership", new transferGroupOwnership());
processMap.put("addGroupAdmins", new addGroupAdmins());
@@ -918,6 +984,32 @@ public class GroupManagerService {
}
}
+ public static class getGroups<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getGroups_args> {
+ public getGroups() {
+ super("getGroups");
+ }
+
+ public getGroups_args getEmptyArgsInstance() {
+ return new getGroups_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getGroups_result getResult(I iface, getGroups_args args) throws org.apache.thrift.TException {
+ getGroups_result result = new getGroups_result();
+ try {
+ result.success = iface.getGroups(args.authzToken);
+ } catch (org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException gse) {
+ result.gse = gse;
+ } catch (org.apache.airavata.model.error.AuthorizationException ae) {
+ result.ae = ae;
+ }
+ return result;
+ }
+ }
+
public static class getAllGroupsUserBelongs<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllGroupsUserBelongs_args> {
public getAllGroupsUserBelongs() {
super("getAllGroupsUserBelongs");
@@ -1096,6 +1188,7 @@ public class GroupManagerService {
processMap.put("updateGroup", new updateGroup());
processMap.put("deleteGroup", new deleteGroup());
processMap.put("getGroup", new getGroup());
+ processMap.put("getGroups", new getGroups());
processMap.put("getAllGroupsUserBelongs", new getAllGroupsUserBelongs());
processMap.put("transferGroupOwnership", new transferGroupOwnership());
processMap.put("addGroupAdmins", new addGroupAdmins());
@@ -1383,6 +1476,75 @@ public class GroupManagerService {
}
}
+ public static class getGroups<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getGroups_args, java.util.List<org.apache.airavata.model.group.GroupModel>> {
+ public getGroups() {
+ super("getGroups");
+ }
+
+ public getGroups_args getEmptyArgsInstance() {
+ return new getGroups_args();
+ }
+
+ public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>>() {
+ public void onComplete(java.util.List<org.apache.airavata.model.group.GroupModel> o) {
+ getGroups_result result = new getGroups_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ } catch (org.apache.thrift.transport.TTransportException e) {
+ _LOGGER.error("TTransportException writing to internal frame buffer", e);
+ fb.close();
+ } catch (java.lang.Exception e) {
+ _LOGGER.error("Exception writing to internal frame buffer", e);
+ onError(e);
+ }
+ }
+ public void onError(java.lang.Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TSerializable msg;
+ getGroups_result result = new getGroups_result();
+ if (e instanceof org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException) {
+ result.gse = (org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException) e;
+ result.setGseIsSet(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 if (e instanceof org.apache.thrift.transport.TTransportException) {
+ _LOGGER.error("TTransportException inside handler", e);
+ fb.close();
+ return;
+ } else if (e instanceof org.apache.thrift.TApplicationException) {
+ _LOGGER.error("TApplicationException inside handler", e);
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TApplicationException)e;
+ } else {
+ _LOGGER.error("Exception inside handler", e);
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ } catch (java.lang.Exception ex) {
+ _LOGGER.error("Exception writing to internal frame buffer", ex);
+ fb.close();
+ }
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, getGroups_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.airavata.model.group.GroupModel>> resultHandler) throws org.apache.thrift.TException {
+ iface.getGroups(args.authzToken,resultHandler);
+ }
+ }
+
public static class getAllGroupsUserBelongs<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllGroupsUserBelongs_args, java.util.List<org.apache.airavata.model.group.GroupModel>> {
public getAllGroupsUserBelongs() {
super("getAllGroupsUserBelongs");
@@ -6051,22 +6213,19 @@ public class GroupManagerService {
}
}
- public static class getAllGroupsUserBelongs_args implements org.apache.thrift.TBase<getAllGroupsUserBelongs_args, getAllGroupsUserBelongs_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGroupsUserBelongs_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGroupsUserBelongs_args");
+ public static class getGroups_args implements org.apache.thrift.TBase<getGroups_args, getGroups_args._Fields>, java.io.Serializable, Cloneable, Comparable<getGroups_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGroups_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllGroupsUserBelongs_argsStandardSchemeFactory();
- private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllGroupsUserBelongs_argsTupleSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroups_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroups_argsTupleSchemeFactory();
public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public java.lang.String userName; // 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");
+ AUTHZ_TOKEN((short)1, "authzToken");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
@@ -6083,8 +6242,6 @@ public class GroupManagerService {
switch(fieldId) {
case 1: // AUTHZ_TOKEN
return AUTHZ_TOKEN;
- case 2: // USER_NAME
- return USER_NAME;
default:
return null;
}
@@ -6130,51 +6287,43 @@ public class GroupManagerService {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllGroupsUserBelongs_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGroups_args.class, metaDataMap);
}
- public getAllGroupsUserBelongs_args() {
+ public getGroups_args() {
}
- public getAllGroupsUserBelongs_args(
- org.apache.airavata.model.security.AuthzToken authzToken,
- java.lang.String userName)
+ public getGroups_args(
+ org.apache.airavata.model.security.AuthzToken authzToken)
{
this();
this.authzToken = authzToken;
- this.userName = userName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public getAllGroupsUserBelongs_args(getAllGroupsUserBelongs_args other) {
+ public getGroups_args(getGroups_args other) {
if (other.isSetAuthzToken()) {
this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
}
- if (other.isSetUserName()) {
- this.userName = other.userName;
- }
}
- public getAllGroupsUserBelongs_args deepCopy() {
- return new getAllGroupsUserBelongs_args(this);
+ public getGroups_args deepCopy() {
+ return new getGroups_args(this);
}
@Override
public void clear() {
this.authzToken = null;
- this.userName = null;
}
public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
return this.authzToken;
}
- public getAllGroupsUserBelongs_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
+ public getGroups_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
this.authzToken = authzToken;
return this;
}
@@ -6194,30 +6343,6 @@ public class GroupManagerService {
}
}
- public java.lang.String getUserName() {
- return this.userName;
- }
-
- public getAllGroupsUserBelongs_args setUserName(java.lang.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 void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case AUTHZ_TOKEN:
@@ -6228,14 +6353,6 @@ public class GroupManagerService {
}
break;
- case USER_NAME:
- if (value == null) {
- unsetUserName();
- } else {
- setUserName((java.lang.String)value);
- }
- break;
-
}
}
@@ -6244,9 +6361,6 @@ public class GroupManagerService {
case AUTHZ_TOKEN:
return getAuthzToken();
- case USER_NAME:
- return getUserName();
-
}
throw new java.lang.IllegalStateException();
}
@@ -6260,8 +6374,6 @@ public class GroupManagerService {
switch (field) {
case AUTHZ_TOKEN:
return isSetAuthzToken();
- case USER_NAME:
- return isSetUserName();
}
throw new java.lang.IllegalStateException();
}
@@ -6270,12 +6382,12 @@ public class GroupManagerService {
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
- if (that instanceof getAllGroupsUserBelongs_args)
- return this.equals((getAllGroupsUserBelongs_args)that);
+ if (that instanceof getGroups_args)
+ return this.equals((getGroups_args)that);
return false;
}
- public boolean equals(getAllGroupsUserBelongs_args that) {
+ public boolean equals(getGroups_args that) {
if (that == null)
return false;
if (this == that)
@@ -6290,15 +6402,6 @@ public class GroupManagerService {
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;
- }
-
return true;
}
@@ -6310,15 +6413,11 @@ public class GroupManagerService {
if (isSetAuthzToken())
hashCode = hashCode * 8191 + authzToken.hashCode();
- hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
- if (isSetUserName())
- hashCode = hashCode * 8191 + userName.hashCode();
-
return hashCode;
}
@Override
- public int compareTo(getAllGroupsUserBelongs_args other) {
+ public int compareTo(getGroups_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
@@ -6335,16 +6434,6 @@ public class GroupManagerService {
return lastComparison;
}
}
- lastComparison = java.lang.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;
- }
- }
return 0;
}
@@ -6362,7 +6451,7 @@ public class GroupManagerService {
@Override
public java.lang.String toString() {
- java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllGroupsUserBelongs_args(");
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroups_args(");
boolean first = true;
sb.append("authzToken:");
@@ -6372,14 +6461,6 @@ public class GroupManagerService {
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;
sb.append(")");
return sb.toString();
}
@@ -6389,9 +6470,6 @@ public class GroupManagerService {
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());
- }
// check for sub-struct validity
if (authzToken != null) {
authzToken.validate();
@@ -6414,15 +6492,15 @@ public class GroupManagerService {
}
}
- private static class getAllGroupsUserBelongs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
- public getAllGroupsUserBelongs_argsStandardScheme getScheme() {
- return new getAllGroupsUserBelongs_argsStandardScheme();
+ private static class getGroups_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGroups_argsStandardScheme getScheme() {
+ return new getGroups_argsStandardScheme();
}
}
- private static class getAllGroupsUserBelongs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllGroupsUserBelongs_args> {
+ private static class getGroups_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getGroups_args> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getGroups_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -6441,14 +6519,6 @@ public class GroupManagerService {
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;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -6460,7 +6530,7 @@ public class GroupManagerService {
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getGroups_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
@@ -6469,40 +6539,32 @@ public class GroupManagerService {
struct.authzToken.write(oprot);
oprot.writeFieldEnd();
}
- if (struct.userName != null) {
- oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
- oprot.writeString(struct.userName);
- oprot.writeFieldEnd();
- }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
- private static class getAllGroupsUserBelongs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
- public getAllGroupsUserBelongs_argsTupleScheme getScheme() {
- return new getAllGroupsUserBelongs_argsTupleScheme();
+ private static class getGroups_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGroups_argsTupleScheme getScheme() {
+ return new getGroups_argsTupleScheme();
}
}
- private static class getAllGroupsUserBelongs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllGroupsUserBelongs_args> {
+ private static class getGroups_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getGroups_args> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, getGroups_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.authzToken.write(oprot);
- oprot.writeString(struct.userName);
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, getGroups_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.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);
}
}
@@ -6511,8 +6573,1096 @@ public class GroupManagerService {
}
}
- public static class getAllGroupsUserBelongs_result implements org.apache.thrift.TBase<getAllGroupsUserBelongs_result, getAllGroupsUserBelongs_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGroupsUserBelongs_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGroupsUserBelongs_result");
+ public static class getGroups_result implements org.apache.thrift.TBase<getGroups_result, getGroups_result._Fields>, java.io.Serializable, Cloneable, Comparable<getGroups_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGroups_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+ private static final org.apache.thrift.protocol.TField GSE_FIELD_DESC = new org.apache.thrift.protocol.TField("gse", 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroups_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroups_resultTupleSchemeFactory();
+
+ public java.util.List<org.apache.airavata.model.group.GroupModel> success; // required
+ public org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException gse; // 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"),
+ GSE((short)1, "gse"),
+ AE((short)2, "ae");
+
+ private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
+
+ static {
+ for (_Fields field : java.util.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: // GSE
+ return GSE;
+ 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 java.lang.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(java.lang.String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final java.lang.String _fieldName;
+
+ _Fields(short thriftId, java.lang.String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public java.lang.String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.group.GroupModel.class))));
+ tmpMap.put(_Fields.GSE, new org.apache.thrift.meta_data.FieldMetaData("gse", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException.class)));
+ tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.error.AuthorizationException.class)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGroups_result.class, metaDataMap);
+ }
+
+ public getGroups_result() {
+ }
+
+ public getGroups_result(
+ java.util.List<org.apache.airavata.model.group.GroupModel> success,
+ org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException gse,
+ org.apache.airavata.model.error.AuthorizationException ae)
+ {
+ this();
+ this.success = success;
+ this.gse = gse;
+ this.ae = ae;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getGroups_result(getGroups_result other) {
+ if (other.isSetSuccess()) {
+ java.util.List<org.apache.airavata.model.group.GroupModel> __this__success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(other.success.size());
+ for (org.apache.airavata.model.group.GroupModel other_element : other.success) {
+ __this__success.add(new org.apache.airavata.model.group.GroupModel(other_element));
+ }
+ this.success = __this__success;
+ }
+ if (other.isSetGse()) {
+ this.gse = new org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException(other.gse);
+ }
+ if (other.isSetAe()) {
+ this.ae = new org.apache.airavata.model.error.AuthorizationException(other.ae);
+ }
+ }
+
+ public getGroups_result deepCopy() {
+ return new getGroups_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ this.gse = null;
+ this.ae = null;
+ }
+
+ public int getSuccessSize() {
+ return (this.success == null) ? 0 : this.success.size();
+ }
+
+ public java.util.Iterator<org.apache.airavata.model.group.GroupModel> getSuccessIterator() {
+ return (this.success == null) ? null : this.success.iterator();
+ }
+
+ public void addToSuccess(org.apache.airavata.model.group.GroupModel elem) {
+ if (this.success == null) {
+ this.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>();
+ }
+ this.success.add(elem);
+ }
+
+ public java.util.List<org.apache.airavata.model.group.GroupModel> getSuccess() {
+ return this.success;
+ }
+
+ public getGroups_result setSuccess(java.util.List<org.apache.airavata.model.group.GroupModel> 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.groupmanager.cpi.exception.GroupManagerServiceException getGse() {
+ return this.gse;
+ }
+
+ public getGroups_result setGse(org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException gse) {
+ this.gse = gse;
+ return this;
+ }
+
+ public void unsetGse() {
+ this.gse = null;
+ }
+
+ /** Returns true if field gse is set (has been assigned a value) and false otherwise */
+ public boolean isSetGse() {
+ return this.gse != null;
+ }
+
+ public void setGseIsSet(boolean value) {
+ if (!value) {
+ this.gse = null;
+ }
+ }
+
+ public org.apache.airavata.model.error.AuthorizationException getAe() {
+ return this.ae;
+ }
+
+ public getGroups_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, java.lang.Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((java.util.List<org.apache.airavata.model.group.GroupModel>)value);
+ }
+ break;
+
+ case GSE:
+ if (value == null) {
+ unsetGse();
+ } else {
+ setGse((org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException)value);
+ }
+ break;
+
+ case AE:
+ if (value == null) {
+ unsetAe();
+ } else {
+ setAe((org.apache.airavata.model.error.AuthorizationException)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ case GSE:
+ return getGse();
+
+ case AE:
+ return getAe();
+
+ }
+ throw new java.lang.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 java.lang.IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ case GSE:
+ return isSetGse();
+ case AE:
+ return isSetAe();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getGroups_result)
+ return this.equals((getGroups_result)that);
+ return false;
+ }
+
+ public boolean equals(getGroups_result that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ 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_gse = true && this.isSetGse();
+ boolean that_present_gse = true && that.isSetGse();
+ if (this_present_gse || that_present_gse) {
+ if (!(this_present_gse && that_present_gse))
+ return false;
+ if (!this.gse.equals(that.gse))
+ 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() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
+ if (isSetSuccess())
+ hashCode = hashCode * 8191 + success.hashCode();
+
+ hashCode = hashCode * 8191 + ((isSetGse()) ? 131071 : 524287);
+ if (isSetGse())
+ hashCode = hashCode * 8191 + gse.hashCode();
+
+ hashCode = hashCode * 8191 + ((isSetAe()) ? 131071 : 524287);
+ if (isSetAe())
+ hashCode = hashCode * 8191 + ae.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(getGroups_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.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 = java.lang.Boolean.valueOf(isSetGse()).compareTo(other.isSetGse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gse, other.gse);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = java.lang.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 {
+ scheme(iprot).read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ scheme(oprot).write(oprot, this);
+ }
+
+ @Override
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroups_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("gse:");
+ if (this.gse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gse);
+ }
+ 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
+ }
+
+ 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, java.lang.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 getGroups_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGroups_resultStandardScheme getScheme() {
+ return new getGroups_resultStandardScheme();
+ }
+ }
+
+ private static class getGroups_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getGroups_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getGroups_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.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list0.size);
+ org.apache.airavata.model.group.GroupModel _elem1;
+ for (int _i2 = 0; _i2 < _list0.size; ++_i2)
+ {
+ _elem1 = new org.apache.airavata.model.group.GroupModel();
+ _elem1.read(iprot);
+ struct.success.add(_elem1);
+ }
+ iprot.readListEnd();
+ }
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // GSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.gse = new org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException();
+ struct.gse.read(iprot);
+ struct.setGseIsSet(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, getGroups_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+ for (org.apache.airavata.model.group.GroupModel _iter3 : struct.success)
+ {
+ _iter3.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.gse != null) {
+ oprot.writeFieldBegin(GSE_FIELD_DESC);
+ struct.gse.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 getGroups_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getGroups_resultTupleScheme getScheme() {
+ return new getGroups_resultTupleScheme();
+ }
+ }
+
+ private static class getGroups_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getGroups_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getGroups_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet optionals = new java.util.BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetGse()) {
+ optionals.set(1);
+ }
+ if (struct.isSetAe()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetSuccess()) {
+ {
+ oprot.writeI32(struct.success.size());
+ for (org.apache.airavata.model.group.GroupModel _iter4 : struct.success)
+ {
+ _iter4.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetGse()) {
+ struct.gse.write(oprot);
+ }
+ if (struct.isSetAe()) {
+ struct.ae.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getGroups_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list5.size);
+ org.apache.airavata.model.group.GroupModel _elem6;
+ for (int _i7 = 0; _i7 < _list5.size; ++_i7)
+ {
+ _elem6 = new org.apache.airavata.model.group.GroupModel();
+ _elem6.read(iprot);
+ struct.success.add(_elem6);
+ }
+ }
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.gse = new org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException();
+ struct.gse.read(iprot);
+ struct.setGseIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.ae = new org.apache.airavata.model.error.AuthorizationException();
+ struct.ae.read(iprot);
+ struct.setAeIsSet(true);
+ }
+ }
+ }
+
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+ }
+ }
+
+ public static class getAllGroupsUserBelongs_args implements org.apache.thrift.TBase<getAllGroupsUserBelongs_args, getAllGroupsUserBelongs_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGroupsUserBelongs_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGroupsUserBelongs_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllGroupsUserBelongs_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllGroupsUserBelongs_argsTupleSchemeFactory();
+
+ public org.apache.airavata.model.security.AuthzToken authzToken; // required
+ public java.lang.String userName; // 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");
+
+ private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
+
+ static {
+ for (_Fields field : java.util.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;
+ 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 java.lang.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(java.lang.String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final java.lang.String _fieldName;
+
+ _Fields(short thriftId, java.lang.String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public java.lang.String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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)));
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllGroupsUserBelongs_args.class, metaDataMap);
+ }
+
+ public getAllGroupsUserBelongs_args() {
+ }
+
+ public getAllGroupsUserBelongs_args(
+ org.apache.airavata.model.security.AuthzToken authzToken,
+ java.lang.String userName)
+ {
+ this();
+ this.authzToken = authzToken;
+ this.userName = userName;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getAllGroupsUserBelongs_args(getAllGroupsUserBelongs_args other) {
+ if (other.isSetAuthzToken()) {
+ this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
+ }
+ if (other.isSetUserName()) {
+ this.userName = other.userName;
+ }
+ }
+
+ public getAllGroupsUserBelongs_args deepCopy() {
+ return new getAllGroupsUserBelongs_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.authzToken = null;
+ this.userName = null;
+ }
+
+ public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
+ return this.authzToken;
+ }
+
+ public getAllGroupsUserBelongs_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 java.lang.String getUserName() {
+ return this.userName;
+ }
+
+ public getAllGroupsUserBelongs_args setUserName(java.lang.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 void setFieldValue(_Fields field, java.lang.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((java.lang.String)value);
+ }
+ break;
+
+ }
+ }
+
+ public java.lang.Object getFieldValue(_Fields field) {
+ switch (field) {
+ case AUTHZ_TOKEN:
+ return getAuthzToken();
+
+ case USER_NAME:
+ return getUserName();
+
+ }
+ throw new java.lang.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 java.lang.IllegalArgumentException();
+ }
+
+ switch (field) {
+ case AUTHZ_TOKEN:
+ return isSetAuthzToken();
+ case USER_NAME:
+ return isSetUserName();
+ }
+ throw new java.lang.IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(java.lang.Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getAllGroupsUserBelongs_args)
+ return this.equals((getAllGroupsUserBelongs_args)that);
+ return false;
+ }
+
+ public boolean equals(getAllGroupsUserBelongs_args that) {
+ if (that == null)
+ return false;
+ if (this == that)
+ return true;
+
+ 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;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetAuthzToken()) ? 131071 : 524287);
+ if (isSetAuthzToken())
+ hashCode = hashCode * 8191 + authzToken.hashCode();
+
+ hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
+ if (isSetUserName())
+ hashCode = hashCode * 8191 + userName.hashCode();
+
+ return hashCode;
+ }
+
+ @Override
+ public int compareTo(getAllGroupsUserBelongs_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = java.lang.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 = java.lang.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;
+ }
+ }
+ 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 {
+ scheme(iprot).read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ scheme(oprot).write(oprot, this);
+ }
+
+ @Override
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllGroupsUserBelongs_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;
+ 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());
+ }
+ // 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, java.lang.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 getAllGroupsUserBelongs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getAllGroupsUserBelongs_argsStandardScheme getScheme() {
+ return new getAllGroupsUserBelongs_argsStandardScheme();
+ }
+ }
+
+ private static class getAllGroupsUserBelongs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAllGroupsUserBelongs_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getAllGroupsUserBelongs_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;
+ 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, getAllGroupsUserBelongs_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();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getAllGroupsUserBelongs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+ public getAllGroupsUserBelongs_argsTupleScheme getScheme() {
+ return new getAllGroupsUserBelongs_argsTupleScheme();
+ }
+ }
+
+ private static class getAllGroupsUserBelongs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAllGroupsUserBelongs_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ struct.authzToken.write(oprot);
+ oprot.writeString(struct.userName);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getAllGroupsUserBelongs_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.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);
+ }
+ }
+
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+ }
+ }
+
+ public static class getAllGroupsUserBelongs_result implements org.apache.thrift.TBase<getAllGroupsUserBelongs_result, getAllGroupsUserBelongs_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllGroupsUserBelongs_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllGroupsUserBelongs_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.protocol.TField GSE_FIELD_DESC = new org.apache.thrift.protocol.TField("gse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -6987,14 +8137,14 @@ public class GroupManagerService {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list0.size);
- org.apache.airavata.model.group.GroupModel _elem1;
- for (int _i2 = 0; _i2 < _list0.size; ++_i2)
+ org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
+ struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list8.size);
+ org.apache.airavata.model.group.GroupModel _elem9;
+ for (int _i10 = 0; _i10 < _list8.size; ++_i10)
{
- _elem1 = new org.apache.airavata.model.group.GroupModel();
- _elem1.read(iprot);
- struct.success.add(_elem1);
+ _elem9 = new org.apache.airavata.model.group.GroupModel();
+ _elem9.read(iprot);
+ struct.success.add(_elem9);
}
iprot.readListEnd();
}
@@ -7040,9 +8190,9 @@ public class GroupManagerService {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (org.apache.airavata.model.group.GroupModel _iter3 : struct.success)
+ for (org.apache.airavata.model.group.GroupModel _iter11 : struct.success)
{
- _iter3.write(oprot);
+ _iter11.write(oprot);
}
oprot.writeListEnd();
}
@@ -7089,9 +8239,9 @@ public class GroupManagerService {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (org.apache.airavata.model.group.GroupModel _iter4 : struct.success)
+ for (org.apache.airavata.model.group.GroupModel _iter12 : struct.success)
{
- _iter4.write(oprot);
+ _iter12.write(oprot);
}
}
}
@@ -7109,14 +8259,14 @@ public class GroupManagerService {
java.util.BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list5.size);
- org.apache.airavata.model.group.GroupModel _elem6;
- for (int _i7 = 0; _i7 < _list5.size; ++_i7)
+ org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new java.util.ArrayList<org.apache.airavata.model.group.GroupModel>(_list13.size);
+ org.apache.airavata.model.group.GroupModel _elem14;
+ for (int _i15 = 0; _i15 < _list13.size; ++_i15)
{
- _elem6 = new org.apache.airavata.model.group.GroupModel();
- _elem6.read(iprot);
- struct.success.add(_elem6);
+ _elem14 = new org.apache.airavata.model.group.GroupModel();
+ _elem14.read(iprot);
+ struct.success.add(_elem14);
}
}
struct.setSuccessIsSet(true);
@@ -8773,13 +9923,13 @@ public class GroupManagerService {
case 3: // ADMIN_IDS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
- struct.adminIds = new java.util.ArrayList<java.lang.String>(_list8.size);
- java.lang.String _elem9;
- for (int _i10 = 0; _i10 < _list8.size; ++_i10)
+ org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
+ struct.adminIds = new java.util.ArrayList<java.lang.String>(_list16.size);
+ java.lang.String _elem17;
+ for (int _i18 = 0; _i18 < _list16.size; ++_i18)
{
- _elem9 = iprot.readString();
- struct.adminIds.add(_elem9);
+ _elem17 = iprot.readString();
+ struct.adminIds.add(_elem17);
}
iprot.readListEnd();
}
@@ -8817,9 +9967,9 @@ public class GroupManagerService {
oprot.writeFieldBegin(ADMIN_IDS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.adminIds.size()));
- for (java.lang.String _iter11 : struct.adminIds)
+ for (java.lang.String _iter19 : struct.adminIds)
{
- oprot.writeString(_iter11);
+ oprot.writeString(_iter19);
}
oprot.writeListEnd();
}
@@ -8846,9 +9996,9 @@ public class GroupManagerService {
oprot.writeString(struct.groupId);
{
oprot.writeI32(struct.adminIds.size());
- for (java.lang.String _iter12 : struct.adminIds)
+ for (java.lang.String _iter20 : struct.adminIds)
{
- oprot.writeString(_iter12);
+ oprot.writeString(_iter20);
}
}
}
@@ -8862,13 +10012,13 @@ public class GroupManagerService {
struct.groupId = iprot.readString();
struct.setGroupIdIsSet(true);
{
- org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.adminIds = new java.util.ArrayList<java.lang.String>(_list13.size);
- java.lang.String _elem14;
- for (int _i15 = 0; _i15 < _list13.size; ++_i15)
+ org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.adminIds = new java.util.ArrayList<java.lang.String>(_list21.size);
+ java.lang.String _elem22;
+ for (int _i23 = 0; _i23 < _list21.size; ++_i23)
{
- _elem14 = iprot.readString();
- struct.adminIds.add(_elem14);
+ _elem22 = iprot.readString();
+ struct.adminIds.add(_elem22);
}
}
struct.setAdminIdsIsSet(true);
@@ -9954,13 +11104,13 @@ public class GroupManagerService {
case 3: // ADMIN_IDS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
- struct.adminIds = new java.util.ArrayList<java.lang.String>(_list16.size);
- java.lang.String _elem17;
- for (int _i18 = 0; _i18 < _list16.size; ++_i18)
+ org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
+ struct.adminIds = new java.util.ArrayList<java.lang.String>(_list24.size);
+ java.lang.String _elem25;
+ for (int _i26 = 0; _i26 < _list24.size; ++_i26)
{
- _elem17 = iprot.readString();
- struct.adminIds.add(_elem17);
+ _elem25 = iprot.readString();
+ struct.adminIds.add(_elem25);
}
iprot.readListEnd();
}
@@ -9998,9 +11148,9 @@ public class GroupManagerService {
oprot.writeFieldBegin(ADMIN_IDS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.adminIds.size()));
- for (java.lang.String _iter19 : struct.adminIds)
+ for (java.lang.String _iter27 : struct.adminIds)
{
- oprot.writeString(_iter19);
+ oprot.writeString(_iter27);
}
oprot.writeListEnd();
}
@@ -10027,9 +11177,9 @@ public class GroupManagerService {
oprot.writeString(struct.groupId);
{
oprot.writeI32(struct.adminIds.size());
- for (java.lang.String _iter20 : struct.adminIds)
+ for (java.lang.String _iter28 : struct.adminIds)
{
- oprot.writeString(_iter20);
+ oprot.writeString(_iter28);
}
}
}
@@ -10043,13 +11193,13 @@ public class GroupManagerService {
struct.groupId = iprot.readString();
struct.setGroupIdIsSet(true);
{
- org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.adminIds = new java.util.ArrayList<java.lang.String>(_list21.size);
- java.lang.String _elem22;
- for (int _i23 = 0; _i23 < _list21.size; ++_i23)
+ org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.adminIds = new java.util.ArrayList<java.lang.String>(_list29.size);
+ java.lang.String _elem30;
+ for (int _i31 = 0; _i31 < _list29.size; ++_i31)
{
- _elem22 = iprot.readString();
- struct.adminIds.add(_elem22);
+ _elem30 = iprot.readString();
+ struct.adminIds.add(_elem30);
}
}
struct.setAdminIdsIsSet(true);
diff --git a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/exception/GroupManagerServiceException.java b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/exception/GroupManagerServiceException.java
index 9b58818..fca85c8 100644
--- a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/exception/GroupManagerServiceException.java
+++ b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/exception/GroupManagerServiceException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (1.0.0-dev)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -23,7 +23,7 @@
package org.apache.airavata.service.profile.groupmanager.cpi.exception;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class GroupManagerServiceException extends org.apache.thrift.TException implements org.apache.thrift.TBase<GroupManagerServiceException, GroupManagerServiceException._Fields>, java.io.Serializable, Cloneable, Comparable<GroupManagerServiceException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GroupManagerServiceException");
diff --git a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/group_manager_cpiConstants.java b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/group_manager_cpiConstants.java
index 63b69d3..d83fab3 100644
--- a/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/group_manager_cpiConstants.java
+++ b/airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/groupmanager/cpi/group_manager_cpiConstants.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (1.0.0-dev)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
diff --git a/thrift-interface-descriptions/service-cpis/profile-service/group-manager/group-manager-cpi.thrift b/thrift-interface-descriptions/service-cpis/profile-service/group-manager/group-manager-cpi.thrift
index 5455ded..9d2470f 100644
--- a/thrift-interface-descriptions/service-cpis/profile-service/group-manager/group-manager-cpi.thrift
+++ b/thrift-interface-descriptions/service-cpis/profile-service/group-manager/group-manager-cpi.thrift
@@ -53,6 +53,10 @@ service GroupManagerService {
throws (1: group_manager_cpi_errors.GroupManagerServiceException gse,
2: airavata_errors.AuthorizationException ae);
+ list<group_manager_model.GroupModel> getGroups(1: required security_model.AuthzToken authzToken)
+ throws (1: group_manager_cpi_errors.GroupManagerServiceException gse,
+ 2: airavata_errors.AuthorizationException ae);
+
list<group_manager_model.GroupModel> getAllGroupsUserBelongs(1: required security_model.AuthzToken authzToken, 2: required string userName)
throws (1: group_manager_cpi_errors.GroupManagerServiceException gse,
2: airavata_errors.AuthorizationException ae);
--
To stop receiving notification emails like this one, please contact
machristie@apache.org.