public SpringXDTemplate(ClientHttpRequestFactory factory, URI baseURI) {
super(factory);
XDRuntime xdRuntime = restTemplate.getForObject(baseURI, XDRuntime.class);
resources.put("streams/definitions", new UriTemplate(xdRuntime.getLink("streams").getHref() + "/definitions"));
resources.put("streams/deployments", new UriTemplate(xdRuntime.getLink("streams").getHref() + "/deployments"));
resources.put("jobs", new UriTemplate(xdRuntime.getLink("jobs").getHref()));
resources.put("jobs/definitions", new UriTemplate(xdRuntime.getLink("jobs").getHref() + "/definitions"));
resources.put("jobs/deployments", new UriTemplate(xdRuntime.getLink("jobs").getHref() + "/deployments"));
resources.put("modules", new UriTemplate(xdRuntime.getLink("modules").getHref()));
resources.put("jobs/configurations", new UriTemplate(xdRuntime.getLink("jobs/configurations").getHref()));
resources.put("jobs/executions", new UriTemplate(xdRuntime.getLink("jobs/executions").getHref()));
resources.put("jobs/instances", new UriTemplate(xdRuntime.getLink("jobs/instances").getHref()));
resources.put("runtime/containers", new UriTemplate(xdRuntime.getLink("runtime/containers").getHref()));
resources.put("runtime/modules", new UriTemplate(xdRuntime.getLink("runtime/modules").getHref()));
resources.put("completions/stream", new UriTemplate(xdRuntime.getLink("completions/stream").getHref()));
resources.put("completions/job", new UriTemplate(xdRuntime.getLink("completions/job").getHref()));
resources.put("completions/module", new UriTemplate(xdRuntime.getLink("completions/module").getHref()));
resources.put("counters", new UriTemplate(xdRuntime.getLink("counters").getHref()));
resources.put("field-value-counters", new UriTemplate(xdRuntime.getLink("field-value-counters").getHref()));
resources.put("aggregate-counters", new UriTemplate(xdRuntime.getLink("aggregate-counters").getHref()));
resources.put("gauges", new UriTemplate(xdRuntime.getLink("gauges").getHref()));
resources.put("rich-gauges", new UriTemplate(xdRuntime.getLink("rich-gauges").getHref()));
streamOperations = new StreamTemplate(this);
jobOperations = new JobTemplate(this);
counterOperations = new CounterTemplate(this);