jSyncManager Simple Java Server

org.jSyncManager.SJS.Adapters.SMTPServer
Class Mbox

java.lang.Object
  extended by org.jSyncManager.SJS.Adapters.SMTPServer.Mbox
All Implemented Interfaces:
MessageStoreInterface

public class Mbox
extends java.lang.Object
implements MessageStoreInterface

This class implements the MessageStore interface by storing and retrieving messages to and from a file formatted according to the mbox specifications.

Author:
Torben Werner

Field Summary
static java.lang.String PATH_SEP
          Convenience variable for the directory path separator
 
Constructor Summary
Mbox()
          Constructor, default, empty
 
Method Summary
 Message[] getMessages(User user)
          Returns an array of all the messages stored in a valid user's mbox.
 void storeMessage(Message msg, Address to)
          Stores a single Message object to some medium where it can later be retrieved.
 void storeMessages(Message[] msgs)
          Stores an array of Message objects to some medium where they can later be retrieved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEP

public static final java.lang.String PATH_SEP
Convenience variable for the directory path separator

Constructor Detail

Mbox

public Mbox()
Constructor, default, empty

Method Detail

storeMessages

public void storeMessages(Message[] msgs)
                   throws java.io.IOException
Stores an array of Message objects to some medium where they can later be retrieved.

Specified by:
storeMessages in interface MessageStoreInterface
Parameters:
msgs - the array of Message objects which will each be stored.
Throws:
java.io.IOException - exception

storeMessage

public void storeMessage(Message msg,
                         Address to)
                  throws java.io.IOException
Stores a single Message object to some medium where it can later be retrieved.

Specified by:
storeMessage in interface MessageStoreInterface
Parameters:
msg - the Message object which will be stored.
Throws:
java.io.IOException - exception

getMessages

public Message[] getMessages(User user)
                      throws java.io.IOException
Returns an array of all the messages stored in a valid user's mbox.

Specified by:
getMessages in interface MessageStoreInterface
Parameters:
user - the User who's messages will be retrieved.
Returns:
an array of Message objects representing each of the user's messages.
Throws:
java.io.IOException

jSyncManager Simple Java Server

Copyright (c) 2004 Brad BARCLAY. All Rights Reserved.