|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
Represents a message store and its access protocol, for storing and retrieving messages on the device
Field Summary | |
---|---|
static java.lang.String |
DRAFTS
|
static java.lang.String |
INBOX
|
static int |
LATEST_VERSION
Latest version |
static java.lang.String |
OUTBOX
|
static java.lang.String |
SENT
|
static int |
VERSION_101
Store available versions |
static int |
VERSION_102
|
static int |
VERSION_103
|
Method Summary | |
---|---|
void |
addMessage(java.lang.String path,
Message msg)
This method saves a new message in the Store |
int |
countMessages(java.lang.String path)
This method returns the message count in this Store. |
Folder |
createFolder(java.lang.String path)
Creates a Folder in this Store with the provided path |
Folder[] |
findFolders(java.lang.String path)
Retrieves a Folder in this Store that matches the provided substring |
Folder |
getFolder(java.lang.String path)
Retrieves a Folder by name |
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 reads the headers of all the message from a folder. |
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()
Retrieves a list of folders directly under 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 msgid)
This method reads a message from the Store, using the message Id. |
Message |
readNextMessage(java.lang.String path)
Return the next message in the store. |
boolean |
removeFolder(java.lang.String path)
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 updates an existing message in the Store |
void |
setVersion(int version)
This method sets the version of the Store which is currently being used on the device. |
Field Detail |
---|
static final int VERSION_101
static final int VERSION_102
static final int VERSION_103
static final int LATEST_VERSION
static final java.lang.String INBOX
static final java.lang.String OUTBOX
static final java.lang.String DRAFTS
static final java.lang.String SENT
Method Detail |
---|
void init(boolean reset) throws MailException
reset
- if true, erase and re-create all the main folders.
MailException
Folder[] list()
null
if the store is empty.Folder[] list(java.lang.String path) throws MailException
path
- the path of the parent folder
null
if
path
has no subfolders.
StoreException
- If the path is not valid
MailException
Folder createFolder(java.lang.String path) throws MailException
path
- the full path of the folder in the Store.
StoreException
- If an error occurs on the store (e.g. no space left)
MailException
boolean removeFolder(java.lang.String path) throws MailException
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 store
MailException
Folder getFolder(java.lang.String path) throws MailException
path
- The path to the Folder in the device's file system
StoreException
- If an error occurs accessing the Store
MailException
Folder[] findFolders(java.lang.String path)
path
- The partial path in the device's file system to the searched
Folder
null
if there are no matchesMessage[] getMsgHeaders(java.lang.String path) throws MailException
path
- The complete path of the Folder
containing the
messages.
Message
with all the headers
set but without content
StoreException
- If an error occurs accessing the Store
MailException
java.lang.String[] getMessageIDs(java.lang.String path) throws MailException
path
.
path
- the complete path of the folder
null
if the folder is
empty.
StoreException
- If an error occurs accessing the Store
MailException
Message readMessage(java.lang.String path, java.lang.String msgid) throws MailException
path
- The complete path of the Folder
containing the
Message
.msgid
- 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 Store
MailException
Message readFirstMessage(java.lang.String path) throws MailException
MailException
- if the store cannot be accessedMessage readNextMessage(java.lang.String path) throws MailException
MailException
- if the store cannot be accessedjava.io.DataInputStream readMessage(Message msg) throws MailException
msg
- The message whose record must be re-read
MailException
- If an error occurs accessing the Storevoid addMessage(java.lang.String path, Message msg) throws MailException
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
StoreException
- If an error occurs accessing the Store
MailException
void saveMessage(java.lang.String path, Message msg) throws MailException
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
StoreException
- If an error occurs accessing the Store
MailException
void removeMessage(java.lang.String path, java.lang.String messageID) throws MailException
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 Store
MailException
int countMessages(java.lang.String path) throws MailException
path
- The complete path of the Folder
containing the
Message
.
StoreException
- If an error occurs accessing the Store
MailException
void setVersion(int version)
version
- is the store versionint getVersion()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |