MessageDataSourceDAO

public class MessageDataSourceDAO extends DataSourceDAO implements MessageDAO
Author:Donahue Sze Window - Preferences - Java - Code Style - Code Templates

Methods

addMessage

public void addMessage(MessageDVO data)

createDVO

public DVO createDVO()

deleteMessage

public void deleteMessage(MessageDVO data)

findInboxPendingMessagesByTimestamp

public List findInboxPendingMessagesByTimestamp(MessageDVO data)

Find all the pending messages for inbox collector order by timestamp.

Parameters:
  • data – The message data value object.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

a List of DVO resulted from the specified SQL query. An empty List will be returned if there is no matching data.

findInboxReadyMaxSequenceNoByCpa

public int findInboxReadyMaxSequenceNoByCpa(MessageDVO data)

Find max sequence no. of inbox message in PS or DL status by CPA Only for EbMS Inbox Collector Service

Parameters:
  • data – The message data value object.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

max sequence no. -1 will be returned if there is no matching data.

findMaxSequenceGroupByMessageBoxAndCpa

public int findMaxSequenceGroupByMessageBoxAndCpa(MessageDVO data)

findMaxSequenceNoByMessageBoxAndCpa

public int findMaxSequenceNoByMessageBoxAndCpa(MessageDVO data)

Find max sequence no. of message by CPA and message box

Parameters:
  • data – The message data value object.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

max sequence no. -1 will be returned if there is no matching data.

findMessage

public boolean findMessage(MessageDVO data)

findMessageByCpa

public List findMessageByCpa(MessageDVO data, int numberOfMessage)

Find all the message by CPA, status, message type and message box. Only for EbMS Message Collector Service

Parameters:
  • data – The message data value object.
  • numberOfMessage – The no. of message return.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

a List of DVO resulted from the specified SQL query. An empty List will be returned if there is no matching data.

findMessagesBeforeTime

public List findMessagesBeforeTime(int time_period)

findMessagesByHistory

public List findMessagesByHistory(MessageDVO data, int numberOfMessage, int offset)

Find messages order by descending timestamp by different criteria.

Parameters:
  • data – The message data value object carrying query criteria.
  • numberOfMessage – max no. of message in return.
  • offset – no. of starting record in return.
Throws:

findMessagesByTime

public List findMessagesByTime(int time_period, MessageDVO data, int numberOfMessage, int offset)

findNumOfMessagesByMessageBoxAndCpaAndSequenceGroup

public int findNumOfMessagesByMessageBoxAndCpaAndSequenceGroup(MessageDVO data)

findNumberOfMessagesByHistory

public int findNumberOfMessagesByHistory(MessageDVO data)

Find number of messages by different criteria.

Parameters:
  • data – The message data value object carrying query criteria.
Throws:

findOrderedMessageByMessageBoxAndCpaAndSequenceGroupAndSequenceNo

public boolean findOrderedMessageByMessageBoxAndCpaAndSequenceGroupAndSequenceNo(MessageDVO data)

findOrderedMessagesByMessageBoxAndCpaAndStatus

public List findOrderedMessagesByMessageBoxAndCpaAndStatus(MessageDVO data)

findOutboxPendingMessagesByTimestamp

public List findOutboxPendingMessagesByTimestamp(MessageDVO data)

Find all the pending messages for outbox collector order by timestamp.

Parameters:
  • data – The message data value object.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

a List of DVO resulted from the specified SQL query. An empty List will be returned if there is no matching data.

findOutboxProcessingMessagesByTimestamp

public List findOutboxProcessingMessagesByTimestamp(MessageDVO data)

Find all the processing messages for outbox collector order by timestamp.

Parameters:
  • data – The message data value object.
Throws:
  • DAOException – if errors found when retrieving data from the data source.
Returns:

a List of DVO resulted from the specified SQL query. An empty List will be returned if there is no matching data.

findRefToMessage

public boolean findRefToMessage(MessageDVO data)

updateMessage

public boolean updateMessage(MessageDVO data)

updateTimedOutMessageStatus

public int updateTimedOutMessageStatus(String status, Date currentTime)

Update the status of all timed-out message to status. A message is considered as timed-out if the timeout timestamp is earlier than the currentTime.

Throws:
  • DAOException – When status is null or Error in persistence connectivity.

See also: hk.hku.cecid.ebms.spa.dao.MessageDVO.getTimeoutTimestamp(), hk.hku.cecid.ebms.spa.dao.MessageDVO.setTimeoutTimestamp(java.sql.Timestamp)