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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user