|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.dockerjava.api.model.ExposedPort
public class ExposedPort
Represents a container port that Docker exposes to external clients.
The port is defined by its port number
and an
InternetProtocol
.
It can be published by Docker by binding
it to a host port, represented by a Ports.Binding
.
Nested Class Summary | |
---|---|
static class |
ExposedPort.Deserializer
|
static class |
ExposedPort.Serializer
|
Constructor Summary | |
---|---|
ExposedPort(int port)
Creates an ExposedPort for the given
port number and InternetProtocol.DEFAULT . |
|
ExposedPort(int port,
InternetProtocol protocol)
Creates an ExposedPort for the given parameters. |
|
ExposedPort(String scheme,
int port)
Deprecated. use ExposedPort(int, InternetProtocol) |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
int |
getPort()
|
InternetProtocol |
getProtocol()
|
String |
getScheme()
Deprecated. use getProtocol() |
int |
hashCode()
|
static ExposedPort |
parse(String serialized)
Parses a textual port specification (as used by the Docker CLI) to an ExposedPort . |
static ExposedPort |
tcp(int port)
Creates an ExposedPort for InternetProtocol.TCP . |
String |
toString()
Returns a string representation of this ExposedPort suitable
for inclusion in a JSON message. |
static ExposedPort |
udp(int port)
Creates an ExposedPort for InternetProtocol.UDP . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExposedPort(int port, InternetProtocol protocol)
ExposedPort
for the given parameters.
port
- the port number
protocol
- the InternetProtocol
public ExposedPort(int port)
ExposedPort
for the given
port number
and InternetProtocol.DEFAULT
.
port
- the port number
@Deprecated public ExposedPort(String scheme, int port)
ExposedPort(int, InternetProtocol)
ExposedPort
for the given parameters.
scheme
- the scheme
, tcp
or
udp
port
- the port number
Method Detail |
---|
public InternetProtocol getProtocol()
InternetProtocol
of the port
that the container exposes@Deprecated public String getScheme()
getProtocol()
tcp
or udp
public int getPort()
public static ExposedPort tcp(int port)
ExposedPort
for InternetProtocol.TCP
.
This is a shortcut for new ExposedPort(port, InternetProtocol.TCP
)
public static ExposedPort udp(int port)
ExposedPort
for InternetProtocol.UDP
.
This is a shortcut for new ExposedPort(port, InternetProtocol.UDP
)
public static ExposedPort parse(String serialized) throws IllegalArgumentException
ExposedPort
.
serialized
- the specification, e.g. 80/tcp
ExposedPort
matching the specification
IllegalArgumentException
- if the specification cannot be parsedpublic String toString()
ExposedPort
suitable
for inclusion in a JSON message.
The format is port/protocol
, like the argument in parse(String)
.
toString
in class Object
ExposedPort
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |