if (resourceSupport.getApiRevision() == null) { throw new IllegalStateException("Incompatible version of Data Flow server detected.\n" + "Follow instructions in the documentation for the version of the server you are " + "Documentation can be accessed at http://cloud.spring.io/spring-cloud-dataflow/"); String serverRevision = resourceSupport.getApiRevision().toString(); if (!String.valueOf(Version.REVISION).equals(serverRevision)) { String downloadURL = getLink(resourceSupport, "dashboard").getHref() + "#about"; this.aboutOperations = new AboutTemplate(restTemplate, resourceSupport.getLink(AboutTemplate.ABOUT_REL)); if (resourceSupport.hasLink(StreamTemplate.DEFINITIONS_REL)) { this.streamOperations = new StreamTemplate(restTemplate, resourceSupport, getVersion()); this.runtimeOperations = new RuntimeTemplate(restTemplate, resourceSupport); if (resourceSupport.hasLink(CounterTemplate.COUNTER_RELATION)) { this.counterOperations = new CounterTemplate(restTemplate, resourceSupport); this.fieldValueCounterOperations = new FieldValueCounterTemplate(restTemplate, resourceSupport); if (resourceSupport.hasLink(TaskTemplate.DEFINITIONS_RELATION)) { this.taskOperations = new TaskTemplate(restTemplate, resourceSupport, getVersion()); this.jobOperations = new JobTemplate(restTemplate, resourceSupport); if(resourceSupport.hasLink(SchedulerTemplate.SCHEDULES_RELATION)) { this.schedulerOperations = new SchedulerTemplate(restTemplate, resourceSupport); resourceSupport.getLink("completions/stream"), resourceSupport.getLink("completions/task"));
RootResource root = new RootResource(Version.REVISION); root.add(ControllerLinkBuilder.linkTo(UiController.class).withRel("dashboard")); root.add(ControllerLinkBuilder.linkTo(AuditRecordController.class).withRel("audit-records")); root.add(entityLinks.linkToCollectionResource(StreamDefinitionResource.class) .withRel("streams/definitions")); root.add( unescapeTemplateVariables(entityLinks.linkToSingleResource(StreamDefinitionResource.class, "{name}") .withRel("streams/definitions/definition"))); root.add(unescapeTemplateVariables(entityLinks.linkToSingleResource(StreamAppStatusResource.class, "{name}") .withRel("streams/validation"))); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(RuntimeStreamsController.class).streamStatus(null)).withRel("runtime/streams")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(RuntimeAppsController.class).list(null, null)).withRel("runtime/apps")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(RuntimeAppsController.class).display(null)).withRel("runtime/apps/{appId}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(RuntimeAppInstanceController.class).list(null, null, null)).withRel("runtime/apps/{appId}/instances")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(RuntimeAppInstanceController.class).display(null, null)).withRel("runtime/apps/{appId}/instances/{instanceId}")); root.add(ControllerLinkBuilder.linkTo(StreamDeploymentController.class).withRel("streams/deployments")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).deploy(null, null)).withRel("streams/deployments/{name}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).history(null)).withRel("streams/deployments/history/{name}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).manifest(null, null)).withRel("streams/deployments/manifest/{name}/{version}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).platformList()).withRel("streams/deployments/platform/list")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).rollback(null, null)).withRel("streams/deployments/rollback/{name}/{version}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(StreamDeploymentController.class).update(null, null)).withRel("streams/deployments/update/{name}"));
RootResource root = new RootResource(Version.REVISION); root.add(ControllerLinkBuilder.linkTo(UiController.class).withRel("dashboard")); root.add(ControllerLinkBuilder.linkTo(AuditRecordController.class).withRel("audit-records")); root.add(entityLinks.linkToCollectionResource(StreamDefinitionResource.class) .withRel("streams/definitions")); root.add( unescapeTemplateVariables(entityLinks.linkToSingleResource(StreamDefinitionResource.class, "{name}") .withRel("streams/definitions/definition"))); root.add(unescapeTemplateVariables(entityLinks.linkToSingleResource(StreamAppStatusResource.class, "{name}") .withRel("streams/validation"))); root.add(entityLinks.linkToCollectionResource(AppStatusResource.class).withRel("runtime/apps")); root.add(unescapeTemplateVariables( entityLinks.linkForSingleResource(AppStatusResource.class, "{appId}").withRel("runtime/apps/app"))); root.add(unescapeTemplateVariables( entityLinks.linkFor(AppInstanceStatusResource.class, "{appId}") .withRel("runtime/apps/instances"))); root.add(ControllerLinkBuilder.linkTo(MetricsController.class).withRel("metrics/streams")); root.add(ControllerLinkBuilder.linkTo(SkipperStreamDeploymentController.class).withRel("streams/deployments")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).deploy(null, null)).withRel("streams/deployments/{name}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).history(null)).withRel("streams/deployments/history/{name}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).manifest(null, null)).withRel("streams/deployments/manifest/{name}/{version}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).platformList()).withRel("streams/deployments/platform/list")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).rollback(null, null)).withRel("streams/deployments/rollback/{name}/{version}")); root.add(ControllerLinkBuilder.linkTo(ControllerLinkBuilder.methodOn(SkipperStreamDeploymentController.class).update(null, null)).withRel("streams/deployments/update/{name}")); root.add(ControllerLinkBuilder.linkTo(StreamDeploymentController.class).withRel("streams/deployments"));
if (resourceSupport.getApiRevision() == null) { throw new IllegalStateException("Incompatible version of Data Flow server detected.\n" + "Follow instructions in the documentation for the version of the server you are " + "Documentation can be accessed at http://cloud.spring.io/spring-cloud-dataflow/"); String serverRevision = resourceSupport.getApiRevision().toString(); if (!String.valueOf(Version.REVISION).equals(serverRevision)) { String downloadURL = getLink(resourceSupport, "dashboard").getHref() + "#about"; this.aboutOperations = new AboutTemplate(restTemplate, resourceSupport.getLink(AboutTemplate.ABOUT_REL)); if (resourceSupport.hasLink(StreamTemplate.DEFINITIONS_REL)) { this.streamOperations = new StreamTemplate(restTemplate, resourceSupport, getVersion()); this.runtimeOperations = new RuntimeTemplate(restTemplate, resourceSupport); if (resourceSupport.hasLink(CounterTemplate.COUNTER_RELATION)) { this.counterOperations = new CounterTemplate(restTemplate, resourceSupport); this.fieldValueCounterOperations = new FieldValueCounterTemplate(restTemplate, resourceSupport); if (resourceSupport.hasLink(TaskTemplate.DEFINITIONS_RELATION)) { this.taskOperations = new TaskTemplate(restTemplate, resourceSupport, getVersion()); this.jobOperations = new JobTemplate(restTemplate, resourceSupport); if(resourceSupport.hasLink(SchedulerTemplate.SCHEDULES_RELATION)) { this.schedulerOperations = new SchedulerTemplate(restTemplate, resourceSupport); resourceSupport.getLink("completions/stream"), resourceSupport.getLink("completions/task"));