|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.storage.AbstractRecordStore
com.funambol.storage.BlackberryRecordStore
public class BlackberryRecordStore
Nested Class Summary | |
---|---|
class |
BlackberryRecordStore.IntByteArrayPair
Used to keep key-object pairs together when sorting. |
Method Summary | |
---|---|
int |
addRecord(byte[] data,
int offset,
int numBytes)
Adds a new record to the record store. |
void |
closeRecordStore()
|
void |
deleteRecord(int recordId)
Deletes a record from the record store. |
static void |
deleteRecordStore(java.lang.String recordStoreName)
Deletes the named record store. |
javax.microedition.rms.RecordEnumeration |
enumerateRecords(javax.microedition.rms.RecordFilter filter,
javax.microedition.rms.RecordComparator comparator,
boolean keepUpdated)
|
net.rim.device.api.util.IntVector |
filterAndSort(javax.microedition.rms.RecordFilter filter,
javax.microedition.rms.RecordComparator comparator)
|
java.lang.String |
getName()
|
int |
getNextRecordID()
Returns the recordId that will be assigned to the next object added to the store. |
int |
getNumRecords()
Returns the number of records currently in the store |
byte[] |
getRecord(int recordId)
Returns a copy of the data stored in the given record. |
int |
getRecord(int recordId,
byte[] buffer,
int offset)
Returns a copy of the data stored in the given record. |
int |
getRecordSize(int recordId)
Returns the size in bytes of the data available for the given recordId. |
int |
getSize()
Gets the size in bytes of the current store. |
int |
getSizeAvailable()
Returns the amount of additional space in bytes this store can hold |
static void |
init(ObjectWrapperHandler owh)
Initialize the store for blackberry with the default store key and the implemented ObjectWrapperHandler |
static void |
init(ObjectWrapperHandler owh,
java.lang.String key)
Initialize the store for blackberry with custom store key and implemented ObjectWrapperHandler |
static java.lang.String[] |
listRecordStores()
Obtains the names of contained BlackberryRecordStore objects. |
void |
notifyListeners(int operation,
int recordId)
Notifies associated enumerator objects and other listeners that may be added |
static AbstractRecordStore |
openRecordStore(java.lang.String recordStoreName,
boolean createIfNecessary)
Open and possibly create a record store. |
void |
setRecord(int recordId,
byte[] newData,
int offset,
int numBytes)
Sets the data in the given record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void init(ObjectWrapperHandler owh, java.lang.String key)
owh
- the ObjectWrapperHandler to be used with this storekey
- the key of the store to be usedpublic static void init(ObjectWrapperHandler owh)
owh
- the ObjectWrapperHandler to be used with this storepublic static void deleteRecordStore(java.lang.String recordStoreName) throws javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreNotFoundException
recordStoreName
- Name of the record store to delete
javax.microedition.rms.RecordStoreNotFoundException
- If the record store could not be found
javax.microedition.rms.RecordStoreException
- If the record store could not be foundpublic static java.lang.String[] listRecordStores()
public static AbstractRecordStore openRecordStore(java.lang.String recordStoreName, boolean createIfNecessary) throws javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreFullException, javax.microedition.rms.RecordStoreNotFoundException
recordStoreName
- The name of the record store to opencreateIfNecessary
- Whether or not we create the store if it does not exist
javax.microedition.rms.RecordStoreException
- If a record store related exception occured
javax.microedition.rms.RecordStoreFullException
- - If the record store is full
javax.microedition.rms.RecordStoreNotFoundException
- - If the record store could not be foundpublic int addRecord(byte[] data, int offset, int numBytes) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreFullException
addRecord
in class AbstractRecordStore
data
- Byte array to storeoffset
- Starting offset of the passed byte arraynumBytes
- Number of bytes from the offset to save
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not open
javax.microedition.rms.RecordStoreFullException
- If the operation cannot be completed
because the record store is full
javax.microedition.rms.RecordStoreException
- If any record store related exception occurs.public void closeRecordStore() throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.RecordStoreException
closeRecordStore
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.RecordStoreException
public void deleteRecord(int recordId) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException
deleteRecord
in class AbstractRecordStore
recordId
- The recordId to be removed from the store
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is closed
javax.microedition.rms.InvalidRecordIDException
- If the recordId does not exist
javax.microedition.rms.RecordStoreException
- Any other errorpublic javax.microedition.rms.RecordEnumeration enumerateRecords(javax.microedition.rms.RecordFilter filter, javax.microedition.rms.RecordComparator comparator, boolean keepUpdated) throws javax.microedition.rms.RecordStoreNotOpenException
enumerateRecords
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
public net.rim.device.api.util.IntVector filterAndSort(javax.microedition.rms.RecordFilter filter, javax.microedition.rms.RecordComparator comparator) throws javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.RecordStoreNotOpenException
public java.lang.String getName() throws javax.microedition.rms.RecordStoreNotOpenException
getName
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
public int getNextRecordID() throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.RecordStoreException
getNextRecordID
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not open
javax.microedition.rms.RecordStoreException
- If any other record store related exception occurs.public int getNumRecords() throws javax.microedition.rms.RecordStoreNotOpenException
getNumRecords
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not openpublic byte[] getRecord(int recordId) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException
getRecord
in class AbstractRecordStore
recordId
- The ID of the record to use in this operation
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not open
javax.microedition.rms.InvalidRecordIDException
- If the recordId is invalid
javax.microedition.rms.RecordStoreException
- if a general record store exception occurspublic int getRecord(int recordId, byte[] buffer, int offset) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException, java.lang.ArrayIndexOutOfBoundsException
getRecord
in class AbstractRecordStore
recordId
- The ID of the record to use in this operationbuffer
- The byte array in which to copy the dataoffset
- The index into the buffer in which to start copying
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not open
javax.microedition.rms.InvalidRecordIDException
- If the recordId is invalid
javax.microedition.rms.RecordStoreException
- if a general record store exception occurs
java.lang.ArrayIndexOutOfBoundsException
public int getRecordSize(int recordId) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException
getRecordSize
in class AbstractRecordStore
recordId
- RecordId to find the size of
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is closed
javax.microedition.rms.InvalidRecordIDException
- If the recordId does not exist
javax.microedition.rms.RecordStoreException
- Any oher record store exceptionpublic int getSize() throws javax.microedition.rms.RecordStoreNotOpenException
getSize
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
- If the record store is not openpublic int getSizeAvailable() throws javax.microedition.rms.RecordStoreNotOpenException
getSizeAvailable
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
- if the record store is not openpublic void notifyListeners(int operation, int recordId)
operation
- Integer constant corresponding to the action being performedrecordId
- RecordID of the record being manipulated.public void setRecord(int recordId, byte[] newData, int offset, int numBytes) throws javax.microedition.rms.RecordStoreNotOpenException, javax.microedition.rms.InvalidRecordIDException, javax.microedition.rms.RecordStoreException, javax.microedition.rms.RecordStoreFullException
setRecord
in class AbstractRecordStore
javax.microedition.rms.RecordStoreNotOpenException
javax.microedition.rms.InvalidRecordIDException
javax.microedition.rms.RecordStoreException
javax.microedition.rms.RecordStoreFullException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |