com.calfater.mailcarbon.impl.manager.message
Interface IMessageManager

All Known Implementing Classes:
MessageManager

public interface IMessageManager


Method Summary
 boolean canProcess(javax.mail.Message message)
          Ask the MessageManager to lock the resource if the message can be processed.
 void clear()
          Clear the list of already copied messages
 void done(javax.mail.Message message)
          Tells the MessageManager that the message is successfully copied and remove thread lock.
 void failed(javax.mail.Message message)
          Tells the MessageManager that an error occurred while copying the message and free the message's thread lock.
 boolean failedTooManyTimes(javax.mail.Message message)
          Ask the MessageManager if a message failled too many times to copy.
 int getMaxAttempts()
          Gets the max attempts.
 java.util.List<java.lang.String> getMessages()
          Gets the messages.
 void setMessages(java.util.List<java.lang.String> messageList)
          Sets the messages.
 

Method Detail

canProcess

boolean canProcess(javax.mail.Message message)
Ask the MessageManager to lock the resource if the message can be processed. A message can be processed if it has not been already copied, no thread use it, it doesn't failed to copy too many times.

Parameters:
message - the message
Returns:
if the message can be processed (and is locked)

done

void done(javax.mail.Message message)
Tells the MessageManager that the message is successfully copied and remove thread lock.

Parameters:
message - A copied message.

failed

void failed(javax.mail.Message message)
Tells the MessageManager that an error occurred while copying the message and free the message's thread lock.

Parameters:
message - the message

failedTooManyTimes

boolean failedTooManyTimes(javax.mail.Message message)
Ask the MessageManager if a message failled too many times to copy.

Parameters:
message - the message
Returns:
if the message filled too many time to copy.

getMessages

java.util.List<java.lang.String> getMessages()
Gets the messages.

Returns:
the list of successfully copied messages

setMessages

void setMessages(java.util.List<java.lang.String> messageList)
Sets the messages.

Parameters:
messageList - the list of successfully copied messages

getMaxAttempts

int getMaxAttempts()
Gets the max attempts.

Returns:
the max attempts before a message is marked as skiped

clear

void clear()
Clear the list of already copied messages



Copyright © 2010. All Rights Reserved.