Class AccountManagementEnvironmentPostProcessor
java.lang.Object
com.wavefront.spring.autoconfigure.AccountManagementEnvironmentPostProcessor
- All Implemented Interfaces:
EventListener,org.springframework.boot.env.EnvironmentPostProcessor,org.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>
public class AccountManagementEnvironmentPostProcessor
extends Object
implements org.springframework.boot.env.EnvironmentPostProcessor, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>
An
EnvironmentPostProcessor that auto-negotiates an api token for Wavefront if
necessary. If an account was already provisioned and the api token is available from
disk, retrieves a one time link url to the Wavefront dashboard.- Author:
- Stephane Nicoll
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AccountInfogetExistingAccount(AccountManagementClient client, String clusterUri, com.wavefront.sdk.common.application.ApplicationTags applicationTags, String apiToken)protected org.springframework.core.io.ResourcevoidonApplicationEvent(org.springframework.boot.context.event.SpringApplicationEvent event)voidpostProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)protected AccountInfoprovisionAccount(AccountManagementClient client, String clusterUri, com.wavefront.sdk.common.application.ApplicationTags applicationTags)protected booleanshouldEnableAccountManagement(Thread thread)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
FREEMIUM_ACCOUNT_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Details
-
AccountManagementEnvironmentPostProcessor
public AccountManagementEnvironmentPostProcessor()
-
-
Method Details
-
postProcessEnvironment
public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)- Specified by:
postProcessEnvironmentin interfaceorg.springframework.boot.env.EnvironmentPostProcessor
-
onApplicationEvent
public void onApplicationEvent(@NonNull org.springframework.boot.context.event.SpringApplicationEvent event)- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>
-
shouldEnableAccountManagement
-
getLocalApiTokenResource
protected org.springframework.core.io.Resource getLocalApiTokenResource() -
getExistingAccount
protected AccountInfo getExistingAccount(AccountManagementClient client, String clusterUri, com.wavefront.sdk.common.application.ApplicationTags applicationTags, String apiToken) -
provisionAccount
protected AccountInfo provisionAccount(AccountManagementClient client, String clusterUri, com.wavefront.sdk.common.application.ApplicationTags applicationTags)
-