1 package sync4j.syncclient.sps; 2 3 import java.util.Enumeration ; 4 import java.util.Vector ; 5 6 import javax.microedition.rms.RecordStore; 7 8 import javax.microedition.pim.Event; 9 import javax.microedition.pim.EventList; 10 import javax.microedition.pim.PIM; 11 import javax.microedition.pim.PIMException; 12 import net.rim.device.api.system.PersistentObject; 13 import net.rim.device.api.system.PersistentStore; 14 import net.rim.device.api.ui.component.Dialog; 15 import net.rim.device.api.util.StringMatch; 16 import sync4j.syncclient.util.StaticDataHelper; 17 18 import sync4j.syncclient.blackberry.parser.ParserFactory; 19 import sync4j.syncclient.blackberry.parser.EventParser; 20 21 28 public abstract class DataStore { 29 31 public static final char RECORD_STATE_NEW = 'N' ; 32 public static final char RECORD_STATE_DELETED = 'D' ; 33 public static final char RECORD_STATE_UPDATED = 'U' ; 34 public static final char RECORD_STATE_UNSIGNED = ' ' ; 35 36 38 public static DataStore getDataStore (String datastoreName) { 39 40 StaticDataHelper stdh = new StaticDataHelper(); 41 42 if (stdh.getContactSourceUri().equals(datastoreName)) { 43 return new ContactDataStore (); 44 } else { 45 return new EventDataStore (); 46 } 47 } 48 49 54 public abstract void setLastTimestamp(long lastTimestamp) 55 throws DataAccessException; 56 57 58 62 public abstract long getLastTimestamp() 63 throws DataAccessException; 64 65 71 public abstract Record setRecord(Record record, boolean modify) 72 throws DataAccessException; 73 74 79 public abstract void deleteRecord(Record record) 80 throws DataAccessException; 81 82 88 public abstract Vector getNoDeletedRecords() 89 throws DataAccessException; 90 91 public abstract Vector getRecords(char state) 92 throws DataAccessException; 93 94 public abstract void startDSOperations(); 95 96 104 public abstract void commitDSOperations() 105 throws DataAccessException; 106 107 } 108 | Popular Tags |