Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.CloudFoundryClient;
import org.cloudfoundry.client.v2.organizations.ListOrganizationsRequest;
import org.cloudfoundry.client.v2.organizations.OrganizationResource;
import org.cloudfoundry.client.v2.spaces.ListSpacesRequest;
import org.cloudfoundry.client.v2.spaces.SpaceResource;
import org.cloudfoundry.client.v3.organizations.ListOrganizationsRequest;
import org.cloudfoundry.client.v3.organizations.OrganizationResource;
import org.cloudfoundry.client.v3.spaces.ListSpacesRequest;
import org.cloudfoundry.client.v3.spaces.SpaceResource;
import org.cloudfoundry.doppler.DopplerClient;
import org.cloudfoundry.networking.NetworkingClient;
import org.cloudfoundry.operations.advanced.Advanced;
Expand Down Expand Up @@ -56,7 +56,6 @@
import org.cloudfoundry.uaa.UaaClient;
import org.cloudfoundry.util.ExceptionUtils;
import org.cloudfoundry.util.PaginationUtils;
import org.cloudfoundry.util.ResourceUtils;
import org.immutables.value.Value;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -211,7 +210,7 @@ Mono<String> getOrganizationId() {

if (hasText(organization)) {
Mono<String> cached = getOrganization(getCloudFoundryClientPublisher(), organization)
.map(ResourceUtils::getId);
.map(OrganizationResource::getId);

return getCacheDuration()
.map(cached::cache)
Expand Down Expand Up @@ -247,7 +246,7 @@ Mono<String> getSpaceId() {
if (hasText(getSpace())) {
Mono<String> cached = getOrganizationId()
.flatMap(organizationId -> getSpace(getCloudFoundryClientPublisher(), organizationId, space))
.map(ResourceUtils::getId);
.map(SpaceResource::getId);

return getCacheDuration()
.map(cached::cache)
Expand Down Expand Up @@ -308,7 +307,7 @@ private static boolean hasText(CharSequence str) {
private static Flux<OrganizationResource> requestOrganizations(Mono<CloudFoundryClient> cloudFoundryClientPublisher, String organization) {
return cloudFoundryClientPublisher
.flatMapMany(cloudFoundryClient -> PaginationUtils
.requestClientV2Resources(page -> cloudFoundryClient.organizations()
.requestClientV3Resources(page -> cloudFoundryClient.organizationsV3()
.list(ListOrganizationsRequest.builder()
.name(organization)
.page(page)
Expand All @@ -318,7 +317,7 @@ private static Flux<OrganizationResource> requestOrganizations(Mono<CloudFoundry
private static Flux<SpaceResource> requestSpaces(Mono<CloudFoundryClient> cloudFoundryClientPublisher, String organizationId, String space) {
return cloudFoundryClientPublisher
.flatMapMany(cloudFoundryClient -> PaginationUtils
.requestClientV2Resources(page -> cloudFoundryClient.spaces()
.requestClientV3Resources(page -> cloudFoundryClient.spacesV3()
.list(ListSpacesRequest.builder()
.organizationId(organizationId)
.name(space)
Expand Down