protected int parsePort(String port) {
    if (StringUtils.isEmpty(port)) {
      throw new IllegalArgumentException("Port number must be non-empty, non-null positive integer");
    }
    return Integer.parseInt(port);
  }
Parses port number from given string.

@param port port number string
@return parsed port number
@throws NumberFormatException    if given string cannot be parsed
@throws IllegalArgumentException if given string is null or empty
ambari-server/src/main/java/org/apache/ambari/server/KdcServerConnectionVerification.java