Get user's whole chat room information

@param username required
@return {@link ChatRoomListResult}
@throws APIConnectionException connect exception
@throws APIRequestException    request exception
540634
public ChatRoomListResult getUserChatRoomInfo(String username) throws APIConnectionException, APIRequestException {
        StringUtils.checkUsername(username);
        ResponseWrapper responseWrapper = _httpClient.sendGet(_baseUrl + mUserPath + "/" + username + "/chatroom");
        return ChatRoomListResult.fromResponse(responseWrapper);
    }
1202058
public UserGroupsEntity getUserGroups(String username) {
		return restClient.get("users/" + username + "/groups", UserGroupsEntity.class,
				new HashMap<String, String>());
	}
517118
@Override
    public Integer getPortalUserId(String userName) {
        final List<Integer> results =
                this.jdbcOperations.queryForList(
                        "SELECT USER_ID FROM UP_USER WHERE USER_NAME=?", Integer.class, userName);
        return DataAccessUtils.singleResult(results);
    }
164712
public void checkUserName(String userName) throws CmsIllegalArgumentException {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(Messages.ERR_BAD_USERNAME_EMPTY_0, userName));
        }

        CmsStringUtil.checkName(userName, USERNAME_CONSTRAINTS, Messages.ERR_BAD_USERNAME_4, Messages.get());
    }
1112024
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiRoom> T getRoomByName(String name) {
	    Room sfsRoom = getZone().getRoomByName(name);
	    if(sfsRoom != null && sfsRoom.containsProperty(APIKey.ROOM))
	        return (T) sfsRoom.getProperty(APIKey.ROOM);
	    return null;
	}
618406
public Connection getConnection(String username, String password)
            throws SQLException {
        throw new SQLException(Resources.getMessage("NOT_SUPPORTED"));
    }
176379
public HttpURLConnection connectService(HttpServerParam httpServerParam, String userPassword) throws Exception {
		HttpURLConnection httpURLConnection = null;
		URL url = null;
		try {

			url = new URL("http", httpServerParam.getHost(), httpServerParam.getPort(), httpServerParam.getServletPath());

			Debug.logVerbose("[JdonFramework]Service url=" + url, module);

			httpURLConnection = (HttpURLConnection) url.openConnection();
			httpURLConnection.setRequestMethod("POST");
			httpURLConnection.setDoOutput(true);
			httpURLConnection.setDoInput(true);
			httpURLConnection.setUseCaches(false);
			httpURLConnection.setRequestProperty("Content-Type", "application/x-java-serialized-object");

			if ((userPassword != null) && (!userPassword.equals("null"))) {
				String encoded = "Basic " + Base64.encodeBytes(userPassword.getBytes("UTF-8"));
				httpURLConnection.setRequestProperty("Authorization", encoded);
			}
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] connectServer " + url + " error: " + ex, module);
			throw new Exception(ex);
		}
		return httpURLConnection;
	}
428673
protected User getUser(String username) {
    Integer id = userIds().get(username.toLowerCase());
    if (id == null) {
      throw new IllegalStateException(format("Could not find ID corresponding to username [%s]", username));
    }

    return getUser(id);
  }
1159862
public ChatRoomListResult getAppChatRoomInfo(int start, int count)
            throws APIConnectionException, APIRequestException {
        return _chatRoomClient.getAppChatRoomInfo(start, count);
    }
169899
public UserListResult getUserList(int start, int count)
            throws APIConnectionException, APIRequestException {

        if (start < 0 || count <= 0 || count > 500) {
            throw new IllegalArgumentException("negative index or count must more than 0 and less than 501");
        }
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + userPath + "?start=" + start + "&count=" + count);
        return UserListResult.fromResponse(response, UserListResult.class);

    }
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;

    }
1112836
public static String getUser(String userName, UserGroupInformation ugi) {
        if (StringUtils.isNotEmpty(userName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Returning userName {}", userName);
            }
            return userName;
        }

        if (ugi != null && StringUtils.isNotEmpty(ugi.getShortUserName())) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Returning ugi.getShortUserName {}", userName);
            }
            return ugi.getShortUserName();
        }

        try {
            return UserGroupInformation.getCurrentUser().getShortUserName();
        } catch (IOException e) {
            LOG.warn("Failed for UserGroupInformation.getCurrentUser() ", e);
            return System.getProperty("user.name");
        }
    }
881436
public Response deleteChatRoom(String roomName) {
		return restClient.delete("chatrooms/" + roomName, new HashMap<String, String>());
	}
297052
public boolean hasUser(String userName) {
        boolean result = false;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = true;
            }
        }
        return result;
    }
668067
public ResponseWrapper addFriends(String username, String...users)
            throws APIConnectionException, APIRequestException {
        return _userClient.addFriends(username, users);
    }
1271176
@SuppressWarnings("unchecked")
    public LdapUser getLdapUser(final String username) {
        final Query query = pm.newQuery(LdapUser.class, "username == :username");
        final List<LdapUser> result = (List<LdapUser>) query.execute(username);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
1346371
public User getUser(String userName) {
        User result = null;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = item;
            }
        }
        return result;
    }