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 |
|---|---|
Set<String> |
getContainerPorts() |
boolean |
needsPropertiesUpdate()
Check whether property needs updates for dynamically obtained host ports and ip adresses.
|
com.google.gson.JsonArray |
toJson()
Return the content of the mapping as an array with all specifications as given
|
void |
updateProperties(Map<String,Container.PortBinding> dockerObtainedDynamicBindings)
Update variable-to-port mappings with dynamically obtained ports and host ips.
|
public PortMapping(List<String> portMappings, Properties projProperties)
updateProperties(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 needsPropertiesUpdate()
public void updateProperties(Map<String,Container.PortBinding> dockerObtainedDynamicBindings)
dockerObtainedDynamicBindings - keys are the container ports, values are the dynamically mapped host ports and host ips.public com.google.gson.JsonArray toJson()
Copyright © 2018. All rights reserved.