SFRMMessageSegmentDAO

public interface SFRMMessageSegmentDAO extends DAO

Creation Date: 3/10/2006

Author:Twinsen Tsang

Methods

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)

TODO: Refactor

Parameters:
  • messageBox
  • status
  • type
  • messageStatus
  • limit
Throws:

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 searching.

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

A message segment record if found.

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)

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.
  • type – The segment type of the message segment.
  • statues – The statues of the message segment.
Throws:

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.
  • type – The segment type of the message segment.
  • status – The status of the message segment.
Throws:

findSegmentByMessageIdAndBoxAndTypeAndNos

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

Find segment by their message id, message box, type and list of segment number

Parameters:
  • messageId – message ID
  • messageBox – message box
  • type – segment type
  • segmentNos – list of segment number
Throws:
Returns:

list of SFRMMessageSegmentDVO

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)

updateBatchSegmentsStatus

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