Class ProjectGenerationStatPublisher
java.lang.Object
io.spring.initializr.actuate.stat.ProjectGenerationStatPublisher
Publish stats for each project generated to an Elastic index.
- Author:
- Stephane Nicoll, Moritz Halbritter
-
Constructor Summary
ConstructorsConstructorDescriptionProjectGenerationStatPublisher(ProjectRequestDocumentFactory documentFactory, StatsProperties statsProperties, RestTemplateBuilder restTemplateBuilder, org.springframework.core.retry.RetryTemplate retryTemplate) Deprecated, for removal: This API element is subject to removal in a future version.ProjectGenerationStatPublisher(ProjectRequestDocumentFactory documentFactory, StatsProperties statsProperties, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.core.retry.RetryTemplate retryTemplate) Create a new instance using the specifiedRestClient.Builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleEvent(ProjectRequestEvent event) Publish the given event to the index.protected voidupdateRequestUrl(URI requestUrl) Update the URL to which documents are published.
-
Constructor Details
-
ProjectGenerationStatPublisher
public ProjectGenerationStatPublisher(ProjectRequestDocumentFactory documentFactory, StatsProperties statsProperties, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.core.retry.RetryTemplate retryTemplate) Create a new instance using the specifiedRestClient.Builder.- Parameters:
documentFactory- the document factorystatsProperties- the stats propertiesrestClientBuilder- the rest client builderretryTemplate- the retry template
-
ProjectGenerationStatPublisher
@Deprecated(forRemoval=true) public ProjectGenerationStatPublisher(ProjectRequestDocumentFactory documentFactory, StatsProperties statsProperties, RestTemplateBuilder restTemplateBuilder, org.springframework.core.retry.RetryTemplate retryTemplate) Deprecated, for removal: This API element is subject to removal in a future version.Create a new instance using the specifiedRestTemplateBuilder.- Parameters:
documentFactory- the document factorystatsProperties- the stats propertiesrestTemplateBuilder- the rest template builderretryTemplate- the retry template
-
-
Method Details
-
handleEvent
Publish the given event to the index. Failures are logged.- Parameters:
event- the event
-
updateRequestUrl
Update the URL to which documents are published.- Parameters:
requestUrl- the URL
-
ProjectGenerationStatPublisher(ProjectRequestDocumentFactory, StatsProperties, RestClient.Builder, RetryTemplate)