use of com.dexels.navajo.adapter.navajomap.MessageMap in project navajo by Dexels.
the class NavajoMap method getMessage.
public MessageMap getMessage() throws UserException {
waitForResult();
if (msgPointer == null)
return null;
MessageMap mm = new MessageMap();
mm.setMsg(msgPointer);
return mm;
}
use of com.dexels.navajo.adapter.navajomap.MessageMap in project navajo by Dexels.
the class NavajoMap method getMessages.
/**
* Try to return messages from using messagePointer, if no messages are found return null.
*
* @return
* @throws UserException
*/
public MessageMap[] getMessages() throws UserException {
waitForResult();
if (msgPointer == null)
return null;
if (!msgPointer.isArrayMessage())
throw new UserException(-1, "getMessages can only be used for array messages");
try {
List<Message> all = msgPointer.getAllMessages();
if ((all == null))
throw new UserException(-1, "Could not find messages: " + messagePointerString + " in response document");
messages = new MessageMap[all.size()];
for (int i = 0; i < all.size(); i++) {
MessageMap msg = new MessageMap();
msg.setMsg(all.get(i));
messages[i] = msg;
}
return messages;
} catch (Exception e) {
throw new UserException(-1, e.getMessage());
}
}
Aggregations