com.sun.kvem.midp.pim |
PIM implementation (15-Feb-2005)
PIM implementation.
Porting information
PIM persistent storage is based on FileConnection filesystem in this implementation (PIM and FC are
both parts of JSR75). Therefore, JSR 75 porting is not requires aby changes in PIM package in most cases.
If it's necessary to use another storage (for instance, any native database), only file PIMDatabase.java
should be changed. This file contains the interface to persistent storage.
The table below contains methods of the
class PIMDatabase which could be redesigned on porting stage.
Task |
Method |
Description |
Persistent storage initialization |
public PIMDatabase(String dir) throws IOException |
The initialization code is placed in constructor of the main class that is PIMDatabase. This
constructor has one parameter: the root directory for PIM data. Implementation can ignore this
parameter if device doesn't support directories. At this stage implementation should check
the integrity of PIM data and execute need initialization procedures. |
Getting the set of all list names for the given list type |
public String[] getListNames(int listType) |
Method must contain a code that
returns PIM list names for the given PIM list type from PIM persistent storage. |
Default list names |
public String getDefaultListName(int listType) |
Every list type (Contact, Event and Todo) must have a default list name in the PIM persistent storage.
Method must return the default name for the list type. |
Keys table |
public Hashtable getKeys(int listType, String listName)
throws PIMException |
Every PIM item in the any list must have an unique key for manipulation.
Method returns a hashtable of keys by giving
list type and name. Current implementation uses file names as keys, while porting this code could be changed. |
Getting PIMItem by key |
public byte[] getElement(int listType, String listName, String key)
throws PIMException |
Method returns the byte array
representation of PIM item by given list type, name and key. |
Commiting PIM item |
public synchronized String commitElement(int listType, String listName,
String key, byte[] data) throws PIMException |
Method really saves the byte array representation of PIM item
to the persistent storage and assigns a new key value to it. If storage already contains
a PIM item of the same type, name and key, it must be overwritten. |
Saving list of categories |
public synchronized void setCategories(int listType, String listName,
String categories) throws PIMException |
Method saves (overwrites if it already exists) the list of categories for given
list type into PIM persistent storage. Parameter categories of this method contains
symbolic names of categories separated by '\n'. |
Getting list of categories |
public synchronized String getCategories(int listType, String listName) throws PIMException |
Method returns
the category list from PIM persistent storage. Format of the returning string must be the same as
categories parameter in setCategories method. |
@since PIM1.0
|
Java Source File Name | Type | Comment |
AbstractPIMItem.java | Class | Partial implementation of PIMItem. |
AbstractPIMList.java | Class | Generic PIM list. |
Contact.java | Interface | Represents a single Contact entry in a PIM Contact database.
The supported field list for a Contact is also a subset of the fields defined
by the vCard specification from the Internet Mail Consortium
(http://www.imc.org). |
ContactImpl.java | Class | Implementation of a PIM contact. |
ContactListImpl.java | Class | Class ContactListImpl implements methods of PIM interface ContactList. |
EmptyPIMField.java | Class | |
Event.java | Interface | Represents a single Event entry in a PIM Event database.
The fields are a subset of the fields in the vEvent object
defined by the vCalendar 1.0 specification from the Internet Mail Consortium
(http://www.imc.org). |
EventImpl.java | Class | Implementation of a PIM Event. |
EventListImpl.java | Class | Class EventListImpl implements methods of PIM interface EventList. |
KeySortUtility.java | Class | Class KeySortUtility contains static method "store" only. |
LineReader.java | Class | Reader that knows how to read non-blank lines. |
MarkableInputStream.java | Class | InputStream that supports mark() with an infinite lookahead. |
PIMAttribute.java | Class | Specification of a PIM attribute. |
PIMBridge.java | Class | Implementations of shared PIM code. |
PIMDatabase.java | Class | Handles reading and writing PIM data. |
PIMField.java | Interface | Representation of a PIM field. |
PIMFieldDescriptor.java | Class | Specification of a PIM field. |
PIMFormat.java | Interface | Interface for PIM data encoders and decoders. |
PIMHandler.java | Class | Porting layer for PIM functionality. |
PIMImpl.java | Class | Implementation of PIM. |
PIMItem.java | Interface | Represents the common interfaces of an item for a PIM list.
A PIM item represents a collection of data for a single PIM entry.
A PIM item is created from a particular PIM list and is associated with
that list for the life of the item. |
PIMProxy.java | Class | Porting layer implementation for PIM functionality. |
ScalarPIMField.java | Class | |
SupportedPIMFields.java | Class | Index of supported PIM fields and their descriptors. |
ToDo.java | Interface | Represents a single To Do item in a PIM To Do database.
The fields are a subset of the fields in VTODO defined by the
vCalendar specification from the Internet Mail Consortium
(http://www.imc.org). |
ToDoImpl.java | Class | Implementation of a PIM ToDo. |
ToDoListImpl.java | Class | Class ToDoListImpl implements methods of PIM interface ToDoList. |
UnsupportedPIMFormatException.java | Class | Exception thrown when a file is not recognized by an encoding. |
VectorPIMField.java | Class | |