|
||||||||
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.
Field Summary |
---|
Fields inherited from interface com.funambol.mail.Store |
---|
DRAFTS, INBOX, LATEST_VERSION, OUTBOX, SENT, VERSION_101, VERSION_102, VERSION_103 |
Method Summary | |
---|---|
void |
addMessage(java.lang.String path,
Message msg)
This method add a message to the Store. |
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 a new reference to 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 . |
int |
getVersion()
This method gets the version of the Store which is currently being used on the device. |
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 |
readFirstMessage(java.lang.String path)
Return the first message in the store. |
java.io.DataInputStream |
readMessage(Message msg)
This method reads a record from the Store, using its record id. |
Message |
readMessage(java.lang.String path,
java.lang.String recordId)
This method reads a message from the Store, using the record id. |
Message |
readNextMessage(java.lang.String path)
Return the next message in the store. |
boolean |
removeFolder(java.lang.String path)
This method removes a folder from the record store. |
void |
removeMessage(java.lang.String path,
java.lang.String recordId)
This method removes a Message from the Store, using message ID as index. |
void |
saveMessage(java.lang.String path,
Message msg)
This method saves (NOT ADD) a message in the Store. |
void |
setVersion(int version)
This method sets the version of the Store which is currently being used on the device. |
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 MailException
init
in interface Store
reset
- if true, erase and re-create all the main folders.
MailException
public Folder[] list()
list
in interface Store
null
if the store is
empty.public Folder[] list(java.lang.String path) throws MailException
list
in interface Store
path
- the path of the parent folder
null
if path
has no subfolders.
MailException
- If the path is not validpublic Folder createFolder(java.lang.String path) throws MailException
createFolder
in interface Store
path
- the full path of the folder in the Store.
MailException
- If an error occurs on the store (e.g. no space left)public boolean removeFolder(java.lang.String path) throws MailException
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.
MailException
- if an error occurs on the storepublic Folder getFolder(java.lang.String path) throws MailException
getFolder
in interface Store
path
- the path of the folder
null
if not found
MailException
- 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 MailException
path
. IMPORTANT: a folder MUST be set as parent of
this message before calling this method, otherwise the headers of this
message will be returned as an empty hastable
getMsgHeaders
in interface Store
path
- the path of the folder
Message
with all the headers
set but without content
MailException
- If an error occurs accessing the Storepublic java.lang.String[] getMessageIDs(java.lang.String path) throws MailException
path
.
getMessageIDs
in interface Store
path
- the complete path of the folder
null
if the folder is
empty.
MailException
- If an error occurs accessing the Storepublic Message readMessage(java.lang.String path, java.lang.String recordId) throws MailException
readMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.recordId
- A string representing the record ID of this message (must be a
number)
Message
corresponding to the passed path and
message ID from this Store
MailException
- If an error occurs accessing the Storepublic Message readFirstMessage(java.lang.String path) throws MailException
readFirstMessage
in interface Store
MailException
- if the store cannot be accessedpublic Message readNextMessage(java.lang.String path) throws MailException
readNextMessage
in interface Store
MailException
- if the store cannot be accessedpublic java.io.DataInputStream readMessage(Message msg) throws MailException
readMessage
in interface Store
msg
- The message whose record must be re-read
MailException
- If an error occurs accessing the Storepublic void saveMessage(java.lang.String path, Message msg) throws MailException
saveMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
MailException
- If an error occurs accessing the Storepublic void addMessage(java.lang.String path, Message msg) throws MailException
addMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
MailException
- If an error occurs accessing the Storepublic void removeMessage(java.lang.String path, java.lang.String recordId) throws MailException
removeMessage
in interface Store
path
- The complete path of the Folder
containing the
Message
.messageId
- A string representing the unique message ID
MailException
- If an error occurs accessing the Storepublic int countMessages(java.lang.String path) throws MailException
countMessages
in interface Store
path
- The complete path of the Folder
containing the
Message
.
MailException
- If an error occurs accessing the Storepublic void setVersion(int version)
setVersion
in interface Store
version
- is the store versionpublic int getVersion()
getVersion
in interface Store
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |