public class PortMapping extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PortMapping.PropertyWriteHelper |
| Constructor and Description |
|---|
PortMapping(List<String> portMappings,
Properties projProperties)
Create the mapping from a configuration.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsDynamicHostIps() |
boolean |
containsDynamicPorts()
Whether this mapping contains dynamically assigned ports
|
Set<String> |
getContainerPorts() |
Map<String,Integer> |
getContainerPortToHostPortMap() |
void |
updateVariablesWithDynamicPorts(Map<String,Container.PortBinding> dockerObtainedDynamicPorts)
Update variable-to-port mappings with dynamically obtained ports.
|
public PortMapping(List<String> portMappings, Properties projProperties)
updateVariablesWithDynamicPorts(Map) is calledportMappings - a list of configuration strings where each string hast the format
host_ip:host_port:container_port. If the host-port is non-numeric it is
assumed to be a variable (which later might be filled in with the dynamically created port).projProperties - project propertiesIllegalArgumentException - if the format doesn't fitpublic boolean containsDynamicHostIps()
public boolean containsDynamicPorts()
public void updateVariablesWithDynamicPorts(Map<String,Container.PortBinding> dockerObtainedDynamicPorts)
dockerObtainedDynamicPorts - keys are the container ports, values are the dynamically mapped host ports,Copyright © 2016. All Rights Reserved.