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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.