jclouds/jclouds-chef — pull request #59 by nacx (2013-01-20 12:30:07+00:00)
Title: Issue #54: Allow to override attributes in node bootstrap

Added the following methods in the `ChefServive` to allow to configure the entire bootstrap configuration for a node:

```java
public void updateBootstrapConfigForGroup(Iterable runList, JsonBall jsonAttributes, String group);
public JsonBall getBootstrapConfigForGroup(String group);
```

Note on the use of the `JsonBall` object:

I've tried to avoid using it, by using a `Map` (which would be more convenient) but that gives some problems. Gson by default parses int values as longs, adding always the floating point (see [1]). This causes issues when deserializing integer values such as listening ports.

To avoid this, we should have a specific object to deserialize the Json to, but since Json structures can be arbitrary and completely different for each recipe, we can not preconfigure that.
Another approach would be to use a plain `String`, but given the fact that what needs to be provided is indeed a Json string, and having a `String` type won't save us the extra Json parsing using Gson, I found it more readable to use `JsonBall` in this case.

We can address the use of the `JsonBall`object in future issues (this is not related to issue #54), taking into account the integer vs long type limitation. @adriancole do you agree?

/cc @carlpulley

[1] http://stackoverflow.com/questions/12067206/gson-force-use-int-instead-of-double