Class EnvironmentEndpoint


  • @Endpoint(id="env",
              defaultEnabled=false)
    public class EnvironmentEndpoint
    extends java.lang.Object
    Endpoint that displays information about the environment and its property sources.
    Since:
    1.2.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAME
      Endpoint name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getEnvironmentInfo()  
      java.util.Map<java.lang.String,​java.lang.Object> getProperties​(java.lang.String propertySourceName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnvironmentEndpoint

        public EnvironmentEndpoint​(io.micronaut.context.env.Environment environment)
        Parameters:
        environment - The Environment
      • EnvironmentEndpoint

        @Inject
        public EnvironmentEndpoint​(io.micronaut.context.env.Environment environment,
                                   @Nullable
                                   EnvironmentEndpointFilter environmentFilter)
        Parameters:
        environment - The Environment
        environmentFilter - The registered EnvironmentEndpointFilter bean if one is registered
    • Method Detail

      • getEnvironmentInfo

        @Read
        public java.util.Map<java.lang.String,​java.lang.Object> getEnvironmentInfo()
        Returns:
        The environment information as a map with the following keys: activeEnvironments, packages and propertySources.
      • getProperties

        @Read
        public java.util.Map<java.lang.String,​java.lang.Object> getProperties​(@Selector
                                                                                    java.lang.String propertySourceName)
        Parameters:
        propertySourceName - The PropertySource name
        Returns:
        a map with all the properties defined in the property source if it exists; null otherwise.