@Test public void testFindMessagesByHistory() throws DAOException { MessageDVO criteriaDVO; MessageDataSourceDAO dao = super.getTestingTarget(); List result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageId("20080311-155320-90407@192.168.0.1"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(2, result.size()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("inbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(1)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(1)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(1)).getMessageType()); criteriaDVO = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageId("20080311-155320-90407%"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(2, result.size()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("inbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(1)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(1)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(1)).getMessageType()); criteriaDVO = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageBox("inbox"); criteriaDVO.setMessageId("20080311-155320-90407@192.168.0.1"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("inbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setService("testhistory:testhistory"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155227-07708@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("testhistory:testhistory", ((MessageDVO)result.get(0)).getService()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setService("%history"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155227-07708@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("testhistory:testhistory", ((MessageDVO)result.get(0)).getService()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setAction("action"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155223-07106@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("action", ((MessageDVO)result.get(0)).getAction()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setAction("a%i_n"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155223-07106@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("action", ((MessageDVO)result.get(0)).getAction()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setStatus("PD"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155225-71207@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("PD", ((MessageDVO)result.get(0)).getStatus()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setStatus("P_"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(0, result.size()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setConvId("convId_test5"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155228-42309@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("convId_test5", ((MessageDVO)result.get(0)).getConvId()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setConvId("%test5"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155228-42309@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("convId_test5", ((MessageDVO)result.get(0)).getConvId()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setService("test:test"); criteriaDVO.setMessageBox("outbox"); result = dao.findMessagesByHistory(criteriaDVO, 2, 0); Assert.assertEquals(2, result.size()); Assert.assertEquals("20080311-155228-42309@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("20080311-155225-71207@192.168.0.1", ((MessageDVO)result.get(1)).getMessageId()); criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageId("20080311-155320-90407@192.168.0.1"); criteriaDVO.setMessageBox("outbox"); criteriaDVO.setService(" "); criteriaDVO.setAction(" "); criteriaDVO.setCpaId(" "); criteriaDVO.setConvId(" "); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(1, result.size()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("test:test", ((MessageDVO)result.get(0)).getService()); Assert.assertEquals("testhistory5", ((MessageDVO)result.get(0)).getCpaId()); Assert.assertEquals("convId_test1", ((MessageDVO)result.get(0)).getConvId()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageId("%@192.168.0.1"); criteriaDVO.setService("test%history%"); criteriaDVO.setConvId("convId%"); criteriaDVO.setAction("order"); criteriaDVO.setStatus(""); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals("20080311-155227-07708@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("testhistory:testhistory", ((MessageDVO)result.get(0)).getService()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageId("%@192.168.0.1"); criteriaDVO.setService("test%history"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals("20080311-155227-07708@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("testhistory:testhistory", ((MessageDVO)result.get(0)).getService()); criteriaDVO = null; result = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setService("test:test"); criteriaDVO.setMessageBox(""); criteriaDVO.setStatus(""); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(5, result.size()); Assert.assertEquals("20080311-155228-42309@192.168.0.1", ((MessageDVO)result.get(0)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(0)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(0)).getMessageType()); Assert.assertEquals("20080311-155225-71207@192.168.0.1", ((MessageDVO)result.get(1)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(1)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(1)).getMessageType()); Assert.assertEquals("20080311-155223-07106@192.168.0.1", ((MessageDVO)result.get(2)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(2)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(2)).getMessageType()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(3)).getMessageId()); Assert.assertEquals("inbox", ((MessageDVO)result.get(3)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(3)).getMessageType()); Assert.assertEquals("20080311-155320-90407@192.168.0.1", ((MessageDVO)result.get(4)).getMessageId()); Assert.assertEquals("outbox", ((MessageDVO)result.get(4)).getMessageBox()); Assert.assertEquals("Order", ((MessageDVO)result.get(4)).getMessageType()); criteriaDVO = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setMessageBox("%box"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(0, result.size()); criteriaDVO = null; criteriaDVO = (MessageDVO)dao.createDVO(); criteriaDVO.setStatus("%L"); result = dao.findMessagesByHistory(criteriaDVO, 100, 0); Assert.assertEquals(0, result.size()); }
public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_id"); parameters.add(data.getMessageId()); } if (data.getMessageBox() != null && !data.getMessageBox().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_box"); parameters.add(data.getMessageBox()); } if (data.getCpaId() != null && !data.getCpaId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_cpa_id"); parameters.add(data.getCpaId()); } if (data.getService() != null && !data.getService().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_service"); parameters.add(data.getService()); } if (data.getAction() != null && !data.getAction().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_action"); parameters.add(data.getAction()); } if (data.getStatus() != null && !data.getStatus().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_status"); parameters.add(data.getStatus()); } if (data.getConvId() != null && !data.getConvId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_conv_id"); parameters.add(data.getConvId()); } if (data.getPrimalMessageId() != null && !data.getPrimalMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_primal_message_id"); parameters.add(data.getPrimalMessageId()); } sql += " " + getOrder("find_message_by_history_order"); parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); return executeQuery(sql, parameters.toArray()); }
MessageDataSourceDAO extends DataSourceDAO implements MessageDAO { public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_id"); parameters.add(data.getMessageId()); } if (data.getMessageBox() != null && !data.getMessageBox().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_box"); parameters.add(data.getMessageBox()); } if (data.getCpaId() != null && !data.getCpaId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_cpa_id"); parameters.add(data.getCpaId()); } if (data.getService() != null && !data.getService().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_service"); parameters.add(data.getService()); } if (data.getAction() != null && !data.getAction().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_action"); parameters.add(data.getAction()); } if (data.getStatus() != null && !data.getStatus().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_status"); parameters.add(data.getStatus()); } if (data.getConvId() != null && !data.getConvId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_conv_id"); parameters.add(data.getConvId()); } if (data.getPrimalMessageId() != null && !data.getPrimalMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_primal_message_id"); parameters.add(data.getPrimalMessageId()); } sql += " " + getOrder("find_message_by_history_order"); parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); return executeQuery(sql, parameters.toArray()); } }
MessageDataSourceDAO extends DataSourceDAO implements MessageDAO { public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_id"); parameters.add(data.getMessageId()); } if (data.getMessageBox() != null && !data.getMessageBox().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_box"); parameters.add(data.getMessageBox()); } if (data.getCpaId() != null && !data.getCpaId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_cpa_id"); parameters.add(data.getCpaId()); } if (data.getService() != null && !data.getService().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_service"); parameters.add(data.getService()); } if (data.getAction() != null && !data.getAction().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_action"); parameters.add(data.getAction()); } if (data.getStatus() != null && !data.getStatus().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_status"); parameters.add(data.getStatus()); } if (data.getConvId() != null && !data.getConvId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_conv_id"); parameters.add(data.getConvId()); } if (data.getPrimalMessageId() != null && !data.getPrimalMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_primal_message_id"); parameters.add(data.getPrimalMessageId()); } sql += " " + getOrder("find_message_by_history_order"); parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); return executeQuery(sql, parameters.toArray()); }  }
MessageDataSourceDAO extends DataSourceDAO implements MessageDAO { public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_id"); parameters.add(data.getMessageId()); } if (data.getMessageBox() != null && !data.getMessageBox().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_box"); parameters.add(data.getMessageBox()); } if (data.getCpaId() != null && !data.getCpaId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_cpa_id"); parameters.add(data.getCpaId()); } if (data.getService() != null && !data.getService().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_service"); parameters.add(data.getService()); } if (data.getAction() != null && !data.getAction().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_action"); parameters.add(data.getAction()); } if (data.getStatus() != null && !data.getStatus().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_status"); parameters.add(data.getStatus()); } if (data.getConvId() != null && !data.getConvId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_conv_id"); parameters.add(data.getConvId()); } if (data.getPrimalMessageId() != null && !data.getPrimalMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_primal_message_id"); parameters.add(data.getPrimalMessageId()); } sql += " " + getOrder("find_message_by_history_order"); parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); return executeQuery(sql, parameters.toArray()); }  DVO createDVO(); boolean findMessage(MessageDVO data); void addMessage(MessageDVO data); void deleteMessage(MessageDVO data); boolean updateMessage(MessageDVO data); boolean findRefToMessage(MessageDVO data); List findMessagesByTime(int time_period, MessageDVO data, int numberOfMessage, int offset); List findMessagesBeforeTime(int time_period); List findInboxPendingMessagesByTimestamp(MessageDVO data); List findOutboxPendingMessagesByTimestamp(MessageDVO data); List findOutboxProcessingMessagesByTimestamp(MessageDVO data); List findMessageByCpa(MessageDVO data, int numberOfMessage); int findInboxReadyMaxSequenceNoByCpa(MessageDVO data); int findMaxSequenceNoByMessageBoxAndCpa(MessageDVO data); int findMaxSequenceGroupByMessageBoxAndCpa(MessageDVO data); int findNumOfMessagesByMessageBoxAndCpaAndSequenceGroup(
            MessageDVO data); boolean findOrderedMessageByMessageBoxAndCpaAndSequenceGroupAndSequenceNo(
            MessageDVO data); List findOrderedMessagesByMessageBoxAndCpaAndStatus(MessageDVO data); List findMessagesByHistory(MessageDVO data, int numberOfMessage,
            int offset); int findNumberOfMessagesByHistory(MessageDVO data); int updateTimedOutMessageStatus(String status, Date currentTime); }
MessageDataSourceDAO extends DataSourceDAO implements MessageDAO { public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset) throws DAOException { List parameters = new ArrayList(); boolean hasSearchCriteria = false; String sql = super.getFinder("find_message_by_history"); if (data.getMessageId() != null && !data.getMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_id"); parameters.add(data.getMessageId()); } if (data.getMessageBox() != null && !data.getMessageBox().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_message_box"); parameters.add(data.getMessageBox()); } if (data.getCpaId() != null && !data.getCpaId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_cpa_id"); parameters.add(data.getCpaId()); } if (data.getService() != null && !data.getService().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_service"); parameters.add(data.getService()); } if (data.getAction() != null && !data.getAction().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_action"); parameters.add(data.getAction()); } if (data.getStatus() != null && !data.getStatus().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_status"); parameters.add(data.getStatus()); } if (data.getConvId() != null && !data.getConvId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_conv_id"); parameters.add(data.getConvId()); } if (data.getPrimalMessageId() != null && !data.getPrimalMessageId().trim().equals("")) { sql += " AND " + getFilter("find_message_by_history_filter_primal_message_id"); parameters.add(data.getPrimalMessageId()); } sql += " " + getOrder("find_message_by_history_order"); parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); return executeQuery(sql, parameters.toArray()); }  DVO createDVO(); boolean findMessage(MessageDVO data); void addMessage(MessageDVO data); void deleteMessage(MessageDVO data); boolean updateMessage(MessageDVO data); boolean findRefToMessage(MessageDVO data); List findMessagesByTime(int time_period, MessageDVO data, int numberOfMessage, int offset); List findMessagesBeforeTime(int time_period); List findInboxPendingMessagesByTimestamp(MessageDVO data); List findOutboxPendingMessagesByTimestamp(MessageDVO data); List findOutboxProcessingMessagesByTimestamp(MessageDVO data); List findMessageByCpa(MessageDVO data, int numberOfMessage); int findInboxReadyMaxSequenceNoByCpa(MessageDVO data); int findMaxSequenceNoByMessageBoxAndCpa(MessageDVO data); int findMaxSequenceGroupByMessageBoxAndCpa(MessageDVO data); int findNumOfMessagesByMessageBoxAndCpaAndSequenceGroup(
            MessageDVO data); boolean findOrderedMessageByMessageBoxAndCpaAndSequenceGroupAndSequenceNo(
            MessageDVO data); List findOrderedMessagesByMessageBoxAndCpaAndStatus(MessageDVO data); List findMessagesByHistory(MessageDVO data, int numberOfMessage,
            int offset); int findNumberOfMessagesByHistory(MessageDVO data); int updateTimedOutMessageStatus(String status, Date currentTime);  }