@Override public User createUser(User user) throws HttpException { Gson gson = getGsonWithAdapters(); String responseJson = restClient.postForJson(openmrsInstance.toInstancePath("/user"), gson.toJson(user)); return (User) JsonUtils.readJson(responseJson, User.class); }
@Override public UserListResult queryForUsersByUsername(String username) throws HttpException { String responseJson = restClient.getJson( openmrsInstance.toInstancePathWithParams("/user?q={username}&v=full", username)); return (UserListResult) JsonUtils.readJson(responseJson, UserListResult.class); }
@Override public RoleListResult getAllRoles() throws HttpException { String responseJson = restClient.getJson(openmrsInstance.toInstancePath("/role?v=full")); return (RoleListResult) JsonUtils.readJson(responseJson, RoleListResult.class); }