> + *
> + * @author Epi Vou
> + */
> +@Singleton
> +public class BindConsoleToJsonPayload extends BindToJsonPayload {
> +
> + @Inject
> + public BindConsoleToJsonPayload(Json jsonBinder) {
> + super(jsonBinder);
> + }
> +
> + @Override
> + public <R extends HttpRequest> R bindToRequest(R request, Map<String,
> Object> postParams) {
> + String action = null;
> +
> + Console.Type type = (Console.Type) postParams.get("type");
I use the MapBinder because depending on the value of the Console type
("novnc", "xvpvnc", "spice-html5", "rdp-html5"), we need to wrap the json
object with different values ("os-getVNCConsole" when type is "novnc" or
"xvpvnc", "os-getVNCConsole" when type is "spice-html5", and "os-getVNCConsole"
when type is "rdp-html5".
There are comments above, where @nacx recommends using a custom MapBinder, and
I do not see a simpler way of accomplishing this.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13025507