*/
@Override
protected void validateProtocol()
throws HRInvalidProtocolException {
if (!isHttp() && !isFtp() && !isHttps()) {
throw new HRInvalidProtocolException(
HRInvalidProtocolException.ProtocolElement.url,
"Neither HTTP, nor HTTPS, nor FTP protocol.");
}
if (getPortNo() < 0 || getPortNo() >= 65536) {
throw new HRInvalidProtocolException(
HRInvalidProtocolException.ProtocolElement.portNo,
"Invalid port number: " + getPortNo());
}
if (getServiceName().length() == 0) {
throw new HRInvalidProtocolException(
HRInvalidProtocolException.ProtocolElement.serviceName,
"Empty service name.");
}
}