com.github.dockerjava.api.model
Class PortBinding

java.lang.Object
  extended by com.github.dockerjava.api.model.PortBinding

public class PortBinding
extends Object

In a PortBinding, a network socket on the Docker host, expressed as a Ports.Binding, is bound to an ExposedPort of a container. A PortBinding corresponds to the --publish (-p) option of the docker run (and similar) CLI command for adding port bindings to a container.

Note: This is an abstraction used for creating new port bindings. It is not to be confused with the abstraction used for querying existing port bindings from a container configuration in InspectContainerResponse.NetworkSettings.getPorts() and InspectContainerResponse.HostConfig.getPortBindings(). In that context, a Map<ExposedPort, Binding[]> is used.


Constructor Summary
PortBinding(Ports.Binding binding, ExposedPort exposedPort)
           
 
Method Summary
 boolean equals(Object obj)
           
 Ports.Binding getBinding()
           
 ExposedPort getExposedPort()
           
 int hashCode()
           
static PortBinding parse(String serialized)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortBinding

public PortBinding(Ports.Binding binding,
                   ExposedPort exposedPort)
Method Detail

getBinding

public Ports.Binding getBinding()

getExposedPort

public ExposedPort getExposedPort()

parse

public static PortBinding parse(String serialized)
                         throws IllegalArgumentException
Throws:
IllegalArgumentException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014. All rights reserved.