org.abstracthorizon.mercury.maildir.uid
Class UIDMaildirStore

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Store
          extended by org.abstracthorizon.mercury.maildir.MaildirStore
              extended by org.abstracthorizon.mercury.maildir.uid.UIDMaildirStore

public class UIDMaildirStore
extends MaildirStore

This store implementation is aggressive UID implementation. It maintains UIDs within file names instead using separate index file. Each file added to the store must have precisely defined name (see UIDMaildirMessage) or while being added its name will be changed to conform to it.

Consequences of such store's behaviour are quicker, less complicated maintenance of UID and mapping from UIDs to messages; simple tracking of externally removed and added messages. Negative side is that external application would see messages disappearing when added to the store and new messages with exactly the same content appearing after (while) this store is executing over same directory.

Only two files that this store needs are ".nextuid" where the last uid number is stored and ".uidvalidity" where folder's uid validity is stored.

Author:
Daniel Sendula

Field Summary
static String NEXT_UID_FILE
          Name of a file storing next uid number
static String UID_VALIDITY_FILE
          Name of a file storing folder's uid validity
 
Fields inherited from class org.abstracthorizon.mercury.maildir.MaildirStore
base, directories, HOME, HTTP_SYNTAX, httpSyntax, INFO_SEPARATOR, infoSeparator, LEADING_DOT, leadingDot, MAX_FOLDER_DATA_LIFE
 
Fields inherited from class javax.mail.Service
debug, session, url
 
Constructor Summary
UIDMaildirStore(javax.mail.Session session, javax.mail.URLName urlname)
          Constructor
 
Method Summary
protected  MaildirFolder createFolder(MaildirFolderData folderData)
          This implementation creates UIDMaildirFolder
protected  MaildirFolderData createFolderData(File file)
          This implementation creates UIDMaildirFolderData from supplied file.
 
Methods inherited from class org.abstracthorizon.mercury.maildir.MaildirStore
createBaseFile, getBaseFile, getDefaultFolder, getFolder, getFolder, getFolderData, getFolderData, getInfoSeparator, getParentFolder, isHttpSyntax, isLeadingDot, parseURLName, processParam, protocolConnect, replace
 
Methods inherited from class javax.mail.Store
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
 
Methods inherited from class javax.mail.Service
addConnectionListener, close, connect, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEXT_UID_FILE

public static final String NEXT_UID_FILE
Name of a file storing next uid number

See Also:
Constant Field Values

UID_VALIDITY_FILE

public static final String UID_VALIDITY_FILE
Name of a file storing folder's uid validity

See Also:
Constant Field Values
Constructor Detail

UIDMaildirStore

public UIDMaildirStore(javax.mail.Session session,
                       javax.mail.URLName urlname)
Constructor

Parameters:
session - mail session
urlname - url name
Method Detail

createFolder

protected MaildirFolder createFolder(MaildirFolderData folderData)
This implementation creates UIDMaildirFolder

Overrides:
createFolder in class MaildirStore
Parameters:
folderData - folder data
Returns:
new maildir folder

createFolderData

protected MaildirFolderData createFolderData(File file)
This implementation creates UIDMaildirFolderData from supplied file.

Overrides:
createFolderData in class MaildirStore
Parameters:
file - file
Returns:
new maildir folder data


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.