EasemobIMUsers { public static ObjectNode getIMUsersByPrimaryKey(String userPrimaryKey) { ObjectNode objectNode = factory.objectNode(); if (!JerseyUtils.match("^(?!-)[0-9a-zA-Z\\-]+#[0-9a-zA-Z]+", APPKEY)) { LOGGER.error("Bad format of Appkey: " + APPKEY); objectNode.put("message", "Bad format of Appkey"); return objectNode; } if (StringUtils.isEmpty(userPrimaryKey)) { LOGGER.error("The primaryKey that will be useed to query must be provided ."); objectNode .put("message", "The primaryKey that will be useed to query must be provided ."); return objectNode; } try { JerseyWebTarget webTarget = null; webTarget = EndPoints.USERS_TARGET .resolveTemplate("org_name", APPKEY.split("#")[0]) .resolveTemplate("app_name", APPKEY.split("#")[1]) .path(userPrimaryKey); objectNode = JerseyUtils.sendRequest(webTarget, null, credential, HTTPMethod.METHOD_GET, null); } catch (Exception e) { e.printStackTrace(); } return objectNode; }  static ObjectNode createNewIMUserSingle(ObjectNode dataNode); static ObjectNode createNewIMUserBatch(ArrayNode dataArrayNode); static ObjectNode createNewIMUserBatchGen(String usernamePrefix,
			Long perNumber, Long totalNumber); static ObjectNode getIMUsersByPrimaryKey(String userPrimaryKey); static ObjectNode deleteIMUserByUserPrimaryKey(String userPrimaryKey); static ObjectNode deleteIMUserByUsernameBatch(Long limit,
			String queryStr); static ObjectNode modifyIMUserPasswordWithAdminToken(
			String userPrimaryKey, ObjectNode dataObjectNode); static ObjectNode addFriendSingle(String ownerUserPrimaryKey,
			String friendUserPrimaryKey); static ObjectNode deleteFriendSingle(String ownerUserPrimaryKey,
			String friendUserPrimaryKey); static ObjectNode getFriends(String ownerUserPrimaryKey); static ObjectNode imUserLogin(String ownerUserPrimaryKey, String password);  }
@Test public void testGetIMUsersByPrimaryKey() throws Exception { String userPrimaryKey = "kenshinnuser100"; ObjectNode getIMUsersByPrimaryKeyNode = EasemobIMUsers.getIMUsersByPrimaryKey(userPrimaryKey); if (null != getIMUsersByPrimaryKeyNode) { LOGGER.info("获取IM用户[主键查询]: " + getIMUsersByPrimaryKeyNode.toString()); } }