|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
This interface defines a hierarchical object store and its access protocol.
It can be used to store and retrieve Folder
items and the
contained child items.
A Folder
child is represented as a generic Serializable object
in order to store any kind of data, including:
AccountFolder
items;Folder
items;Message
items.
Field Summary | |
---|---|
static int |
LATEST_VERSION
Latest version |
static int |
VERSION_101
Store available versions |
static int |
VERSION_102
|
static int |
VERSION_103
|
static int |
VERSION_104
|
static int |
VERSION_105
|
Method Summary | |
---|---|
int |
addChild(java.lang.String path,
RmsRecordItem child)
This method add a new child to a Folder . |
Folder |
addFolder(Folder folder)
Add a new Folder to the Store . |
int |
countChilds(java.lang.String path)
This method returns the count of childs in a Folder . |
int |
countChilds(java.lang.String path,
char prefix)
This method returns the count of childs in a Folder . |
Folder[] |
findFolders(java.lang.String path)
Retrieves a Folder in this Store that matches the provided
substring. |
java.lang.String[] |
getChildIDs(java.lang.String path)
This method returns the array of the childs IDs contained in a Folder . |
ChildrenEnumeration |
getChildren(java.lang.String path)
Get the ChildrenEnumeration related to the given path. |
Folder |
getFolder(java.lang.String path)
Retrieves a Folder object by path. |
Folder |
getFolder(java.lang.String path,
boolean lightFolder)
Retrieves a Folder object by 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 store. |
Folder[] |
list()
Retrieves the list of all the folders directly under this Store. |
Folder[] |
list(java.lang.String path)
Returns the list of the subfolders contained under the specified Folder . |
RmsRecordItem |
readChild(java.lang.String path,
java.lang.String childId)
This method reads a Folder from the Store, using the child
id. |
java.io.DataInputStream |
readChildBytes(java.lang.String path,
java.lang.String childId)
This method returns the InputStream of a Folder child. |
void |
removeChild(java.lang.String path,
java.lang.String childId)
This method removes a Folder child from the Store. |
boolean |
removeFolder(Folder folder,
boolean recursive)
Removes a Folder from the record store. |
void |
removeFolder(java.lang.String folderPath)
Recursively removes a Folder given the Folder
name |
java.lang.String |
retrieveSubfolderID(java.lang.String subfolderPath,
java.lang.String parentPath)
Retrieve a subfolder from a folder record store and return its record id. |
void |
setVersion(int version)
This method sets the version of the Store which is currently being used on the device. |
void |
updateChild(java.lang.String path,
RmsRecordItem child)
This method updates an existing Folder child in the Store. |
Field Detail |
---|
static final int VERSION_101
static final int VERSION_102
static final int VERSION_103
static final int VERSION_104
static final int VERSION_105
static final int LATEST_VERSION
Method Detail |
---|
void init(boolean reset) throws MailException
reset
- If true, erase and re-create all the store.
MailException
Folder[] list()
null
if the store is empty.Folder[] list(java.lang.String path) throws MailException
Folder
.
path
- The path of the parent Folder
.
null
if path
has no subfolders.
MailException
- If the path is not valid.Folder addFolder(Folder folder) throws MailException
Folder
to the Store
.
folder
- The Folder
item to be stored.
Folder
reference
MailException
- If an error occurs on the store (e.g. no space
left).boolean removeFolder(Folder folder, boolean recursive) throws MailException
Folder
from the record store. The removal can be
recursive, if the Folder
contains subfolders and the
removal is not recursive, the method will fail.
folder
- The Folder
to be removed. Use
getFolder
to retrieve the Folder
from its path.recursive
- Perform a recursive removal.
true
if the Folder
has been actually
deleted, false
if the Folder
did not
exist.
MailException
- If an error occurs on the store.void removeFolder(java.lang.String folderPath) throws MailException
Folder
given the Folder
name
folderPath
- the path of the Folder
to be removed
MailException
- if a storage error occursFolder getFolder(java.lang.String path) throws MailException
Folder
object by path.
path
- The path to the Folder in the device's file system
Folder
object.
MailException
- If an error occurs accessing the Store.Folder getFolder(java.lang.String path, boolean lightFolder) throws MailException
Folder
object by path.
path
- The path to the Folder in the device's file systemlightFolder
- If true return the Folder
item without
reading its properties (e.g. role, creation date). It doesn't check
if it really exists in the Store.
Folder
object.
MailException
- If an error occurs accessing the Store.Folder[] findFolders(java.lang.String path)
Folder
in this Store that matches the provided
substring.
path
- The partial path in the device's file system to the searched
Folder
.
Folder
objects whose path matches the
provided substring, or null
if there are no matches.java.lang.String retrieveSubfolderID(java.lang.String subfolderPath, java.lang.String parentPath)
subfolderPath
- The path to the subfolderparentPath
- The path to the parent folder
null
if it's not foundjava.lang.String[] getChildIDs(java.lang.String path) throws MailException
Folder
.
path
- The complete path of the Folder
.
null
if
the Folder
is empty.
MailException
- If an error occurs accessing the Store.RmsRecordItem readChild(java.lang.String path, java.lang.String childId) throws MailException
Folder
from the Store, using the child
id.
path
- The complete path of the Folder
containing the
child.childId
- The child unique ID.
RmsRecordItem
object corresponding to the
childId.
MailException
- If an error occurs accessing the Store.java.io.DataInputStream readChildBytes(java.lang.String path, java.lang.String childId) throws MailException
Folder
child.
path
- The complete path of the Folder
containing the
child.childId
- The child unique ID.
DataInputStream
corresponding to the childId.
MailException
- If an error occurs accessing the Store.ChildrenEnumeration getChildren(java.lang.String path) throws MailException
ChildrenEnumeration
related to the given path.
path
- The path for which the ChildrenEnumeration
shall
be returned.
ChildrenEnumeration
.
MailException
- If an error occurs accessing the Store.int addChild(java.lang.String path, RmsRecordItem child) throws MailException
Folder
.
path
- The complete path of the Folder
.child
- The RmsRecordItem
child to save.
MailException
- If an error occurs accessing the Store.void updateChild(java.lang.String path, RmsRecordItem child) throws MailException
Folder
child in the Store.
path
- The complete path of the Folder
containing the
child.child
- The RmsRecordItem
child to save.
MailException
- If an error occurs accessing the Store.void removeChild(java.lang.String path, java.lang.String childId) throws MailException
Folder
child from the Store.
path
- The complete path of the Folder
containing the
child.childId
- A string representing the unique child ID.
MailException
- If an error occurs accessing the Store.int countChilds(java.lang.String path) throws MailException
Folder
.
path
- The complete path of the Folder
.
MailException
- If an error occurs accessing the Store.int countChilds(java.lang.String path, char prefix) throws MailException
Folder
. Only
childs with the specified prefix will be counted.
path
- The complete path of the Folder
.prefix
- The childs type to be counted.
MailException
- If an error occurs accessing the Store.void setVersion(int version)
version
- The store version.int getVersion()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |