Gets all user info of this web site. Underlying requests are paginated and send on demand with
given size.

@param resultsPerRequest pagination size
@return lazy iterator over all user accounts.
347013
public Iterator<GitkitUser> getAllUsers(final Integer resultsPerRequest) {
    return new DownloadIterator<GitkitUser>() {

      private String nextPageToken = null;

      @Override
      protected Iterator<GitkitUser> getNextResults() {
        try {
          JSONObject response = rpcHelper.downloadAccount(nextPageToken, resultsPerRequest);
          nextPageToken = response.has("nextPageToken")
              ? response.getString("nextPageToken")
              : null;
          if (response.has("users")) {
            return jsonToList(response.getJSONArray("users")).iterator();
          }
        } catch (JSONException e) {
          logger.warning(e.getMessage());
        } catch (GitkitServerException e) {
          logger.warning(e.getMessage());
        } catch (GitkitClientException e) {
          logger.warning(e.getMessage());
        }
        return ImmutableSet.<GitkitUser>of().iterator();
      }
    };
  }
1152389
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/id/{userId}")
    @Description("Returns the user having the given ID.")
    public PrincipalUserDto getUserById(@Context HttpServletRequest req,
        @PathParam("userId") final BigInteger userId) {
        if (userId == null || userId.compareTo(BigInteger.ZERO) < 1) {
            throw new WebApplicationException("User Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
        }

        PrincipalUser remoteUser = validateAndGetOwner(req, null);
        PrincipalUser user = _uService.findUserByPrimaryKey(userId);

        if (user != null) {
            super.validateResourceAuthorization(req, user, remoteUser);
            return PrincipalUserDto.transformToDto(user);
        }
        throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
    }
632175
@GET
  @Path("search")
  @RolesAllowed({"ROLE_ADMIN"})
  public Response search(@QueryParam("email") String email,
                         @QueryParam("username") String username,
                         @QueryParam("pageSize") @DefaultValue("10") int pageSize,
                         @QueryParam("cursorKey") String cursorKey) {

    final CursorPage<DUser> page;
    if (null != email) {
      page = userService.findMatchingUsersByEmail(email, pageSize, cursorKey);
    } else if (null != username) {
      page = userService.findMatchingUsersByUserName(username, pageSize, cursorKey);
    } else {
      throw new BadRequestRestException("No search key provided");
    }

    return Response.ok(page).build();
  }
404314
public java.util.List<ResultAttribute> getResultAttributes() {
        if (resultAttributes == null) {
            resultAttributes = new com.amazonaws.internal.SdkInternalList<ResultAttribute>();
        }
        return resultAttributes;
    }
535216
public Collection<User> list(List<String> queryParams)
    {
        return HTTP.GET("/v2/users.json", null, queryParams, USERS).get();
    }
68687
private Map getUsers() throws NamingException {

        String filter = "(" + roleNameRDN + "=*)";

        HashMap users = new HashMap();

        NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
        while (results != null && results.hasMore()) {

            SearchResult roleResult = (SearchResult) results.next();

            String roleResultName = roleResult.getName();
            if ("".equals(roleResultName)) {
                continue;
            }

            String roleResultValue = (roleResultName.split("="))[1];

            Attributes roleAttrs = roleResult.getAttributes();

            Attribute roleAttr = roleAttrs.get(roleMemberRDN);
            NamingEnumeration valueEnum = roleAttr.getAll();
            while (valueEnum != null && valueEnum.hasMore()) {
                String value = (String) valueEnum.next();

                String name;
                if (value.endsWith("," + userBase)) {
                    name = value.substring(0, value.length() - userBase.length() - 1);
                    name = name.split("=")[1];
                } else {
                    log.debug("found unrecognized DN: " + value);
                    continue;
                }

                if (users.containsKey(name)) {
                    HashSet roles = (HashSet) users.get(name);
                    roles.add(roleResultValue);
                } else {
                    HashSet roles = new HashSet();
                    roles.add(roleResultValue);
                    users.put(name, roles);
                }
            }
        }
        return users;

    }
704387
@Override
    public Object getUserMetaData() {
        if (serializedUserMetaData != null) {
            try {
                userMetaData = SerializationUtility.deserialize(serializedUserMetaData, cacheName);
            } catch (Exception ex) {
                com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.CacheEntry.getUserMetaData", "600", this);
            }
            serializedUserMetaData = null;
        }
        return userMetaData;
    }
492989
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/userinfo")
    @Description("Returns the user info of the user who is logged in.")
    public PrincipalUserDto userInfo(@Context HttpServletRequest req) {
        String userName=findUserByToken(req);
        PrincipalUser user = _uService.findUserByUsername(userName);
        return PrincipalUserDto.transformToDto(user);
    }
1086984
@GET
  @Path("/db/{authorizerName}/users/{userName}")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response getUser(
      @Context HttpServletRequest req,
      @PathParam("authorizerName") final String authorizerName,
      @PathParam("userName") final String userName,
      @QueryParam("full") String full
  )
  {
    return resourceHandler.getUser(authorizerName, userName, full != null);
  }
290176
@Override
    @JsonIgnore
    public Set<String> getAvailableQueryAttributes(final IPersonAttributeDaoFilter filter) {
        final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider();
        return Collections.singleton(usernameAttributeProvider.getUsernameAttribute());
    }
1043379
public PaginatedList<User> listFromCurrentCompany(Integer page, Integer pageSize) {

		if (page == null || page < 1) {
			page = 1;
		}
		if (pageSize == null) {
			pageSize = PAGESIZE;
		}
		PaginatedList<User> results = new PaginatedList<User>();
		if (this.domain == null) {
			Criteria criteria = this.dao.newCriteria(User.class).setFirstResult((page - 1) * pageSize)
					.setMaxResults(pageSize).addOrder(Order.asc("name"));
			Criteria counting = this.dao.newCriteria(User.class).setProjection(Projections.countDistinct("id"));
			results.setList(this.dao.findByCriteria(criteria, User.class));
			results.setTotal((Long) counting.uniqueResult());

		} else {
			Criteria criteria = this.dao.newCriteria(CompanyUser.class).setFirstResult((page - 1) * pageSize)
					.setMaxResults(pageSize).add(Restrictions.eq("company", this.domain.getCompany()))
					.createAlias("user", "user", JoinType.INNER_JOIN).addOrder(Order.asc("user.name"));
			Criteria counting = this.dao.newCriteria(CompanyUser.class)
					.add(Restrictions.eq("company", this.domain.getCompany()))
					.createAlias("user", "user", JoinType.INNER_JOIN)
					.setProjection(Projections.countDistinct("user.id"));
			List<CompanyUser> companyUsers = this.dao.findByCriteria(criteria, CompanyUser.class);
			ArrayList<User> users = new ArrayList<User>(companyUsers.size());
			for (CompanyUser companyUser : companyUsers) {
				User user = companyUser.getUser();
				user.setAccessLevel(Math.max(user.getAccessLevel(), companyUser.getAccessLevel()));
				users.add(user);
			}
			results.setList(users);
			results.setTotal((Long) counting.uniqueResult());
		}
		return results;
	}
458729
public Pager<User> getUsers(int itemsPerPage) throws GitLabApiException {
        return (new Pager<User>(this, User.class, itemsPerPage, createGitLabApiForm().asMap(), "users"));
    }
314121
public Iterator<QueryParameters> iterator() {
        final QueryParametersLazyList source = this;

        return new Iterator<QueryParameters>() {
            private LazyCacheIterator<QueryParameters> lazyCacheIterator = source.getLazyCacheIterator(-1);

            public boolean hasNext() {
                return lazyCacheIterator.hasNext();
            }

            public QueryParameters next() {
                return lazyCacheIterator.getNext();
            }

            public void remove() {
                source.remove(currentIndex);
            }
        };
    }
273958
public static String getUserFromRequest(HttpServletRequest httpRequest) {
        String user = httpRequest.getRemoteUser();
        if (!StringUtils.isEmpty(user)) {
            return user;
        }

        user = httpRequest.getParameter("user.name"); // available in query-param
        if (!StringUtils.isEmpty(user)) {
            return user;
        }

        user = httpRequest.getHeader("Remote-User"); // backwards-compatibility
        if (!StringUtils.isEmpty(user)) {
            return user;
        }

        user = getDoAsUser(httpRequest);
        if (!StringUtils.isEmpty(user)) {
            return user;
        }

        return null;
    }
455496
public GetUserInfoListResponse getUserInfoList(List<UserInfo> userInfoList){
        String url = BASE_API_URL + "cgi-bin/user/info/batchget?access_token=#";
        Map<String, List<UserInfo>> param = new HashMap<String, List<UserInfo>>();
        param.put("user_list", userInfoList);
        BaseResponse r=executePost(url, JSONUtil.toJson(param));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        GetUserInfoListResponse getUserInfoListResponse=JSONUtil.toBean(resultJson,GetUserInfoListResponse.class);
        return getUserInfoListResponse;
    }
225739
public java.util.List<UserDetail> getUserDetailList() {
        if (userDetailList == null) {
            userDetailList = new com.amazonaws.internal.SdkInternalList<UserDetail>();
        }
        return userDetailList;
    }
462999
public long getWebPageAndChildrenLastModified(WebSiteRequest req) throws IOException, SQLException {
		WebPage[] myPages = getCachedPages(req);
		int len = myPages.length;
		long mostRecent = getClassLastModified();
		if(mostRecent==-1) return -1;
		for (int c = 0; c < len; c++) {
			long time = myPages[c].getLastModified(req);
			if(time==-1) return -1;
			if (time > mostRecent) mostRecent = time;
		}
		return mostRecent;
	}