Package org.mokai.persist

Examples of org.mokai.persist.MessageCriteria


    createMessageForUpdate(applicationsCol, Message.STATUS_FAILED);

    MongoMessageStore store = new MongoMessageStore();
    store.setMongo(db);

    Collection<Message> messages = store.list(new MessageCriteria());
    Assert.assertNotNull(messages);
    Assert.assertEquals(messages.size(), 2);
  }
View Full Code Here


    createMessageForUpdate(applicationsCol, Message.STATUS_FAILED);

    MongoMessageStore store = new MongoMessageStore();
    store.setMongo(db);

    MessageCriteria criteria = new MessageCriteria()
      .direction(Direction.TO_APPLICATIONS);
    Collection<Message> messages = store.list(criteria);

    Assert.assertEquals(messages.size(), 1);
  }
View Full Code Here

      boolean changed = monitorConnectors(routingEngine.getApplications(), applications,
          Direction.TO_APPLICATIONS);
      changed = monitorConnectors(routingEngine.getConnections(), connections,
          Direction.TO_CONNECTIONS) ? true : changed;

      MessageCriteria criteria = new MessageCriteria()
        .addStatus(Message.STATUS_FAILED)
        .addStatus(Message.STATUS_RETRYING);
      int actualFailed = routingEngine.getMessageStore().list(criteria).size();
      if (failed != actualFailed) {
        failed = actualFailed;
        try {
          JSONObject json = new JSONObject().put("eventType", "FAILED_CHANGED")
              .put( "data", new JSONObject().put("value", failed) );
          broadcaster.broadcast(json.toString());
        } catch (JSONException e) {
          log.error("JSONException while notifying failed: " + e.getMessage(), e);
        }
        changed = true;
      }

      criteria = new MessageCriteria().addStatus(Message.STATUS_UNROUTABLE);
      int actualUnroutable =  routingEngine.getMessageStore().list(criteria).size();
      if (unroutable != actualUnroutable) {
        unroutable = actualUnroutable;
        try {
          JSONObject json = new JSONObject().put("eventType", "UNROUTABLE_CHANGED")
View Full Code Here

TOP

Related Classes of org.mokai.persist.MessageCriteria

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.