org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse Java Examples

The following examples show how to use org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Test
public void testEmptyResponse() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request -> {
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
				.resources(new LinkedList<>())
				.totalPages(1)
				.totalResults(0)
				.build();
		
		return Mono.just(response);
	}, 100, responseGenerator);
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.block();
	Assert.assertEquals(1, subjectResponse.getTotalPages().intValue());
	Assert.assertEquals(0, subjectResponse.getTotalResults().intValue());
	Assert.assertNotNull(subjectResponse.getResources());
	Assert.assertTrue (subjectResponse.getResources().isEmpty());
}
 
Example #2
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Test
public void testWithContentOnePage() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request -> {
		LinkedList<OrganizationResource> list = new LinkedList<>();
		list.add(OrganizationResource.builder().build());
		list.add(OrganizationResource.builder().build());
		
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
				.resources(list)
				.totalPages(1)
				.totalResults(2)
				.build();
		
		return Mono.just(response);
	}, 100, responseGenerator);
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.block();
	Assert.assertEquals(1, subjectResponse.getTotalPages().intValue());
	Assert.assertEquals(2, subjectResponse.getTotalResults().intValue());
	Assert.assertNotNull (subjectResponse.getResources());
	Assert.assertEquals(2, subjectResponse.getResources().size());
}
 
Example #3
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Test
public void testWithContentTwoPages() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, 0, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request -> {
		LinkedList<OrganizationResource> list = new LinkedList<>();
		
		for (int i = 0;i<request.getResultsPerPage(); i++) {
			list.add(OrganizationResource.builder().build());
		}
		
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
				.resources(list)
				.totalPages(2)
				.totalResults(2 * request.getResultsPerPage())
				.build();
		
		return Mono.just(response);
	}, 100, responseGenerator);
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.block();
	Assert.assertEquals(2, subjectResponse.getTotalPages().intValue());
	Assert.assertEquals(2*100, subjectResponse.getTotalResults().intValue());
	Assert.assertNotNull(subjectResponse.getResources());
	Assert.assertEquals(2*100, subjectResponse.getResources().size());
}
 
Example #4
Source File: CFAccessorSimulator.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	
	if ("simorg".equals(orgName)) {
		
		OrganizationResource or = OrganizationResource.builder().entity(
				OrganizationEntity.builder().name(orgName).build()
			).metadata(
				Metadata.builder().createdAt(CREATED_AT_TIMESTAMP).id(ORG_UUID).build()
				// Note that UpdatedAt is not set here, as this can also happen in real life!
			).build();
		
		List<OrganizationResource> list = new LinkedList<>();
		list.add(or);
		
		ListOrganizationsResponse resp = ListOrganizationsResponse.builder().addAllResources(list).build();
		
		return Mono.just(resp).delayElement(this.getSleepRandomDuration());
	}
	log.error("Invalid OrgId request");
	return null;
}
 
Example #5
Source File: ReactiveCFAccessorImpl.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveAllOrgIds() {
	PaginatedRequestGeneratorFunction<ListOrganizationsRequest> requestGenerator = (orderDirection, resultsPerPage, pageNumber) ->
		ListOrganizationsRequest.builder()
			.orderDirection(orderDirection)
			.resultsPerPage(resultsPerPage)
			.page(pageNumber)
			.build();
	
	PaginatedResponseGeneratorFunction<OrganizationResource, ListOrganizationsResponse> responseGenerator = (list, numberOfPages) ->
			ListOrganizationsResponse.builder()
			.addAllResources(list)
			.totalPages(numberOfPages)
			.totalResults(list.size())
			.build();
	
	return this.paginatedRequestFetcher.performGenericPagedRetrieval(RequestType.ALL_ORGS, "(empty)", requestGenerator, 
			r -> this.cloudFoundryClient.organizations().list(r),  this.requestTimeoutOrg, responseGenerator);
}
 
Example #6
Source File: CFAccessorMassMock.java    From promregator with Apache License 2.0 6 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	
	if ("unittestorg".equals(orgName)) {
		
		OrganizationResource or = OrganizationResource.builder().entity(
				OrganizationEntity.builder().name(orgName).build()
			).metadata(
				Metadata.builder().createdAt(CREATED_AT_TIMESTAMP).id(UNITTEST_ORG_UUID).build()
				// Note that UpdatedAt is not set here, as this can also happen in real life!
			).build();
		
		List<org.cloudfoundry.client.v2.organizations.OrganizationResource> list = new LinkedList<>();
		list.add(or);
		
		ListOrganizationsResponse resp = org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse.builder().addAllResources(list).build();
		
		return Mono.just(resp).delayElement(this.getSleepRandomDuration());
	}
	Assert.fail("Invalid OrgId request");
	return null;
}
 
Example #7
Source File: CFAccessorCacheClassicTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrieveOrgId() {
	Mono<ListOrganizationsResponse> response1 = subject.retrieveOrgId("dummy");
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
	
	Mono<ListOrganizationsResponse> response2 = subject.retrieveOrgId("dummy");
	assertThat(response1).isEqualTo(response2);
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
}
 
Example #8
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testWithContentTwoPagesSecondWithoutItems() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request -> {
		LinkedList<OrganizationResource> list = new LinkedList<>();
		
		if (request.getPage() == 1) {
			for (int i = 0;i<request.getResultsPerPage(); i++) {
				list.add(OrganizationResource.builder().build());
			}
		}
		
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
				.resources(list)
				.totalPages(2)
				.totalResults( (2 - request.getPage()) * request.getResultsPerPage()) // that's tricky&ugly, but correct: It would be the answer, if suddenly the items on the 2nd page vanished
				.build();
		
		return Mono.just(response);
	}, 100, responseGenerator);
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.block();
	Assert.assertEquals(2, subjectResponse.getTotalPages().intValue());
	Assert.assertEquals(1*100, subjectResponse.getTotalResults().intValue());
	Assert.assertNotNull (subjectResponse.getResources());
	Assert.assertEquals(1*100, subjectResponse.getResources().size());
}
 
Example #9
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testWithContentTimeoutOnFirstPage() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request ->
			Mono.error(new TimeoutException()), 100, responseGenerator);
	
	ListOrganizationsResponse fallback = ListOrganizationsResponse.builder().build();
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.doOnError(e ->
		Assert.assertTrue(Exceptions.unwrap(e) instanceof TimeoutException)
	).onErrorReturn(fallback).block();
	Assert.assertEquals(fallback, subjectResponse);
}
 
Example #10
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testWithContentTimeoutOnSecondPage() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request -> {
		if (request.getPage() == 2) {
			return Mono.error(new TimeoutException());
		}
		
		LinkedList<OrganizationResource> list = new LinkedList<>();
		
		if (request.getPage() == 1) {
			for (int i = 0;i<request.getResultsPerPage(); i++) {
				list.add(OrganizationResource.builder().build());
			}
		}
		
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
				.resources(list)
				.totalPages(2)
				.totalResults(2 * request.getResultsPerPage()) 
				.build();
		
		return Mono.just(response);
	}, 100, responseGenerator);
	
	ListOrganizationsResponse fallback = ListOrganizationsResponse.builder().build();
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.doOnError(e ->
		Assert.assertTrue(Exceptions.unwrap(e) instanceof TimeoutException)
	).onErrorReturn(fallback).block();
	Assert.assertEquals(fallback, subjectResponse);
}
 
Example #11
Source File: ReactiveCFPaginatedRequestFetcherTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testWithContentGeneralException() {
	ReactiveCFPaginatedRequestFetcher subject = new ReactiveCFPaginatedRequestFetcher(this.internalMetricsMocked, Double.MAX_VALUE, Duration.ofMillis(100));
	
	Mono<ListOrganizationsResponse> subjectResponseMono = subject.performGenericPagedRetrieval(RequestType.OTHER, "nokey", requestGenerator, request ->
		Mono.error(new Exception()), 100, responseGenerator);
	
	ListOrganizationsResponse fallback = ListOrganizationsResponse.builder().build();
	
	ListOrganizationsResponse subjectResponse = subjectResponseMono.doOnError(e ->
		Assert.assertTrue(Exceptions.unwrap(e) instanceof Exception)
	).onErrorReturn(fallback).block();
	Assert.assertEquals(fallback, subjectResponse);
}
 
Example #12
Source File: CFAccessorCacheCaffeineTimeoutTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrieveOrgId() throws InterruptedException {
	Mono<ListOrganizationsResponse> response1 = subject.retrieveOrgId("dummy");
	response1.subscribe();
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
	
	// required to permit asynchronous updates of caches => test stability
	Thread.sleep(10);
	
	Mono<ListOrganizationsResponse> response2 = subject.retrieveOrgId("dummy");
	response2.subscribe();
	assertThat(response1).isNotEqualTo(response2);
	Mockito.verify(this.parentMock, Mockito.times(2)).retrieveOrgId("dummy");
}
 
Example #13
Source File: CFAccessorCacheClassicTimeoutTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrieveOrgId() {
	Mono<ListOrganizationsResponse> response1 = subject.retrieveOrgId("dummy");
	response1.subscribe();
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
	
	Mono<ListOrganizationsResponse> response2 = subject.retrieveOrgId("dummy");
	response2.subscribe();
	assertThat(response1).isNotEqualTo(response2);
	Mockito.verify(this.parentMock, Mockito.times(2)).retrieveOrgId("dummy");
}
 
Example #14
Source File: CFAccessorMock.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	
	if ("unittestorg".equalsIgnoreCase(orgName)) {
		
		OrganizationResource or = OrganizationResource.builder().entity(
				OrganizationEntity.builder().name("unittestorg").build()
			).metadata(
				Metadata.builder().createdAt(CREATED_AT_TIMESTAMP).id(UNITTEST_ORG_UUID).build()
				// Note that UpdatedAt is not set here, as this can also happen in real life!
			).build();
		
		List<org.cloudfoundry.client.v2.organizations.OrganizationResource> list = new LinkedList<>();
		list.add(or);
		
		ListOrganizationsResponse resp = org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse.builder().addAllResources(list).build();
		
		return Mono.just(resp);
	} else if ("doesnotexist".equals(orgName)) {
		return Mono.just(org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse.builder().resources(new ArrayList<>()).build());
	} else if ("exception".equals(orgName)) {
		return Mono.just(org.cloudfoundry.client.v2.organizations.ListOrganizationsResponse.builder().build())
				.map(x -> {throw new Error("exception org name provided");});
	}
	Assert.fail("Invalid OrgId request");
	return null;
}
 
Example #15
Source File: CloudFoundryTaskLauncherCachingTests.java    From spring-cloud-deployer-cloudfoundry with Apache License 2.0 5 votes vote down vote up
private Mono<ListOrganizationsResponse> listOrganizationsResponse(AtomicBoolean error) {
	// defer so that we can conditionally throw within mono
	return Mono.defer(() -> {
		if (error.get()) {
			throw new RuntimeException();
		}
		ListOrganizationsResponse response = ListOrganizationsResponse.builder()
			.addAllResources(Collections.<OrganizationResource>singletonList(
				OrganizationResource.builder()
						.metadata(Metadata.builder().id("123").build()).build())
			)
			.build();
		return Mono.just(response);
	});
}
 
Example #16
Source File: CloudFoundryTaskLauncherTests.java    From spring-cloud-deployer-cloudfoundry with Apache License 2.0 5 votes vote down vote up
private Mono<ListOrganizationsResponse> listOrganizationsResponse() {
	ListOrganizationsResponse response = ListOrganizationsResponse.builder()
	.addAllResources(Collections.<OrganizationResource>singletonList(
			OrganizationResource.builder()
					.metadata(Metadata.builder().id("123").build()).build())
	).build();
	return Mono.just(response);
}
 
Example #17
Source File: MultiplePlatformTypeTests.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
private Mono<ListOrganizationsResponse> listOrganizationsResponse() {
	ListOrganizationsResponse response = ListOrganizationsResponse.builder()
			.addAllResources(Collections.<OrganizationResource>singletonList(
					OrganizationResource.builder()
							.metadata(Metadata.builder().id("123").build()).build())
			).build();
	return Mono.just(response);
}
 
Example #18
Source File: CloudFoundrySchedulerTests.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
private Mono<ListOrganizationsResponse> listOrganizationsResponse() {
	ListOrganizationsResponse response = ListOrganizationsResponse.builder()
			.addAllResources(Collections.<OrganizationResource>singletonList(
					OrganizationResource.builder()
							.metadata(Metadata.builder().id("123").build()).build())
			).build();
	return Mono.just(response);
}
 
Example #19
Source File: CloudFoundryTaskPlatformFactoryTests.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
private Mono<ListOrganizationsResponse> listOrganizationsResponse() {
	ListOrganizationsResponse response = ListOrganizationsResponse.builder()
			.addAllResources(Collections.<OrganizationResource>singletonList(
					OrganizationResource.builder()
							.metadata(Metadata.builder().id("123").build()).build())
			).build();
	return Mono.just(response);
}
 
Example #20
Source File: CFAccessorCacheCaffeineTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrieveOrgId() throws InterruptedException {
	Mono<ListOrganizationsResponse> response1 = subject.retrieveOrgId("dummy");
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
	
	Thread.sleep(10);
	
	Mono<ListOrganizationsResponse> response2 = subject.retrieveOrgId("dummy");
	assertThat(response1.block()).isEqualTo(response2.block());
	Mockito.verify(this.parentMock, Mockito.times(1)).retrieveOrgId("dummy");
}
 
Example #21
Source File: CFAccessorSimulatorTest.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Test
public void testRetrieveOrgId() {
	CFAccessorSimulator subject = new CFAccessorSimulator(2);
	Mono<ListOrganizationsResponse> mono = subject.retrieveOrgId("simorg");
	ListOrganizationsResponse result = mono.block();
	Assert.assertEquals(CFAccessorSimulator.ORG_UUID, result.getResources().get(0).getMetadata().getId());
}
 
Example #22
Source File: CFAccessorCacheClassic.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveAllOrgIds() {
	/*
	 * special case: we don't cache the result here in an own cache,
	 * as we always want to have "fresh data".
	 */
	return this.parent.retrieveAllOrgIds();
}
 
Example #23
Source File: CFAccessorCacheCaffeine.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Override
public @NonNull CompletableFuture<ListOrganizationsResponse> asyncLoad(@NonNull String key,
		@NonNull Executor executor) {
	
	Mono<ListOrganizationsResponse> mono = parent.retrieveOrgId(key)
			.subscribeOn(Schedulers.fromExecutor(executor))
			.cache();
	return mono.toFuture();
}
 
Example #24
Source File: ReactiveCFAccessorImpl.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	// Note: even though we use the List request here, the number of values returned is either zero or one
	// ==> No need for a paged request. 
	ListOrganizationsRequest orgsRequest = ListOrganizationsRequest.builder().name(orgName).build();
	
	return this.paginatedRequestFetcher.performGenericRetrieval(RequestType.ORG, orgName, orgsRequest,
			or -> this.cloudFoundryClient.organizations()
			          .list(or), this.requestTimeoutOrg);
}
 
Example #25
Source File: CFAccessorCacheCaffeine.java    From promregator with Apache License 2.0 5 votes vote down vote up
@Override
public @NonNull CompletableFuture<ListOrganizationsResponse> asyncLoad(@NonNull String key,
		@NonNull Executor executor) {
	
	Mono<ListOrganizationsResponse> mono = parent.retrieveAllOrgIds()
			.subscribeOn(Schedulers.fromExecutor(executor))
			.cache();
	return mono.toFuture();
}
 
Example #26
Source File: CFAccessorCacheClassic.java    From promregator with Apache License 2.0 4 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	return this.orgCache.get(orgName);
}
 
Example #27
Source File: CFAccessorCacheClassic.java    From promregator with Apache License 2.0 4 votes vote down vote up
private Mono<ListOrganizationsResponse> orgCacheLoader(String orgName) {
	Mono<ListOrganizationsResponse> mono = this.parent.retrieveOrgId(orgName).cache();
	
	/*
	 * Note that the mono does not have any subscriber, yet! 
	 * The cache which we are using is working "on-stock", i.e. we need to ensure
	 * that the underlying calls to the CF API really is triggered.
	 * Fortunately, we can do this very easily:
	 */
	mono.subscribe();
	
	/*
	 * Handling for issue #96: If a timeout of the request to the  CF Cloud Controller occurs, 
	 * we must make sure that the erroneous Mono is not kept in the cache. Instead we have to displace the item, 
	 * which triggers a refresh of the cache.
	 * 
	 * Note that subscribe() must be called *before* adding this error handling below.
	 * Otherwise we will run into the situation that the error handling routine is called by this
	 * subscribe() already - but the Mono has not been written into the cache yet!
	 * If we do it in this order, the doOnError method will only be called once the first "real subscriber" 
	 * of the Mono will start requesting.
	 */
	mono = mono.doOnError(e -> {
		if (e instanceof TimeoutException && this.orgCache != null) {
			log.warn(String.format("Timed-out entry using key %s detected, which would get stuck in our org cache; "
					+ "displacing it now to prevent further harm", orgName), e);
			/* 
			 * Note that it *might* happen that a different Mono gets displaced than the one we are in here now. 
			 * Yet, we can't make use of the
			 * 
			 * remove(key, value)
			 * 
			 * method, as providing value would lead to a hen-egg problem (we were required to provide the reference
			 * of the Mono instance, which we are just creating).
			 * Instead, we just blindly remove the entry from the cache. This may lead to four cases to consider:
			 * 
			 * 1. We hit the correct (erroneous) entry: then this is exactly what we want to do.
			 * 2. We hit another erroneous entry: then we have no harm done, because we fixed yet another case.
			 * 3. We hit a healthy entry: Bad luck; on next iteration, we will get a cache miss, which automatically
			 *    fixes the issue (as long this does not happen too often, ...)
			 * 4. The entry has already been deleted by someone else: the remove(key) operation will 
			 *    simply be a NOOP. => no harm done either.
			 */
			
			this.orgCache.remove(orgName);
			
			// Notify metrics of this case
			if (this.internalMetrics != null) {
				this.internalMetrics.countAutoRefreshingCacheMapErroneousEntriesDisplaced(this.orgCache.getName());
			}
		}
	});
	/* Valid for AccessorCacheType = CLASSIC only:
	 * 
	 * Keep in mind that doOnError is a side-effect:  The logic above only removes it from the cache. 
	 * The erroneous instance still is used downstream and will trigger subsequent error handling (including 
	 * logging) there.
	 * Note that this also holds true during the timeframe of the timeout: This instance of the Mono will 
	 * be written to the cache, thus all consumers of the cache will be handed out the cached, not-yet-resolved 
	 * object instance. This implicitly makes sure that there can only be one valid pending request is out there.
	 */
	
	return mono;
}
 
Example #28
Source File: CFAccessorCacheCaffeine.java    From promregator with Apache License 2.0 4 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveOrgId(String orgName) {
	return Mono.fromFuture(this.orgCache.get(orgName));
}
 
Example #29
Source File: CFAccessorMock.java    From promregator with Apache License 2.0 4 votes vote down vote up
public Mono<ListOrganizationsResponse> retrieveAllOrgIds() {
	return this.retrieveOrgId("unittestorg");
}
 
Example #30
Source File: CFAccessorCacheCaffeine.java    From promregator with Apache License 2.0 4 votes vote down vote up
@Override
public Mono<ListOrganizationsResponse> retrieveAllOrgIds() {
	return Mono.fromFuture(this.allOrgIdCache.get("all"));
}