use of com.cloudera.thunderhead.service.usermanagement.UserManagementGrpc.UserManagementBlockingStub in project cloudbreak by hortonworks.
the class UmsClient method listResourceRoles.
public Set<String> listResourceRoles(String requestId, String accountId) {
UserManagementBlockingStub stub = newStub(requestId);
UserManagementProto.ListResourceRolesRequest.Builder requestBuilder = UserManagementProto.ListResourceRolesRequest.newBuilder().setAccountId(accountId);
UserManagementProto.ListResourceRolesResponse response;
Set<String> resourceRoles = Sets.newHashSet();
do {
response = stub.listResourceRoles(requestBuilder.build());
resourceRoles.addAll(response.getResourceRoleList().stream().map(UserManagementProto.ResourceRole::getCrn).collect(Collectors.toSet()));
requestBuilder.setPageToken(response.getNextPageToken());
} while (response.hasNextPageToken());
return resourceRoles;
}
use of com.cloudera.thunderhead.service.usermanagement.UserManagementGrpc.UserManagementBlockingStub in project cloudbreak by hortonworks.
the class UmsClient method listRoles.
public Set<String> listRoles(String requestId, String accountId) {
UserManagementBlockingStub stub = newStub(requestId);
UserManagementProto.ListRolesRequest.Builder requestBuilder = UserManagementProto.ListRolesRequest.newBuilder().setAccountId(accountId);
UserManagementProto.ListRolesResponse response;
Set<String> roles = Sets.newHashSet();
do {
response = stub.listRoles(requestBuilder.build());
roles.addAll(response.getRoleList().stream().map(UserManagementProto.Role::getCrn).collect(Collectors.toSet()));
requestBuilder.setPageToken(response.getNextPageToken());
} while (response.hasNextPageToken());
return roles;
}
Aggregations