Fixed compilation error due to new v2 client changes

2.4.0 version of the v2 client operations now returns a list of
ServiceInstanceSummary rather than ServiceInstance
This commit is contained in:
nsingh
2017-02-06 10:47:55 -08:00
parent 1e76cda38d
commit 6b93599ee8
2 changed files with 9 additions and 5 deletions

View File

@@ -24,4 +24,9 @@ public class CFEntities {
return new CFServiceInstanceImpl(name, service, plan, documentationUrl, description, dashboardUrl);
}
public static CFServiceInstance createServiceInstance(String name, String service, String plan) {
return new CFServiceInstanceImpl(name, service, plan, /* doc url */ null, /* description */ null,
/* dasboard Url */ null);
}
}

View File

@@ -12,6 +12,7 @@ package org.springframework.ide.vscode.commons.cloudfoundry.client.v2;
import org.cloudfoundry.operations.buildpacks.Buildpack;
import org.cloudfoundry.operations.services.ServiceInstance;
import org.cloudfoundry.operations.services.ServiceInstanceSummary;
import org.cloudfoundry.operations.services.ServiceInstanceType;
import org.springframework.ide.vscode.commons.cloudfoundry.client.CFBuildpack;
import org.springframework.ide.vscode.commons.cloudfoundry.client.CFEntities;
@@ -31,15 +32,13 @@ public class CFWrappingV2 {
return CFEntities.createBuildpack(name);
}
public static CFServiceInstance wrap(ServiceInstance serviceInstance) {
public static CFServiceInstance wrap(ServiceInstanceSummary serviceInstance) {
String name = serviceInstance.getName();
String plan = serviceInstance.getPlan();
String dashboardUrl = serviceInstance.getDashboardUrl();
String service = serviceInstance.getType() == ServiceInstanceType.USER_PROVIDED ? "user-provided"
: serviceInstance.getService();
String description = serviceInstance.getDescription();
String documentationUrl = serviceInstance.getDocumentationUrl();
return CFEntities.createServiceInstance(name, service, plan, documentationUrl, description, dashboardUrl);
return CFEntities.createServiceInstance(name, service, plan);
}
}