use of cz.metacentrum.perun.openapi.model.User in project perun by CESNET.
the class ListOfVoMembersWithCertificate method executeCommand.
@Override
public void executeCommand(PerunCLI.CommandContext ctx) {
Integer voId = this.getVoId(ctx, true);
AttributesManagerApi attributesManager = ctx.getPerunRPC().getAttributesManager();
int prefDNid = attributesManager.getAttributeDefinitionByName("urn:perun:user:attribute-def:def:userPreferredCertDN").getId();
for (Member member : ctx.getPerunRPC().getMembersManager().getMembers(voId, null)) {
String pdn = (String) attributesManager.getUserAttributeById(member.getUserId(), prefDNid).getValue();
if (pdn != null) {
User user = ctx.getPerunRPC().getUsersManager().getUserById(member.getUserId());
System.out.println(user.getFirstName() + " " + user.getLastName() + " (" + member.getStatus() + ") " + pdn);
}
}
}
Aggregations