Search in sources :

Example 1 with ClientListType

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));
    }
}
Also used : ClientType(ee.ria.xroad.common.metadata.ClientType) ClientListType(ee.ria.xroad.common.metadata.ClientListType)

Aggregations

ClientListType (ee.ria.xroad.common.metadata.ClientListType)1 ClientType (ee.ria.xroad.common.metadata.ClientType)1