Search in sources :

Example 1 with MessageMap

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;
}
Also used : MessageMap(com.dexels.navajo.adapter.navajomap.MessageMap)

Example 2 with MessageMap

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());
    }
}
Also used : Message(com.dexels.navajo.document.Message) UserException(com.dexels.navajo.script.api.UserException) MessageMap(com.dexels.navajo.adapter.navajomap.MessageMap) NavajoException(com.dexels.navajo.document.NavajoException) AuthorizationException(com.dexels.navajo.script.api.AuthorizationException) UserException(com.dexels.navajo.script.api.UserException) MappableException(com.dexels.navajo.script.api.MappableException) IOException(java.io.IOException) SystemException(com.dexels.navajo.script.api.SystemException) ConditionErrorException(com.dexels.navajo.server.ConditionErrorException)

Aggregations

MessageMap (com.dexels.navajo.adapter.navajomap.MessageMap)2 Message (com.dexels.navajo.document.Message)1 NavajoException (com.dexels.navajo.document.NavajoException)1 AuthorizationException (com.dexels.navajo.script.api.AuthorizationException)1 MappableException (com.dexels.navajo.script.api.MappableException)1 SystemException (com.dexels.navajo.script.api.SystemException)1 UserException (com.dexels.navajo.script.api.UserException)1 ConditionErrorException (com.dexels.navajo.server.ConditionErrorException)1 IOException (java.io.IOException)1