Page 1 of 1

List of all headless clients

PostPosted: Tue Mar 08, 2022 4:12 pm
by steve1376656734
Hi,

Does anyone know of a way to get a list of all the headless clients? I have looked at plugins.headlessclient and plugins.clientmanager but neither of them seem to have a method to allow this.

Thanks
Steve

Re: List of all headless clients

PostPosted: Wed Mar 09, 2022 2:19 am
by robert.edelmann
I didn't find a way to just get the headless clients, but we create usage-logs like this:

Code: Select all
var listClients = plugins.clientmanager.getConnectedClients();
for (var indClients = 0; indClients < listClients.length; indClients++) {
    var clientInfo = listClients[indClients];
    if (clientInfo.getApplicationType() == APPLICATION_TYPES.HEADLESS_CLIENT) {
        headlessClientsAll++
        continue;
    }
    var clientUserOrgID = clientInfo.getUserUID();
    if (!clientUserOrgID) {
        continue;
    }
......
}


We just count the headless-clients and don't do much more, but you could probably get more infos from the clienInfo-Object, like the name with clientInfo.getOpenSolutionName().

Re: List of all headless clients

PostPosted: Wed Mar 09, 2022 1:31 pm
by steve1376656734
Thanks Robert - was looking for a method specifically for headless clients and never considered just iterating all the connected clients.