use of cz.metacentrum.perun.openapi.model.RichUser in project perun by CESNET.
the class GetRichUser method executeCommand.
@Override
public void executeCommand(PerunCLI.CommandContext ctx) {
int id = Integer.parseInt(ctx.getCommandLine().getOptionValue("id"));
RichUser richUser = ctx.getPerunRPC().getUsersManager().getRichUserWithAttributes(id);
System.out.println(" id: " + richUser.getId());
System.out.println("titleBefore: " + richUser.getTitleBefore());
System.out.println(" firstName: " + richUser.getFirstName());
System.out.println(" middleName: " + richUser.getMiddleName());
System.out.println(" lastName: " + richUser.getLastName());
System.out.println(" titleAfter: " + richUser.getTitleAfter());
System.out.println(" createdAt: " + richUser.getCreatedAt());
System.out.println(" createdBy: " + richUser.getCreatedBy());
System.out.println(" modifiedAt: " + richUser.getModifiedAt());
System.out.println(" modifiedBy: " + richUser.getModifiedBy());
System.out.println();
System.out.println(" UserExtSources:");
System.out.println();
List<UserExtSource> userExtSources = richUser.getUserExtSources();
userExtSources.sort(Comparator.comparing(UserExtSource::getLastAccess));
for (UserExtSource ues : userExtSources) {
System.out.println("(" + ues.getLastAccess() + ") " + ues.getLogin() + " " + ues.getExtSource().getName());
}
System.out.println();
System.out.println(" user attributes:");
System.out.println();
List<Attribute> userAttributes = richUser.getUserAttributes();
for (Attribute a : userAttributes) {
System.out.println("attribute " + a.getNamespace() + ":" + a.getFriendlyName() + " = " + a.getValue());
}
}
Aggregations