|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.mail.RMSStore
public class RMSStore
Implements the Store using J2ME RecordStore.
A folder is mapped to a RecordStore with name equal to the full path of the folder, and the messages inside the folder are the records inside that RecordStore.
It uses NamedObjectStore to speed up the record access by messageId.
Field Summary |
---|
Fields inherited from interface com.funambol.mail.Store |
---|
DRAFTS, INBOX, OUTBOX, SENT, TRASH |
Method Summary | |
---|---|
int |
countMessages(java.lang.String path)
This method returns the message count in this Store. |
Folder |
createFolder(java.lang.String path)
This method creates a folder in the record store. |
Folder[] |
findFolders(java.lang.String subst)
This method returns the list of the folders whose path matches subst . |
Folder |
getFolder(java.lang.String path)
This method returns the folder whose name is exactly path. |
java.lang.String[] |
getMessageIDs(java.lang.String path)
This method returns the messageIDs of all the messages in the folder path . |
Message[] |
getMsgHeaders(java.lang.String path)
This method returns the headers of all the messages in the folder path . |
void |
init(boolean reset)
Initialize the message store, creating the main folders. |
Folder[] |
list()
This method returns the list of the top level folders in this store. |
Folder[] |
list(java.lang.String path)
This method returns the list of the folders whose path starts with 'path' and are direct subfolders of it. |
Message |
readMessage(java.lang.String path,
Message msg)
This method reads the complete message from the Store. |
Message |
readMessage(java.lang.String path,
java.lang.String messageId)
This method reads a message from the Store, using the message Id. |
boolean |
removeFolder(java.lang.String path)
This method removes a folder from the record store. |
void |
removeMessage(java.lang.String path,
java.lang.String messageId)
This method removes a Message from the Store, using message ID as index. |
void |
saveMessage(java.lang.String path,
Message msg)
This method saves a message in the Store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void init(boolean reset) throws StoreException
init
in interface Store
reset
- if true, erase and re-create all the main folders.
StoreException
public Folder[] list()
list
in interface Store
null
if the store is
empty.public Folder[] list(java.lang.String path) throws StoreException
list
in interface Store
path
- the path of the parent folder
null
if path
has no subfolders.
StoreException
- If the path is not validpublic Folder createFolder(java.lang.String path) throws StoreException
createFolder
in interface Store
path
- the full path of the folder in the Store.
StoreException
- If an error occurs on the store (e.g. no space left)public boolean removeFolder(java.lang.String path) throws StoreException
removeFolder
in interface Store
path
- The full pathname in the Store
true
if the folder has been actually deleted,
false
if the folder did not exist.
StoreException
- if an error occurs on the storepublic Folder getFolder(java.lang.String path) throws StoreException
getFolder
in interface Store
path
- the path of the folder
null
if not found
StoreException
- If an error occurs accessing the Storepublic Folder[] findFolders(java.lang.String subst)
subst
.
findFolders
in interface Store
subst
- the part of name to search for
null
if there are no matchespublic Message[] getMsgHeaders(java.lang.String path) throws StoreException
path
.
getMsgHeaders
in interface Store
path
- the path of the folder
Message
with all the headers
set but without content
StoreException
- If an error occurs accessing the Storepublic java.lang.String[] getMessageIDs(java.lang.String path) throws StoreException
path
.
getMessageIDs
in interface Store
path
- the complete path of the folder
null
if the folder is
empty.
StoreException
- If an error occurs accessing the Storepublic Message readMessage(java.lang.String path, java.lang.String messageId) throws StoreException
readMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.messageId
- A string representing the unique message ID
Message
corresponding to the passed path and
message ID from this Store
StoreException
- If an error occurs accessing the Storepublic Message readMessage(java.lang.String path, Message msg) throws StoreException
StoreException
public void saveMessage(java.lang.String path, Message msg) throws StoreException
saveMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
StoreException
- If an error occurs accessing the Storepublic void removeMessage(java.lang.String path, java.lang.String messageId) throws StoreException
removeMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.messageId
- A string representing the unique message ID
StoreException
- If an error occurs accessing the Storepublic int countMessages(java.lang.String path) throws StoreException
countMessages
in interface Store
path
- The complete path of the Folder
containing the
Message
.
StoreException
- If an error occurs accessing the Store
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |