Class AbstractEndpoint<T>
- java.lang.Object
- org.springframework.boot.actuate.endpoint.AbstractEndpoint<T>
- Type Parameters:
T- the endpoint data type
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,Endpoint<T>,org.springframework.context.EnvironmentAware
- Direct Known Subclasses:
AutoConfigurationReportEndpoint,BeansEndpoint,ConfigurationPropertiesReportEndpoint,DumpEndpoint,EnvironmentEndpoint,FlywayEndpoint,HealthEndpoint,InfoEndpoint,LiquibaseEndpoint,LoggersEndpoint,MetricsEndpoint,RequestMappingEndpoint,ShutdownEndpoint,TraceEndpoint
public abstract class AbstractEndpoint<T> extends Object implements Endpoint<T>, org.springframework.context.EnvironmentAware
Abstract base forEndpointimplementations.
Constructor Summary
Constructors Constructor Description AbstractEndpoint(String id)Create a new sensitive endpoint instance.AbstractEndpoint(String id, boolean sensitive)Create a new endpoint instance.AbstractEndpoint(String id, boolean sensitive, boolean enabled)Create a new endpoint instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.core.env.EnvironmentgetEnvironment()StringgetId()The logical ID of the endpoint.booleanisEnabled()Return if the endpoint is enabled.booleanisSensitive()Return if the endpoint is sensitive, i.e.voidsetEnabled(Boolean enabled)voidsetEnvironment(org.springframework.core.env.Environment environment)voidsetId(String id)voidsetSensitive(Boolean sensitive)
Constructor Detail
AbstractEndpoint
public AbstractEndpoint(String id)
Create a new sensitive endpoint instance. The endpoint will enabled flag will be based on the springEnvironmentunless explicitly set.- Parameters:
id- the endpoint ID
AbstractEndpoint
public AbstractEndpoint(String id, boolean sensitive)
Create a new endpoint instance. The endpoint will enabled flag will be based on the springEnvironmentunless explicitly set.- Parameters:
id- the endpoint IDsensitive- if the endpoint is sensitive by default
AbstractEndpoint
public AbstractEndpoint(String id, boolean sensitive, boolean enabled)
Create a new endpoint instance.- Parameters:
id- the endpoint IDsensitive- if the endpoint is sensitiveenabled- if the endpoint is enabled or not.
Method Detail
getEnvironment
protected final org.springframework.core.env.Environment getEnvironment()
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
getId
public String getId()
Description copied from interface:EndpointThe logical ID of the endpoint. Must only contain simple letters, numbers and '_' characters (i.e. a "\w" regex).
isEnabled
public boolean isEnabled()
Description copied from interface:EndpointReturn if the endpoint is enabled.
setEnabled
public void setEnabled(Boolean enabled)
isSensitive
public boolean isSensitive()
Description copied from interface:EndpointReturn if the endpoint is sensitive, i.e. may return data that the average user should not see. Mappings can use this as a security hint.- Specified by:
isSensitivein interfaceEndpoint<T>- Returns:
- if the endpoint is sensitive
setSensitive
public void setSensitive(Boolean sensitive)