On 19/07/2016 16:41, Colm O hEigeartaigh wrote:
Thanks Francesco. Unless I'm mistaken though, you're calling "getTotalCount" on the total list of users that is returned (PagedResult<UserTO> )? What if you wanted to just find out the total count of users, without having to actually download all the user attributes etc. (so if you have a very large number of users).

As you can see I am asking for page 1 / size 1, so actually only the very first user is returned.
Regards.


On Fri, Jul 15, 2016 at 3:12 PM, Francesco Chicchiriccò <[email protected] <mailto:[email protected]>> wrote:

    On 14/07/2016 18:51, Francesco Chicchiriccò wrote:

        Il 14 luglio 2016 18:48:30 CEST, Colm O hEigeartaigh
        <[email protected] <mailto:[email protected]>> ha scritto:

            Hi,

            Is it possible to obtain a count of the total users in
            Syncope 2.0.0?
            Previously you could do GET /users/count, but it doesn't
            seem to be
            working
            in Syncope 2.0.0 unless I'm mistaken.

        Hi,
        look at UserITCase and SearchITCase (can't access the source
        code right now).


    It's something like as

    syncopeClient.getService(UserService.class).
                    search(new
    AnyQuery.Builder().realm(realm).page(1).size(1).build()).
                    getTotalCount()

    HTH

    Regards.

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC,
CXF Committer, OpenJPA Committer, PonyMail PPMC
http://home.apache.org/~ilgrosso/

Reply via email to