Mercurial > libervia-pubsub
comparison idavoll/storage.py @ 142:812300cdbc22
Changed behaviour of retraction of items so that only the actually deleted
item ids are returned, and no exception is raised for items that didn't
actually exists.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Tue, 12 Jul 2005 09:23:00 +0000 |
parents | b27a66637a10 |
children | f393bccec4bc |
comparison
equal
deleted
inserted
replaced
141:d2c18d88f618 | 142:812300cdbc22 |
---|---|
13 | 13 |
14 class SubscriptionNotFound(Error): | 14 class SubscriptionNotFound(Error): |
15 pass | 15 pass |
16 | 16 |
17 class SubscriptionExists(Error): | 17 class SubscriptionExists(Error): |
18 pass | |
19 | |
20 class ItemNotFound(Error): | |
21 pass | 18 pass |
22 | 19 |
23 class IStorage(Interface): | 20 class IStorage(Interface): |
24 """ Storage interface """ | 21 """ Storage interface """ |
25 | 22 |
201 | 198 |
202 def remove_items(self, item_ids): | 199 def remove_items(self, item_ids): |
203 """ Remove items by id | 200 """ Remove items by id |
204 | 201 |
205 @param item_ids: L{list} of item ids. | 202 @param item_ids: L{list} of item ids. |
206 @return: deferred that fires when all given items were deleted, or | 203 @return: deferred that fires with a L{list} of ids of the items that |
207 a failure if one of them was not found. | 204 were deleted |
208 """ | 205 """ |
209 | 206 |
210 def get_items(self, max_items=None): | 207 def get_items(self, max_items=None): |
211 """ Get items. | 208 """ Get items. |
212 | 209 |
215 the returned items to a maximum of that number of most recently | 212 the returned items to a maximum of that number of most recently |
216 published items. | 213 published items. |
217 | 214 |
218 @param max_items: if given, a natural number (>0) that limits the | 215 @param max_items: if given, a natural number (>0) that limits the |
219 returned number of items. | 216 returned number of items. |
220 @return: deferred that fires with a C{list} of found items. | 217 @return: deferred that fires with a L{list} of found items. |
221 """ | 218 """ |
222 | 219 |
223 def get_items_by_id(self, item_ids): | 220 def get_items_by_id(self, item_ids): |
224 """ Get items by item id. | 221 """ Get items by item id. |
225 | 222 |
226 Each item in the returned list is a unicode string that | 223 Each item in the returned list is a unicode string that |
227 represent the XML of the item as it was published, including the | 224 represent the XML of the item as it was published, including the |
228 item wrapper with item id. | 225 item wrapper with item id. |
229 | 226 |
230 @param item_ids: L{list} of item ids. | 227 @param item_ids: L{list} of item ids. |
231 @return: deferred that fires with a C{list} of found items. | 228 @return: deferred that fires with a L{list} of found items. |
232 """ | 229 """ |
233 | 230 |
234 def purge(self): | 231 def purge(self): |
235 """ Purge node of all items in persistent storage. | 232 """ Purge node of all items in persistent storage. |
236 | 233 |