use of ee.ria.xroad.common.metadata.ClientListType in project X-Road by nordic-institute.
the class MetadataClientRequestProcessor method handleListClients.
private void handleListClients() throws Exception {
log.trace("handleListClients()");
String instanceIdentifier = getInstanceIdentifierFromRequest();
ClientListType list = OBJECT_FACTORY.createClientListType();
list.getMember().addAll(GlobalConf.getMembers(instanceIdentifier).stream().map(m -> {
ClientType client = OBJECT_FACTORY.createClientType();
client.setId(m.getId());
client.setName(m.getName());
return client;
}).collect(Collectors.toList()));
if (acceptsJson()) {
writeResponseJson(list);
} else {
writeResponseXml(OBJECT_FACTORY.createClientList(list));
}
}
Aggregations