*/
abstract public function setHeartbeatInterval($heartbeat);
+ /**
+ * List all devices that we know about.
+ *
+ * @return array An array of device hashes
+ * @throws Horde_ActiveSync_Exception
+ */
+ abstract public function listDevices();
+
+ /**
+ * Get the last time a particular device issued a SYNC request.
+ *
+ * @param string $devId The device id
+ *
+ * @return integer The timestamp of the last sync, regardless of collection
+ * @throws Horde_ActiveSync_Exception
+ */
+ abstract public function getLastSyncTimestamp($devId);
+
}
\ No newline at end of file
$this->_gc($syncKey, true);
}
+ public function listDevices()
+ {
+ throw new Horde_ActiveSync_Exception('Not Implemented');
+ }
+
+ /**
+ * Get the last time a particular device issued a SYNC request.
+ *
+ * @param string $devId The device id
+ *
+ * @return integer The timestamp of the last sync, regardless of collection
+ * @throws Horde_ActiveSync_Exception
+ */
+ public function getLastSyncTimestamp($devId)
+ {
+ throw new Horde_ActiveSync_Exception('Not Implemented');
+ }
+
/**
* Garbage collector - clean up from previous sync
* requests.
public function deviceExists($devId)
{
$query = 'SELECT COUNT(*) FROM ' . $this->_syncDeviceTable . ' WHERE device_id = ?';
-
try {
return $this->_db->selectValue($query, array($devId));
} catch (Horde_Db_Exception $e) {
}
/**
+ * List all devices that we know about.
+ *
+ * @return array An array of device hashes
+ * @throws Horde_ActiveSync_Exception
+ */
+ public function listDevices()
+ {
+ $sql = 'SELECT * from ' . $this->_syncDeviceTable;
+ try {
+ return $this->_db->selectAll($sql);
+ } catch (Horde_Db_Exception $e) {
+ throw new Horde_ActiveSync_Exception($e);
+ }
+ }
+
+ /**
+ * Get the last time a particular device issued a SYNC request.
+ *
+ * @param string $devId The device id
+ *
+ * @return integer The timestamp of the last sync, regardless of collection
+ * @throws Horde_ActiveSync_Exception
+ */
+ public function getLastSyncTimestamp($devId)
+ {
+ $sql = 'SELECT sync_time FROM ' . $this->_syncStateTable . ' WHERE sync_devid = ?';
+ try {
+ return $this->_db->selectValue($sql, array($devId));
+ } catch (Horde_Db_Exception $e) {
+ throw new Horde_ActiveSync_Exception($e);
+ }
+ }
+
+ /**
* Load a specific collection's ping state. Ping state must already have
* been loaded.
*