private ServiceRegistration . EndpointHealthCheck endpointHealthCheck ( String portName ) { if ( healthCheck ( ) instanceof HttpHealthCheck ) { final HttpHealthCheck httpHealthCheck = ( HttpHealthCheck ) healthCheck ( ) ; if ( portName . equals ( httpHealthCheck . getPort ( ) ) ) { return ServiceRegistration . EndpointHealthCheck . newHttpCheck ( httpHealthCheck . getPath ( ) ) ; } } else if ( healthCheck ( ) instanceof TcpHealthCheck ) { if ( portName . equals ( ( ( TcpHealthCheck ) healthCheck ( ) ) . getPort ( ) ) ) { return ServiceRegistration . EndpointHealthCheck . newTcpCheck ( ) ; } } return null ; }
Get endpoint health check for a given port .