+1
Actually, I'd prefer registerMachine(ConfigBag).
The return type means we can only ever register one machine with this
method. But the name "register" is ambiguous for what is being registered.
Aled
On 18/08/2015 11:05, Alex Heneveld wrote:
Sam-
Some people have been using the word "register" for blueprints which
attach to existing systems to bring them under Brooklyn management. I
like it. "rebind" is currently overloaded as it is used mainly for
items coming from persisted state, and the prefix "re" is misleading
in the case where we are bringing something into Brooklyn for the
first time.
(And I submit that prefix is not present in the word "register"
despite appearances to the contrary!)
So my suggestion would be to add a new method "register(ConfigBag)"
which returns a MachineLocation, and deprecate rebindMachine(...).
Best
Alex
On 17/08/2015 19:03, Sam Corbett wrote:
Hi all,
A fairly technical question. I'd like to understand the implications
of a
problem before I try to fix it.
Brooklyn has a class called JcloudsLocation that is the main point of
interaction with jclouds. Its duty is to orchestrate jclouds to either
provision new machines or to connect to existing ones.
The two main methods for this are:
public MachineLocation obtain(ConfigBag setup) throws
NoMachinesAvailableException
public JcloudsSshMachineLocation rebindMachine(ConfigBag setup) throws
NoMachinesAvailableException
Calling the first of these causes a new machine to be provisioned.
Calling
the latter causes an existing machine to be found and connected to.
Their return types differ. Obtain returns a MachineLocation but rebind a
JcloudsSshMachineLocation. A MachineLocation allows obtain to handle
both
Windows and non-Windows machines. A JcloudsSshMachineLocation can
only be a
non-Windows VM, and thus my problem: rebindMachine cannot be used to
reconnect to a Windows machine. Unfortunately, rebindMachine is publicly
accessible. There are a number of cases within Brooklyn that expect
to get
a JcloudsSshMachineLocation and probably more in downstream projects.
Do I have any other option than to deprecate all of the methods named
`rebindMachine` in favour of a new method named something slightly
different that returns a MachineLocation? Or can I get away with
changing
the signature of the method (as was done to obtain earlier this year)?
Sam