PDAP Public Review Draft

javax.microedition.pim
Class PIM

java.lang.Object
  |
  +--javax.microedition.pim.PIM

public class PIM
extends java.lang.Object

Class for accessing the PIM databases on a device.

Since:
PDAP 1.0

Field Summary
static int READ_ONLY
          Constant representing opening a list in read only mode.
static int READ_WRITE
          Constant representing opening a list in read/write mode.
 
Method Summary
static java.lang.String[] listContactLists()
          Returns a list of all ContactList names.
static java.lang.String[] listEventLists()
          Returns a list of all EventList names.
static java.lang.String[] listToDoLists()
          Returns a list of all ToDoList names.
static ContactList openContactList(int mode)
          Open the default Contact list.
static ContactList openContactList(int mode, java.lang.String name)
          Open a named ContactList.
static EventList openEventList(int mode)
          Open the default Event list.
static EventList openEventList(int mode, java.lang.String name)
          Open a named Event list.
static ToDoList openToDoList(int mode)
          Open the default ToDo list.
static ToDoList openToDoList(int mode, java.lang.String name)
          Open a named ToDo list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_ONLY

public static final int READ_ONLY
Constant representing opening a list in read only mode.

Value 1 is assigned to READ_ONLY.


READ_WRITE

public static final int READ_WRITE
Constant representing opening a list in read/write mode.

Value 2 is assigned to READ_WRITE.

Method Detail

openContactList

public static ContactList openContactList(int mode)
                                   throws PIMException
Open the default Contact list.
Returns:
the default Contact list.
Throws:
PIMException - If the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter.

openContactList

public static ContactList openContactList(int mode,
                                          java.lang.String name)
                                   throws PIMException
Open a named ContactList. Only string names returned by listContactLists() can be used to open a Contact list.
Parameters:
mode - how to open the ContactList, either READ or READ_WRITE
name - the named ContactList to open
Returns:
the named ContactList.
Throws:
PIMException - If the list is not available, the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter or if name is null.

listContactLists

public static java.lang.String[] listContactLists()
Returns a list of all ContactList names. If there are no Contact Lists, a zero length String array is returned. The first name in the list is the name of the default Contact List.
Returns:
a list of named ContactLists
Throws:
java.lang.SecurityException - if the application is not given permission to read contact lists.

openEventList

public static EventList openEventList(int mode)
                               throws PIMException
Open the default Event list.
Returns:
the default ToDo list.
Throws:
PIMException - If the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter.

openEventList

public static EventList openEventList(int mode,
                                      java.lang.String name)
                               throws PIMException
Open a named Event list. Only string names returned by listEventLists() can be used to open an Event list.
Parameters:
mode - how to open the EventList, either READ or READ_WRITE
name - the named EventList to open
Returns:
the named EventList.
Throws:
PIMException - If the list is not available, the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter or if name is null.

listEventLists

public static java.lang.String[] listEventLists()
Returns a list of all EventList names. If there are no Event Lists, a zero length String array is returned. The first name in the list is the name of the default Event List.
Returns:
a list of named EventLists.
Throws:
java.lang.SecurityException - if the application is not given permission to read event lists.

openToDoList

public static ToDoList openToDoList(int mode)
                             throws PIMException
Open the default ToDo list.
Parameters:
mode - how to open the ToDoList, either READ or READ_WRITE
Returns:
the default ToDo list.
Throws:
PIMException - If the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter.

openToDoList

public static ToDoList openToDoList(int mode,
                                    java.lang.String name)
                             throws PIMException
Open a named ToDo list. Only string names returned by listToDoLists() can be used to open a ToDo list.
Parameters:
mode - how to open the ToDoList, either READ or READ_WRITE
name - the named ToDoList to open
Returns:
the named ToDo list.
Throws:
PIMException - If the list is not available, the operation is unsupported or an error occurs.
java.lang.SecurityException - if the application is not given permission that matches the requested mode.
java.lang.IllegalArgumentException - If an invalid mode is provided as a parameter or if name is null.

listToDoLists

public static java.lang.String[] listToDoLists()
Returns a list of all ToDoList names. If there are no ToDo Lists, a zero length String array is returned. The first name in the list is the name of the default ToDo List.
Returns:
a list of named ToDoLists.
Throws:
java.lang.SecurityException - if the application is not given permission to read to do lists.

PDAP 1.0 Spec, Rev. 0.16