You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by "Francesco Chicchiriccò (JIRA)" <ji...@apache.org> on 2017/12/04 08:10:00 UTC

[jira] [Commented] (SYNCOPE-1243) Add information to GroupTO about user and AnyObject membership counts

    [ https://issues.apache.org/jira/browse/SYNCOPE-1243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16276428#comment-16276428 ] 

Francesco Chicchiriccò commented on SYNCOPE-1243:
-------------------------------------------------

Hi Colm, thanks for your patch.

I would replace, in {{GroupDAO}} and related:

{code}
List<String> findADynMembers(Group group, String key);
{code}

with

{code}
int countADynMembers(Group group);
int countUDynMembers(Group group);
{code}

Also, is there any way to simplify this:

{code}
+        Map<String, List<AMembership>> memberships =
+            groupDAO.findAMemberships(group).stream().collect(
+                Collectors.groupingBy(m -> m.getLeftEnd().getType().getKey()));
+        for (Map.Entry<String, List<AMembership>> membership : memberships.entrySet()) {
+            groupTO.getStaticAnyObjectMembershipCount().put(membership.getKey(),  membership.getValue().size());
+        }
{code}

?
Thanks.

> 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
>
>
> If we want to find out how many users or AnyObjects are members of a given group, it's not possible to figure out via the group itself. Instead we need 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 this information more easily:
>   - int staticUserMembershipCount
>   - int dynamicUserMembershipCount
>   - Map<String, Integer> staticAnyObjectMembershipCount
>   - Map<String, Integer> dynamicAnyObjectMembershipCount



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)