Package mireka.pop.store
Class Maildrop
- Object
-
- mireka.pop.store.Maildrop
-
public class Maildrop extends ObjectMaildrop provides the physical storage for a specific maildrop (assigned to a user) using the file system. This implementation uses a single directory, where it stores each mail in separate files in addition to some control files. All operations are as atomic as possible, preventing leaving the maildrop in an inconsistent state.
-
-
Constructor Summary
Constructors Constructor Description Maildrop(String name, java.io.File maildropDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MaildropAppenderallocateAppender()voidbeginTransaction()voidcheckReleasedState()voidcommitTransaction()voiddelete(int messageNumber)longgetCountOfMessages()java.io.InputStreamgetMailAsStream(int messageNumber)StringgetName()ScanListinggetScanListing(int messageNumber)java.util.List<ScanListing>getScanListings()longgetTotalOctets()UidListinggetUidListing(int messageNumber)java.util.List<UidListing>getUidListings()voidresetDeletions()voidrollbackTransaction()
-
-
-
Method Detail
-
beginTransaction
public void beginTransaction() throws MaildropLockedException, MaildropPopException
-
getCountOfMessages
public long getCountOfMessages()
-
getTotalOctets
public long getTotalOctets()
-
getScanListings
public java.util.List<ScanListing> getScanListings()
-
getScanListing
public ScanListing getScanListing(int messageNumber) throws MaildropPopException, IllegalStateException
- Throws:
MaildropPopExceptionIllegalStateException
-
getUidListings
public java.util.List<UidListing> getUidListings()
-
getUidListing
public UidListing getUidListing(int messageNumber) throws MaildropPopException, IllegalStateException
- Throws:
MaildropPopExceptionIllegalStateException
-
getMailAsStream
public java.io.InputStream getMailAsStream(int messageNumber) throws MaildropPopException, IllegalStateException- Throws:
MaildropPopExceptionIllegalStateException
-
delete
public void delete(int messageNumber) throws MaildropPopException, IllegalStateException- Throws:
MaildropPopExceptionIllegalStateException
-
resetDeletions
public void resetDeletions()
-
commitTransaction
public void commitTransaction() throws MaildropPopException, IllegalStateException- Throws:
MaildropPopExceptionIllegalStateException
-
rollbackTransaction
public void rollbackTransaction() throws IllegalStateException- Throws:
IllegalStateException
-
allocateAppender
public MaildropAppender allocateAppender() throws LocalMailSystemException
- Throws:
LocalMailSystemException
-
checkReleasedState
public void checkReleasedState()
-
getName
public String getName()
- Category:
- GETSET
-
-