|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.dockerjava.api.model.Link
public class Link
Represents a network link between two Docker containers.
The container with the name getName()
is made available in the
target container with the aliased name getAlias()
.
This involves creating an entry in /etc/hosts
and some environment
variables in the target container as well as creating a network bridge between
both containers.
Constructor Summary | |
---|---|
Link(String name,
String alias)
Creates a Link for the container with the given name and an aliased
name for use in the target container. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getAlias()
|
String |
getName()
|
int |
hashCode()
|
static Link |
parse(String serialized)
Parses a textual link specification (as used by the Docker CLI) to a Link . |
String |
toString()
Returns a string representation of this Link suitable
for inclusion in a JSON message. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Link(String name, String alias)
Link
for the container with the given name and an aliased
name for use in the target container.
name
- the name of the container that you want to link into the target
containeralias
- the aliased name under which the linked container will be available
in the target containerMethod Detail |
---|
public String getName()
public String getAlias()
public static Link parse(String serialized) throws IllegalArgumentException
Link
.
serialized
- the specification, e.g. name:alias
or /name1:/name2/alias
Link
matching the specification
IllegalArgumentException
- if the specification cannot be parsedpublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
Link
suitable
for inclusion in a JSON message.
The format is name:alias
, like the argument in parse(String)
.
toString
in class Object
Link
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |