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

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

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

    Set<UserResponse> responses = getResources(new Command<Set<UserResponse>>() {
      @Override
      public Set<UserResponse> invoke() throws AmbariException, AuthorizationException {
        return getUsers(requests);
      }
    });

    if (LOG.isDebugEnabled()) {
      LOG.debug("Found user responses matching get user request, userRequestSize={}, userResponseSize={}", requests.size(), responses.size());
    }

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

    for (UserResponse userResponse : responses) {
      ResourceImpl resource = new ResourceImpl(Resource.Type.User);

      setResourceProperty(resource, USER_USERNAME_PROPERTY_ID,
          userResponse.getUsername(), requestedIds);

      setResourceProperty(resource, USER_DISPLAY_NAME_PROPERTY_ID,
          userResponse.getDisplayName(), requestedIds);

      setResourceProperty(resource, USER_LOCAL_USERNAME_PROPERTY_ID,
          userResponse.getLocalUsername(), requestedIds);

      // This is deprecated but here for backwards compatibility
      setResourceProperty(resource, USER_LDAP_USER_PROPERTY_ID,
          userResponse.isLdapUser(), requestedIds);

      // This is deprecated but here for backwards compatibility
      setResourceProperty(resource, USER_USER_TYPE_PROPERTY_ID,
          userResponse.getAuthenticationType(), requestedIds);

      setResourceProperty(resource, USER_ACTIVE_PROPERTY_ID,
          userResponse.isActive(), requestedIds);

      setResourceProperty(resource, USER_GROUPS_PROPERTY_ID,
          userResponse.getGroups(), requestedIds);

      setResourceProperty(resource, USER_ADMIN_PROPERTY_ID,
          userResponse.isAdmin(), requestedIds);

      setResourceProperty(resource, USER_CONSECUTIVE_FAILURES_PROPERTY_ID,
          userResponse.getConsecutiveFailures(), requestedIds);

      setResourceProperty(resource, USER_CREATE_TIME_PROPERTY_ID,
          userResponse.getCreateTime(), requestedIds);

      resources.add(resource);
    }

    return resources;
  }
Create a new resource provider for the given management controller.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java