public interface PortService
| Modifier and Type | Method and Description |
|---|---|
Set<Integer> |
findUsedPortByContainer(Container container)
Returns all the registered ports of the
Container. |
Set<Integer> |
findUsedPortByHost(Container container)
Returns all the registered ports for the address of the
Container. |
int |
lookupPort(Container container,
String pid,
String key)
Looks up the registry and returns a registered port.
|
void |
registerPort(Container container,
String pid,
String key,
int port)
Registers a port to the registry.
|
int |
registerPort(Container container,
String pid,
String key,
int fromPort,
int toPort,
Set<Integer> excludes)
Registers a port from the specified range to the registry.
|
void |
unregisterPort(Container container)
Un-register the ports bound to the container.
|
void |
unregisterPort(Container container,
String pid)
Un-register the ports bound to the specific pid.
|
void |
unregisterPort(Container container,
String pid,
String key)
Un-register the port bound to the specified pid and key.
|
int registerPort(Container container, String pid, String key, int fromPort, int toPort, Set<Integer> excludes)
container - The Container under which the port will be registered.pid - The pid that is using the registered port.key - The key of the pid that requires the port.fromPort - The lower bound of the range.toPort - The upper bound of the range.excludes - A set of ports to ignore.void registerPort(Container container, String pid, String key, int port)
container - The Container under which the port will be registered.pid - The pid that is using the registered port.key - The key of the pid that requires the port.port - The actual port number.void unregisterPort(Container container, String pid, String key)
container - pid - key - void unregisterPort(Container container, String pid)
container - pid - void unregisterPort(Container container)
container - int lookupPort(Container container, String pid, String key)
container - The Container to lookup.pid - The pid to use for the lookup.key - The key of the pid.Set<Integer> findUsedPortByHost(Container container)
Container.
The method takes into consideration ports of other containers co-located with the target.container - Copyright © 2011–2014 Red Hat. All rights reserved.