Package net.fortuna.mstor.connector
Class AbstractFolderDelegate<T extends MessageDelegate>
- java.lang.Object
-
- net.fortuna.mstor.connector.AbstractFolderDelegate<T>
-
- Type Parameters:
T- the type of message delegate supported
- All Implemented Interfaces:
FolderDelegate<T>
- Direct Known Subclasses:
AbstractMetaFolder,MboxFolder,NntpFolder
public abstract class AbstractFolderDelegate<T extends MessageDelegate> extends Object implements FolderDelegate<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractFolderDelegate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longallocateUid(MessageDelegate message)Allocates a new message UID for the folder.protected abstract TcreateMessage(int messageNumber)intgetDeletedMessageCount()Optional support for more efficient implementation.protected abstract voidsetLastUid(long uid)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.fortuna.mstor.connector.FolderDelegate
appendMessages, close, create, delete, exists, expunge, getFolder, getFolderName, getFullName, getLastModified, getLastUid, getMessage, getMessageAsStream, getMessageCount, getParent, getSeparator, getType, getUidValidity, list, open, renameTo
-
-
-
-
Method Detail
-
allocateUid
public final long allocateUid(MessageDelegate message) throws UnsupportedOperationException, DelegateException
Allocates a new message UID for the folder.- Specified by:
allocateUidin interfaceFolderDelegate<T extends MessageDelegate>- Parameters:
message- the message to allocate a UID value to- Returns:
- the allocated UID for the specified message
- Throws:
UnsupportedOperationException- if this method is not supported by the folder implementationDelegateException- where an error occurs allocating a UID
-
setLastUid
protected abstract void setLastUid(long uid) throws UnsupportedOperationException, DelegateException- Parameters:
uid- the latest UID for the folder- Throws:
UnsupportedOperationException- if this method is not supported in the folder delegateDelegateException- where an error occurs updating the latest UID
-
createMessage
protected abstract T createMessage(int messageNumber) throws DelegateException
- Parameters:
messageNumber- the message number to associate with the new message- Returns:
- a new message delegate instance
- Throws:
DelegateException- where an error occurs creating the delegate
-
getDeletedMessageCount
public int getDeletedMessageCount() throws UnsupportedOperationExceptionOptional support for more efficient implementation.- Specified by:
getDeletedMessageCountin interfaceFolderDelegate<T extends MessageDelegate>- Returns:
- the total deleted message count
- Throws:
UnsupportedOperationException- if this method is not supported by the folder implementation
-
-