OLD | NEW |
1 // Copyright 2013 Canonical Ltd. | 1 // Copyright 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package state | 4 package state |
5 | 5 |
6 import ( | 6 import ( |
7 "fmt" | 7 "fmt" |
8 "reflect" | 8 "reflect" |
9 "strings" | 9 "strings" |
10 | 10 |
| 11 "github.com/juju/errors" |
11 "labix.org/v2/mgo" | 12 "labix.org/v2/mgo" |
12 | 13 |
13 "launchpad.net/juju-core/errors" | |
14 "launchpad.net/juju-core/state/api/params" | 14 "launchpad.net/juju-core/state/api/params" |
15 "launchpad.net/juju-core/state/multiwatcher" | 15 "launchpad.net/juju-core/state/multiwatcher" |
16 "launchpad.net/juju-core/state/watcher" | 16 "launchpad.net/juju-core/state/watcher" |
17 ) | 17 ) |
18 | 18 |
19 // allWatcherStateBacking implements allWatcherBacking by | 19 // allWatcherStateBacking implements allWatcherBacking by |
20 // fetching entities from the State. | 20 // fetching entities from the State. |
21 type allWatcherStateBacking struct { | 21 type allWatcherStateBacking struct { |
22 st *State | 22 st *State |
23 // collections | 23 // collections |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 // in, such as settings changes to entities we don't care about. | 566 // in, such as settings changes to entities we don't care about. |
567 err := c.FindId(change.Id).One(doc) | 567 err := c.FindId(change.Id).One(doc) |
568 if err == mgo.ErrNotFound { | 568 if err == mgo.ErrNotFound { |
569 return doc.removed(b.st, all, change.Id) | 569 return doc.removed(b.st, all, change.Id) |
570 } | 570 } |
571 if err != nil { | 571 if err != nil { |
572 return err | 572 return err |
573 } | 573 } |
574 return doc.updated(b.st, all, change.Id) | 574 return doc.updated(b.st, all, change.Id) |
575 } | 575 } |
OLD | NEW |