No finder method available for users with criteria group and membershiptype

Solution Unverified - Updated -

Issue

  • We want to find the collection of users within a specific group with an specific memebershiptype. Currently we use the following code to find the first user:
OrganizationService os=(OrganizationService) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType( OrganizationService.class);
Collection<Membership> results =os.getMembershipHandler().findMembershipsByGroup(currectGroup);
for (final Membership msi : results) {
   if (MAIN_USER.equals(msi.getMembershipType())) {
      userName = membership.getUserName();
      break;
   }
}

We expect performance problems with this approach, hence we rather want to do something like this:

Collection<User> results =os.getUserHandler().findUsersByGroupAndMembershiptype(currectGroup, MAIN_USER); // where MAIN_USER is the memebershiptype we are looking for in the given group

Environment

  • JBoss Enterprise Portal Platform (EPP) 5.2.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content