public class Ports extends Object
Map
via its getBindings()
method.
Note: This is an abstraction used for querying existing port bindings from a container configuration. It is not to
be confused with the PortBinding
abstraction used for adding new port bindings to a container.
Modifier and Type | Class and Description |
---|---|
static class |
Ports.Binding
A
Ports.Binding represents a socket on the Docker host that is used in a PortBinding . |
static class |
Ports.Deserializer |
static class |
Ports.Serializer |
Constructor and Description |
---|
Ports()
Creates a
Ports object with no PortBinding s. |
Ports(ExposedPort exposedPort,
Ports.Binding host)
|
Ports(PortBinding... portBindings) |
Modifier and Type | Method and Description |
---|---|
void |
add(PortBinding... portBindings)
Adds the specified
PortBinding (s) to the list of PortBinding s. |
void |
bind(ExposedPort exposedPort,
Ports.Binding binding)
|
static Ports.Binding |
Binding(Integer hostPort)
Creates a
Ports.Binding for the given port number, leaving the IP address undefined. |
static Ports.Binding |
Binding(String hostIp,
Integer hostPort)
Creates a
Ports.Binding for the given IP address and port number. |
Map<ExposedPort,Ports.Binding[]> |
getBindings()
Returns the port bindings in the format used by the Docker remote API, i.e. the
Ports.Binding s grouped by
ExposedPort . |
String |
toString() |
public Ports()
Ports
object with no PortBinding
s. Use bind(ExposedPort, Binding)
or
add(PortBinding...)
to add PortBinding
s.public Ports(ExposedPort exposedPort, Ports.Binding host)
Ports
object with an initial PortBinding
for the specified ExposedPort
and
Ports.Binding
. Use bind(ExposedPort, Binding)
or add(PortBinding...)
to add more
PortBinding
s.public Ports(PortBinding... portBindings)
public void bind(ExposedPort exposedPort, Ports.Binding binding)
public void add(PortBinding... portBindings)
PortBinding
(s) to the list of PortBinding
s.public Map<ExposedPort,Ports.Binding[]> getBindings()
Ports.Binding
s grouped by
ExposedPort
.Map
that contains one or more Ports.Binding
s per ExposedPort
.public static Ports.Binding Binding(String hostIp, Integer hostPort)
Ports.Binding
for the given IP address and port number.public static Ports.Binding Binding(Integer hostPort)
Ports.Binding
for the given port number, leaving the IP address undefined.Copyright © 2015. All Rights Reserved.