We need a way to interface to multiple providers.
Since all providers expose the same basic interface (defined in the
`vmmmad.provider.NodeProvider` class), then we can apply the
"Composite" pattern here.
Please draft code for a `MultiProvider` class:
- the class is initialized with instances of `NodeProvider` classes
(e.g., an `SmscgProvider` plus an `EC2Provider`)
- when the `start_vm` method is invoked the `MultiProvider` decides
which of the registered providers should be used for actually
starting the VM. Since this decision is a matter of policy, a
suitable "policy" interface should be designed, so that sysadmins
can implement any policy they like by subclassing the
`MultiProvider` and overriding the "policy methods".
- when the `stop_vm` or `update_vm` methods are invoked, the call is
simply routed to the real provider that actually instanciated the
VM.
Original issue reported on code.google.com by riccardo.murri@gmail.com on 26 Apr 2012 at 10:07
Original issue reported on code.google.com by
riccardo.murri@gmail.com
on 26 Apr 2012 at 10:07