@Override
  protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {

    final Set<GroupRequest> requests = new HashSet<>();

    if (predicate == null) {
      requests.add(getRequest(null));
    } else {
      for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
        requests.add(getRequest(propertyMap));
      }
    }

    Set<GroupResponse> responses = getResources(new Command<Set<GroupResponse>>() {
      @Override
      public Set<GroupResponse> invoke() throws AmbariException {
        return getManagementController().getGroups(requests);
      }
    });

    LOG.debug("Found group responses matching get group request, groupRequestSize={}, groupResponseSize={}", requests.size(), responses.size());

    Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
    Set<Resource> resources    = new HashSet<>();

    for (GroupResponse groupResponse : responses) {
      ResourceImpl resource = new ResourceImpl(Resource.Type.Group);

      setResourceProperty(resource, GROUP_GROUPNAME_PROPERTY_ID,
          groupResponse.getGroupName(), requestedIds);

      setResourceProperty(resource, GROUP_LDAP_GROUP_PROPERTY_ID,
          groupResponse.isLdapGroup(), requestedIds);

      setResourceProperty(resource, GROUP_GROUPTYPE_PROPERTY_ID,
          groupResponse.getGroupType(), requestedIds);

      resources.add(resource);
    }

    return resources;
  }
Create a new resource provider for the given management controller.

@param managementController  the management controller
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java