SFRMMessageSegmentDSDAO

public class SFRMMessageSegmentDSDAO extends DataSourceDAO implements SFRMMessageSegmentDAO

The data access object controller for the database table sfrm_message_segment. It provides some useful database-level queries. Creation Date: 29/9/2006

Author:Twinsen Tsang

Methods

createDVO

public DVO createDVO()

Create a new SFRM Message Segment Object.

Returns:a new SFRM Message Segment Object.

findIncompleteSegments

public List findIncompleteSegments(String messageBox, String status, String type, int limit)

Find-out all segments which are incomplete in SFRM semantic. Incomplete Segments are defined as their corresponding message is not in the status of either ‘DF’ or ‘PS’. The query support wildcard on status by using ‘%’ string.

findLastUpdatedMessageSegmentByMessageIdAndBoxAndType

public SFRMMessageSegmentDVO findLastUpdatedMessageSegmentByMessageIdAndBoxAndType(String messageId, String messageBox, String type)

Find a message segment recrod with specified parameters. The field “message id”, “message box” and “type” will be used for record searching. The message segment extracted is the last updated segments by other module.

Parameters:
  • messageId – The message id of the message segment.
  • messageBox – The message box of the message segment.
  • type – The type of the message segment
Throws:
Returns:

A message segment record if found.

findMaxSegmentNoByMessageIdAndBoxAndType

public int findMaxSegmentNoByMessageIdAndBoxAndType(String messageId, String messageBox, String type)

Find the maximum number of segment no in the database from the specified parameters.

Parameters:
  • messageId – The message id of the message segment.
  • messageBox – The message box of the message segment.
  • type – The type of the message segment

findMessageSegmentByMessageBoxAndStatusAndTypeAndMessageStatusNotEqualTo

public List findMessageSegmentByMessageBoxAndStatusAndTypeAndMessageStatusNotEqualTo(String messageBox, String status, String type, String messageStatus, int limit)

findMessageSegmentByMessageIdAndBoxAndType

public SFRMMessageSegmentDVO findMessageSegmentByMessageIdAndBoxAndType(String messageId, String messageBox, int segmentNo, String type)

Find a message segment record with specified parameters. The field “message id”, “message box” , “segment no” and “segment type” will be used for record finding.

Parameters:
  • messageId – The message id of the message segment.
  • messageBox – The message box of the message segment.
  • type – The status of the message segment
Throws:
Returns:

A set of message segment which meets the specified condition or empty list if no record matched.

findMessageSegmentsByMessageBoxAndStatus

public List findMessageSegmentsByMessageBoxAndStatus(String messageBox, String status, int limit)

Find a set of message segment record with specified message box and message status.

Parameters:
  • messageBox – The message box of the message segment.
  • status – The status of the message segment.
  • limit – The maximum message segment can be retrieved at one invocation.
Throws:
Returns:

A set of message segment which meets the specified condition or empty list if no record matched.

findMessageSegmentsByMessageBoxAndStatusAndMessageStatusNotEqualTo

public List findMessageSegmentsByMessageBoxAndStatusAndMessageStatusNotEqualTo(String messageBox, String status, String messageStatus, int limit)

Find a set of message segment record with specified message box and message status.

Parameters:
  • messageBox – The message box of the message segment.
  • status – The status of the message segment.
  • messageStatus – The associated main message status of the segment.
  • limit – The maximum message segment can be retrieved at one invocation.
Throws:
Returns:

A set of message segment which meets the specified condition or empty list if no record matched.

findNumOfBytesSentByMessageIdAndBoxAndTypeAndStatues

public long findNumOfBytesSentByMessageIdAndBoxAndTypeAndStatues(String messageId, String messageBox, String type, long proceedTime, List<String> statues)

findNumOfSegmentByMessageIdAndBoxAndTypeAndStatus

public int findNumOfSegmentByMessageIdAndBoxAndTypeAndStatus(String messageId, String messageBox, String type, String status)

Find how many segments is available into the database.

Parameters:
  • messageId – The message id of the message segment.
  • messageBox – The message box of the message segment.
Throws:

findSegmentByMessageIdAndBoxAndTypeAndNos

public List findSegmentByMessageIdAndBoxAndTypeAndNos(String messageId, String messageBox, String type, List<Integer> segmentNos)

findSegmentsByMessageIdAndBoxAndTypeAndStatus

public List findSegmentsByMessageIdAndBoxAndTypeAndStatus(String messageId, String messageBox, String type, String status)

Find segment by their message Id, nessage box, message type and message status

Parameters:
  • messageId – The message id of the message segment.
  • messageBox – The message box of the message segment.
  • type – The segment type of the message segment.
  • status – The status of the message segment.
Throws:

updateBatchSegmentsRecoveryStatus

public int updateBatchSegmentsRecoveryStatus(String status, String messageId, String messageBox, String segmentType, List<Integer> segNums)

Update the message segment status in batch

Parameters:
  • status – status of message segments to update to
  • segNums – list of segment number to be update

updateBatchSegmentsStatus

public int updateBatchSegmentsStatus(String status, Timestamp completeTime, String messageId, String messageBox, String segmentType, List<Integer> segNums)