Package org.mokai.persist

Examples of org.mokai.persist.RejectedException


      // check if the handler supports the message
      if (handler.supportsDirection(direction)) {
        long id = handler.insertMessage(conn, message);
        message.setId(id);
      } else {
        throw new RejectedException("this message store doesn't supports direction '" + direction + "'");
      }

    } catch (SQLException e) {
      throw new StoreException(e);
    } finally {
View Full Code Here


        boolean found = handler.updateMessage(conn, message);
        if (!found) {
          throw new ObjectNotFoundException("message with id " + message.getId() + " not found");
        }
      } else {
        throw new RejectedException("this message store doesn't supports direction '" + direction + "'");
      }
    } catch (SQLException e) {
      throw new StoreException(e);
    } finally {
      if (conn != null) {
View Full Code Here

    if (message == null) throw new IllegalArgumentException("No message specified");

    // check if the direction of the message is valid
    if (!Direction.TO_CONNECTIONS.equals(message.getDirection())
        && !Direction.TO_APPLICATIONS.equals(message.getDirection())) {
      throw new RejectedException("can't save/update a message with direction: "
          + message.getDirection() == null ? "null" : message.getDirection().toString());
    }

    try {
      if (message.getId() == null) { // hasn't been persisted
View Full Code Here

    if (direction.equals(Direction.TO_CONNECTIONS)) {
      id = outboundHandler.insertMessage(conn, message);
    } else if (direction.equals(Direction.TO_APPLICATIONS)) {
      id = inboundHandler.insertMessage(conn, message);
    } else {
      throw new RejectedException("can't save a message with direction: " + direction);
    }

    return id;
  }
View Full Code Here

    if (direction.equals(Direction.TO_CONNECTIONS)) {
      return outboundHandler.updateMessage(conn, message);
    } else if (direction.equals(Direction.TO_APPLICATIONS)) {
      return inboundHandler.updateMessage(conn, message);
    } else {
      throw new RejectedException("can't save a message with direction: " + direction);
    }
  }
View Full Code Here

TOP

Related Classes of org.mokai.persist.RejectedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.