public class Ports
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_HOST_SSH_PORT |
static int |
DEFAULT_HTTP_PORT |
static int |
DEFAULT_HTTPS_PORT |
static int |
DEFAULT_KARAF_SSH_PORT |
static int |
DEFAULT_RMI_REGISTRY_PORT |
static int |
DEFAULT_RMI_SERVER_PORT |
static int |
DEFAULT_ZOOKEEPER_ELECTION_PORT |
static int |
DEFAULT_ZOOKEEPER_PEER_PORT |
static int |
DEFAULT_ZOOKEEPER_SERVER_PORT |
static int |
MAX_PORT_NUMBER |
static int |
MIN_PORT_NUMBER |
static java.lang.String |
PORT_PATTERN |
| Modifier and Type | Method and Description |
|---|---|
static int |
extractPort(java.lang.String address)
Extracts the port from an addrees.
|
static int |
findFreeLocalPort(java.util.Set<java.lang.Integer> usedPorts,
int fromPort,
int toPort,
boolean checkIfAvailable)
Finds a the next free local port, based on the list of used ports and the ability to directly check if port is free.
|
static int |
findPort(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> usedPorts,
java.lang.String ip,
int port)
Finds a port based on the given ip and the used ports for that ip.
|
static java.util.Set<java.lang.Integer> |
findUsedPorts(int fromPort,
int toPort)
Returns a
Set of used ports within the range. |
static boolean |
isPortFree(int port)
Checks if a local port is free.
|
static int |
mapPortToRange(int port,
int minimumPort,
int maximumPort)
Maps the target port inside a port range.
|
static int |
mapPortToRange(int port,
java.lang.String minimumPort,
java.lang.String maximumPort)
Maps the target port inside a port range.
|
public static final int DEFAULT_HOST_SSH_PORT
public static final int DEFAULT_KARAF_SSH_PORT
public static final int DEFAULT_ZOOKEEPER_SERVER_PORT
public static final int DEFAULT_ZOOKEEPER_PEER_PORT
public static final int DEFAULT_ZOOKEEPER_ELECTION_PORT
public static final int DEFAULT_RMI_SERVER_PORT
public static final int DEFAULT_RMI_REGISTRY_PORT
public static final int DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTPS_PORT
public static final int MIN_PORT_NUMBER
public static final int MAX_PORT_NUMBER
public static final java.lang.String PORT_PATTERN
public static java.util.Set<java.lang.Integer> findUsedPorts(int fromPort,
int toPort)
Set of used ports within the range.fromPort - toPort - public static int findPort(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> usedPorts,
java.lang.String ip,
int port)
usedPorts - ip - port - public static int findFreeLocalPort(java.util.Set<java.lang.Integer> usedPorts,
int fromPort,
int toPort,
boolean checkIfAvailable)
usedPorts - fromPort - toPort - checkIfAvailable - public static int mapPortToRange(int port,
int minimumPort,
int maximumPort)
port - minimumPort - maximumPort - public static int mapPortToRange(int port,
java.lang.String minimumPort,
java.lang.String maximumPort)
port - minimumPort - maximumPort - public static boolean isPortFree(int port)
port - public static int extractPort(java.lang.String address)
address - Copyright © 2014 Red Hat. All Rights Reserved.