public interface PortService
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Integer> |
findUsedPortByContainer(Container container)
Returns all the registered ports of the
Container . |
java.util.Set<java.lang.Integer> |
findUsedPortByHost(Container container)
Returns all the registered ports for the address of the
Container . |
int |
lookupPort(Container container,
java.lang.String pid,
java.lang.String key)
Looks up the registry and returns a registered port.
|
void |
registerPort(Container container,
java.lang.String pid,
java.lang.String key,
int port)
Registers a port to the registry.
|
int |
registerPort(Container container,
java.lang.String pid,
java.lang.String key,
int fromPort,
int toPort,
java.util.Set<java.lang.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,
java.lang.String pid)
Un-register the ports bound to the specific pid.
|
void |
unregisterPort(Container container,
java.lang.String pid,
java.lang.String key)
Un-register the port bound to the specified pid and key.
|
int registerPort(Container container, java.lang.String pid, java.lang.String key, int fromPort, int toPort, java.util.Set<java.lang.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, java.lang.String pid, java.lang.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, java.lang.String pid, java.lang.String key)
container
- pid
- key
- void unregisterPort(Container container, java.lang.String pid)
container
- pid
- void unregisterPort(Container container)
container
- int lookupPort(Container container, java.lang.String pid, java.lang.String key)
container
- The Container
to lookup.pid
- The pid to use for the lookup.key
- The key of the pid.java.util.Set<java.lang.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.