com.calfater.mailcarbon.impl.manager.folder
Class FolderManager

java.lang.Object
  extended by com.calfater.mailcarbon.impl.manager.folder.FolderManager
All Implemented Interfaces:
IFolderManager

public class FolderManager
extends java.lang.Object
implements IFolderManager

The Class FolderManager.

Author:
sebastien borie

Constructor Summary
FolderManager(int maxAttempts)
          Instantiates a new folder manager.
 
Method Summary
 boolean canProcess(javax.mail.Folder folder)
          A Folder can be processed if it has not been already fully copied and it doesn't failed to copy too many times.
 void clear()
          Clear the list of already copied folders
 void done(javax.mail.Folder folder)
          Informs the FolderManager that the folder is fully copied.
 void failed(javax.mail.Folder folder)
          Tells the FolderManager that an error occurred while copying/creating the folder.
 java.util.List<java.lang.String> getFolders()
          Gets the folders.
 int getMaxAttempts()
          Gets the max attempts.
 void reset(javax.mail.Folder folder)
          Reset.
 void setFolders(java.util.List<java.lang.String> folderList)
          Sets the folders.
protected  java.lang.String uniqueId(javax.mail.Folder folder)
          Generate folder unique id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderManager

public FolderManager(int maxAttempts)
Instantiates a new folder manager.

Parameters:
maxAttempts - the max attempts
Method Detail

done

public void done(javax.mail.Folder folder)
Description copied from interface: IFolderManager
Informs the FolderManager that the folder is fully copied.

Specified by:
done in interface IFolderManager
Parameters:
folder - the folder

failed

public void failed(javax.mail.Folder folder)
Description copied from interface: IFolderManager
Tells the FolderManager that an error occurred while copying/creating the folder.

Specified by:
failed in interface IFolderManager
Parameters:
folder - the folder

canProcess

public boolean canProcess(javax.mail.Folder folder)
Description copied from interface: IFolderManager
A Folder can be processed if it has not been already fully copied and it doesn't failed to copy too many times.

Specified by:
canProcess in interface IFolderManager
Parameters:
folder - the folder
Returns:
true if the folder can be processed.

reset

public void reset(javax.mail.Folder folder)
Description copied from interface: IFolderManager
Reset.

Specified by:
reset in interface IFolderManager
Parameters:
folder - the folder

getFolders

public java.util.List<java.lang.String> getFolders()
Description copied from interface: IFolderManager
Gets the folders.

Specified by:
getFolders in interface IFolderManager
Returns:
the folders

setFolders

public void setFolders(java.util.List<java.lang.String> folderList)
Description copied from interface: IFolderManager
Sets the folders.

Specified by:
setFolders in interface IFolderManager
Parameters:
folderList - the new folders

getMaxAttempts

public int getMaxAttempts()
Description copied from interface: IFolderManager
Gets the max attempts.

Specified by:
getMaxAttempts in interface IFolderManager
Returns:
the max attempts

clear

public void clear()
Description copied from interface: IFolderManager
Clear the list of already copied folders

Specified by:
clear in interface IFolderManager

uniqueId

protected java.lang.String uniqueId(javax.mail.Folder folder)
Generate folder unique id.

Parameters:
folder - the folder
Returns:
id


Copyright © 2010. All Rights Reserved.