获取在线用户的详细连接信息 <br>
Map.key 为 SNCP节点地址, 含值为null的key表示没有分布式
Map.value 为 用户客户端的IP

@param userid Serializable

@return 地址集合
9391
public CompletableFuture<Map<InetSocketAddress, List<String>>> getRpcNodeWebSocketAddresses(final Serializable userid) {
        CompletableFuture<Collection<InetSocketAddress>> sncpFuture = getRpcNodeAddresses(userid);
        return sncpFuture.thenCompose((Collection<InetSocketAddress> addrs) -> {
            if (logger.isLoggable(Level.FINEST)) logger.finest("websocket found userid:" + userid + " on " + addrs);
            if (addrs == null || addrs.isEmpty()) return CompletableFuture.completedFuture(new HashMap<>());
            CompletableFuture<Map<InetSocketAddress, List<String>>> future = null;
            for (final InetSocketAddress nodeAddress : addrs) {
                CompletableFuture<Map<InetSocketAddress, List<String>>> mapFuture = getWebSocketAddresses(nodeAddress, userid)
                    .thenCompose((List<String> list) -> CompletableFuture.completedFuture(Utility.ofMap(nodeAddress, list)));
                future = future == null ? mapFuture : future.thenCombine(mapFuture, (a, b) -> Utility.merge(a, b));
            }
            return future == null ? CompletableFuture.completedFuture(new HashMap<>()) : future;
        });
    }
568856
public BoxRequestsUser.DeleteEnterpriseUser getDeleteEnterpriseUserRequest(String userId) {
        BoxRequestsUser.DeleteEnterpriseUser request = new BoxRequestsUser.DeleteEnterpriseUser(getUserInformationUrl(userId), mSession, userId);
        return request;
    }
389181
@RequestMapping(value = "/{userId}/userGroups", method = RequestMethod.GET)
    public ResponseEntity<Set<UserGroup>> findGroupsOfUser(@PathVariable Integer userId) {

        try {
            Set<UserGroup> userGroupsSet = this.service.getGroupsOfUser(userId);
            return new ResponseEntity<Set<UserGroup>>(userGroupsSet, HttpStatus.OK);
        } catch (Exception e) {
            LOG.error("Error finding user with id " + userId + ": "
                + e.getMessage());
            return new ResponseEntity<Set<UserGroup>>(HttpStatus.NOT_FOUND);
        }
    }
1304773
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> T getUserById(int id) {
	    User sfsUser = getZone().getUserById(id);
	    if(sfsUser != null && sfsUser.containsProperty(APIKey.USER))
	        return (T) sfsUser.getProperty(APIKey.USER);
	    return null;
	}
17988
public String getGlobusID(String userID) {
        if (userID == null) {
            throw new IllegalArgumentException(i18n.getMessage("userIdNull"));
        }

        if (this.map == null) {
            return null;
        }

        Iterator iter = this.map.entrySet().iterator();
        Map.Entry mapEntry;
        GridMapEntry entry;
        while(iter.hasNext()) {
            mapEntry = (Map.Entry)iter.next();
            entry = (GridMapEntry)mapEntry.getValue();
            if (entry.containsUserID(userID)) {
                return entry.getGlobusID();
            }
        }
        return null;
    }
469898
public static Function<RequestEnvelope, String> userId() {
        return r -> Optional.ofNullable(r).map(RequestEnvelope::getContext)
                .map(Context::getSystem)
                .map(SystemState::getUser)
                .map(User::getUserId)
                .orElseThrow(() -> new PersistenceException("Could not retrieve user ID from request envelope to generate persistence ID"));
    }
1047466
public static Credentials getUserById(DAO serverDao, String userId) throws DAO.DAOException {
        Query query = new QueryBuilder()
                .select()
                .from(Credentials.class)
                .where(Credentials.OWNER_ID_KEY,OPERAND.EQ,userId)
                .build();

        TransientObject to = (TransientObject) ObjectUtils.get1stOrNull(serverDao.query(query));
        if(to==null){
            return null;
        } else {
            return to(Credentials.class,to);
        }
    }
1030216
public GetListOfUsersPlaylistsRequest.Builder getListOfUsersPlaylists(String user_id) {
    return new GetListOfUsersPlaylistsRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .user_id(user_id);
  }
1154978
@Override
    public CompletableFuture<Void> changeUserid(Serializable olduserid, Serializable newuserid, InetSocketAddress sncpAddr) {
        tryAcquireSemaphore();
        CompletableFuture<Void> future = sncpNodeAddresses.appendSetItemAsync(SOURCE_SNCP_USERID_PREFIX + newuserid, InetSocketAddress.class, sncpAddr);
        future = future.thenAccept((a) -> sncpNodeAddresses.removeSetItemAsync(SOURCE_SNCP_USERID_PREFIX + olduserid, InetSocketAddress.class, sncpAddr));
        if (semaphore != null) future.whenComplete((r, e) -> releaseSemaphore());
        if (logger.isLoggable(Level.FINEST)) logger.finest(WebSocketNodeService.class.getSimpleName() + ".event: " + olduserid + " changeUserid to " + newuserid + " from " + sncpAddr);
        return future;
    }
840817
public HashIntMap<User> loadUsersFromId (int[] userIds)
        throws PersistenceException
    {
        HashIntMap<User> data = new HashIntMap<User>();
        if (userIds.length > 0) {
            String query = "where userId in (" + genIdString(userIds) + ")";
            for (User user : loadAll(_utable, query)) {
                user.setDirtyMask(_utable.getFieldMask());
                data.put(user.userId, user);
            }
        }
        return data;
    }
979257
public Map<String, Object> getUser() {
        Map<String, Object> userFields = DDPStateSingleton.getInstance()
                .getDocument("users", getUserId());
        if (userFields != null) {
            return userFields;
        }
        return null;
    }
897847
public Request<UserBlocks> get(String userId) {
        Asserts.assertNotNull(userId, "user id");

        String url = baseUrl
                .newBuilder()
                .addPathSegments("api/v2/user-blocks")
                .addPathSegment(userId)
                .build()
                .toString();
        CustomRequest<UserBlocks> request = new CustomRequest<>(client, url, "GET", new TypeReference<UserBlocks>() {
        });
        request.addHeader("Authorization", "Bearer " + apiToken);
        return request;
    }
1187560
public GetQYUserInviteResponse invite(String userid){
        BeanUtil.requireNonNull(userid, "userid is null");
        GetQYUserInviteResponse response;
        String url = BASE_API_URL + "cgi-bin/invite/send?access_token=#";
        final Map<String, String> params = new HashMap<String, String>();
        params.put("userid", userid);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, GetQYUserInviteResponse.class);
        return response;
    }
330823
public String[] getAllGlobusID(String userID) {
        if (userID == null) {
            throw new IllegalArgumentException(i18n.getMessage("userIdNull"));
        }

        if (this.map == null) {
            return null;
        }

        Vector v = new Vector();

        Iterator iter = this.map.entrySet().iterator();
        Map.Entry mapEntry;
        GridMapEntry entry;
        while(iter.hasNext()) {
            mapEntry = (Map.Entry)iter.next();
            entry = (GridMapEntry)mapEntry.getValue();
            if (entry.containsUserID(userID)) {
                v.add(entry.getGlobusID());
           }
        }

        // create array of strings and add values back in
        if(v.size() == 0) {
            return null;
        }

        String idS[] = new String[v.size()];
        for(int ctr = 0; ctr < v.size(); ctr++) {
            idS[ctr] = (String) v.elementAt(ctr);
        }

        return idS;
    }
926291
public static Map<String, String> instanceIPGroupingKey() throws UnknownHostException {
    Map<String, String> groupingKey = new HashMap<String, String>();
    groupingKey.put("instance", InetAddress.getLocalHost().getHostAddress());
    return groupingKey;
  }
40958
public void setUserId(String userId) {
        if (userId == null) {
            _properties.remove(AMQP_PROP_USER_ID);
            return;
        }
        
        _properties.put(AMQP_PROP_USER_ID, userId);
    }
939500
public Iterable<DConnection> queryByProviderUserId(java.lang.String providerUserId) {
    return queryByField(null, DConnectionMapper.Field.PROVIDERUSERID.getFieldName(), providerUserId);
  }