Hi Sam,
Good question. In my opinion...
If rebindMachine(ConfigKey) is the best name then let's change the
return type to MachineLocation (or to JcloudsMachineLocation?), rather
than living with a worse name moving forwards. Include in the javadoc
what type the response will be if it's an ssh'able machine versus a
windows machine.
If there is a better name, then let's deprecate + create the new method.
I can't think of a better name.
---
This doesn't follow my memory of our deprecation policy (which I'm
failing to find!).
It doesn't look like we've included it in the docs [1], so we should add
that - let's discuss in a separate thread with a different title.
Aled
[1] https://brooklyn.incubator.apache.org/documentation
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