Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 21DFF200D4E for ; Thu, 7 Dec 2017 11:54:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 20498160C0C; Thu, 7 Dec 2017 10:54:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 66A20160BFE for ; Thu, 7 Dec 2017 11:54:04 +0100 (CET) Received: (qmail 63998 invoked by uid 500); 7 Dec 2017 10:54:03 -0000 Mailing-List: contact dev-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list dev@syncope.apache.org Received: (qmail 63987 invoked by uid 99); 7 Dec 2017 10:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2017 10:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AC44D1A03A1 for ; Thu, 7 Dec 2017 10:54:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 2xDwLzpEiV_K for ; Thu, 7 Dec 2017 10:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 255EF5F470 for ; Thu, 7 Dec 2017 10:54:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 67638E0D7D for ; Thu, 7 Dec 2017 10:54:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 24C15255C9 for ; Thu, 7 Dec 2017 10:54:00 +0000 (UTC) Date: Thu, 7 Dec 2017 10:54:00 +0000 (UTC) From: =?utf-8?Q?Francesco_Chicchiricc=C3=B2_=28JIRA=29?= To: dev@syncope.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SYNCOPE-1243) Add information to GroupTO about user and AnyObject membership counts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 07 Dec 2017 10:54:05 -0000 [ https://issues.apache.org/jira/browse/SYNCOPE-1243?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 281682#comment-16281682 ]=20 Francesco Chicchiricc=C3=B2 commented on SYNCOPE-1243: ------------------------------------------------- Also, I would leverage some {{COUNT}} for replacing this: {code} + for (AMembership membership : groupDAO.findAMemberships(group)) { + String key =3D membership.getLeftEnd().getType().getKey(); + if (groupTO.getStaticAnyObjectMembershipCount().containsKey(ke= y)) { + int oldCount =3D groupTO.getStaticAnyObjectMembershipCount= ().get(key); + groupTO.getStaticAnyObjectMembershipCount().put(key, ++old= Count); + } else { + groupTO.getStaticAnyObjectMembershipCount().put(key, 1); + } + } {code} in order to avoid cycling on a (possibly huge) number of memberships. > Add information to GroupTO about user and AnyObject membership counts > --------------------------------------------------------------------- > > Key: SYNCOPE-1243 > URL: https://issues.apache.org/jira/browse/SYNCOPE-1243 > Project: Syncope > Issue Type: Improvement > Reporter: Colm O hEigeartaigh > Assignee: Colm O hEigeartaigh > Priority: Minor > Fix For: 2.0.7, 2.1.0 > > Attachments: SYNCOPE-1243.patch, SYNCOPE-1243.patch.2 > > > If we want to find out how many users or AnyObjects are members of a give= n group, it's not possible to figure out via the group itself. Instead we n= eed to run a fiql on the users or Any Objects. > This task is to add the following fields to GroupTO so that we can get th= is information more easily: > - int staticUserMembershipCount > - int dynamicUserMembershipCount > - Map staticAnyObjectMembershipCount > - Map dynamicAnyObjectMembershipCount -- This message was sent by Atlassian JIRA (v6.4.14#64029)