Interface HasPortBindings

All Superinterfaces:
CubeMetadata

public interface HasPortBindings extends CubeMetadata
Port bindings for the container. This includes basic container details (IP, exposed ports) as well as mappings for specific container ports.
Author:
Rob Cernich
  • Method Details

    • isBound

      boolean isBound()
      Returns true if the container has been bound. Prior to being bound, the container's IP address may not be valid and port information will be specific to what is configured for the container (e.g. EXPOSEd ports). After the container is bound, the ports list may change (e.g. if the container was started with -p <port>:<not-exposed-port>).
      Returns:
      true if the container has been bound.
    • getContainerIP

      String getContainerIP()
      Returns:
      the container's IP address, may be null if the container has not been bound to an IP.
    • getInternalIP

      String getInternalIP()
      Returns:
      the container's internal IP address, may be null if the container has not been bound to an IP. The internal ip is as seen by the Host or other containers.
    • getContainerPorts

      Set<Integer> getContainerPorts()
      Returns:
      list of configured container ports.
    • getBoundPorts

      Set<Integer> getBoundPorts()
      Returns:
      list of all container ports (configured and dynamically bound (e.g. -p <port>:<not-exposed-port>)
    • getMappedAddress

      HasPortBindings.PortAddress getMappedAddress(int targetPort)
      Parameters:
      targetPort - the target port
      Returns:
      the mapped address for the target port, may be null if the port is bound, but not mapped (e.g. no -p :port)
    • getPortForwardBindAddress

      InetAddress getPortForwardBindAddress()
      Returns:
      the mapped address in the arquillian.xml,defined by the portForwardBindAddress property. If null, returns the default - 127.0.0.1.