Class DefaultServiceInstanceConverter
java.lang.Object
de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter
- All Implemented Interfaces:
ServiceInstanceConverter
- Direct Known Subclasses:
EurekaServiceInstanceConverter,KubernetesServiceInstanceConverter
Converts any
ServiceInstances to Instances. To customize the health- or
management-url for all instances you can set healthEndpointPath or
managementContextPath respectively. If you want to influence the url per service you
can add management.scheme, management.address,
management.port, management.context-path or
health.path to the instances metadata.- Author:
- Johannes Edmeier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.codecentric.boot.admin.server.domain.values.Registrationconvert(org.springframework.cloud.client.ServiceInstance instance) Converts a service instance to a application instance to be registered.protected StringgetHealthPath(org.springframework.cloud.client.ServiceInstance instance) protected URIgetHealthUrl(org.springframework.cloud.client.ServiceInstance instance) protected StringgetManagementHost(org.springframework.cloud.client.ServiceInstance instance) protected StringgetManagementPath(org.springframework.cloud.client.ServiceInstance instance) protected intgetManagementPort(org.springframework.cloud.client.ServiceInstance instance) protected URIgetManagementUrl(org.springframework.cloud.client.ServiceInstance instance) getMetadata(org.springframework.cloud.client.ServiceInstance instance) protected static StringgetMetadataValue(org.springframework.cloud.client.ServiceInstance instance, String... keys) protected URIgetServiceUrl(org.springframework.cloud.client.ServiceInstance instance) voidsetHealthEndpointPath(String healthEndpointPath) voidsetManagementContextPath(String managementContextPath)
-
Constructor Details
-
DefaultServiceInstanceConverter
public DefaultServiceInstanceConverter()
-
-
Method Details
-
getMetadataValue
-
convert
public de.codecentric.boot.admin.server.domain.values.Registration convert(org.springframework.cloud.client.ServiceInstance instance) Description copied from interface:ServiceInstanceConverterConverts a service instance to a application instance to be registered.- Specified by:
convertin interfaceServiceInstanceConverter- Parameters:
instance- the service instance.- Returns:
- the Registration
-
getHealthUrl
-
getHealthPath
-
getManagementUrl
-
getManagementHost
-
getManagementPort
protected int getManagementPort(org.springframework.cloud.client.ServiceInstance instance) -
getManagementPath
-
getServiceUrl
-
getMetadata
-
getManagementContextPath
-
setManagementContextPath
-
getHealthEndpointPath
-
setHealthEndpointPath
-