Interface ConnectionPorts
public interface ConnectionPorts
Provides access to the ports that can be used to connect to a
RunningService
.- Since:
- 3.1.0
- Author:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb
- See Also:
-
Method Summary
-
Method Details
-
get
int get(int containerPort) Return the host port mapped to the given container port.- Parameters:
containerPort
- the container port. This is usually the standard port for the service (e.g. port 80 for HTTP)- Returns:
- the host port. This can be an ephemeral port that is different from the container port
- Throws:
IllegalStateException
- if the container port is not mapped
-
getAll
Return all host ports in use.- Returns:
- a list of all host ports
- See Also:
-
getAll
Return all host ports in use that match the given protocol.- Parameters:
protocol
- the protocol in use (for example 'tcp') ornull
to return all host ports- Returns:
- a list of all host ports using the given protocol
-