Message message = new MessageBuilder()
.withMessageType(MessageType.CHAT)
.withRecipientJids(jid)
.withBody(req.getParameter("chat_message"))
.build();
SendResponse sendResponse = xmpp.sendMessage(message);
if (sendResponse.getStatusMap().get(jid) == SendResponse.Status.SUCCESS) {
adminMessage = "Chat message sent to JID " + jidStr + ".";
} else if (sendResponse.getStatusMap().get(jid) == SendResponse.Status.INVALID_ID) {
adminMessage = "Message not sent: invalid JID " + jidStr + ".";
} else {
adminMessage = "Message not sent to " + jidStr + ": internal service error.";
}