remove unused legacy procedure from httpserver

(deleted  generateSocketAddress(port) )
pull/1/head
reger 11 years ago
parent b02cb18c84
commit c7335318eb

@ -27,13 +27,7 @@ package net.yacy.http;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.security.KeyStore;
import java.util.Enumeration;
import java.util.StringTokenizer;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
@ -351,57 +345,10 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
}
}
@Override
public InetSocketAddress generateSocketAddress(String extendedPortString) throws SocketException {
// parsing the port configuration
String bindIP = null;
int bindPort;
int pos = extendedPortString.indexOf(':');
if (pos != -1) {
bindIP = extendedPortString.substring(0,pos).trim();
extendedPortString = extendedPortString.substring(pos+1);
if (bindIP.length() > 0 && bindIP.charAt(0) == '#') {
final String interfaceName = bindIP.substring(1);
String hostName = null;
if (ConcurrentLog.isFine("SERVER")) ConcurrentLog.fine("SERVER","Trying to determine IP address of interface '" + interfaceName + "'.");
final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
if (interfaces != null) {
while (interfaces.hasMoreElements()) {
final NetworkInterface interf = interfaces.nextElement();
if (interf.getName().equalsIgnoreCase(interfaceName)) {
final Enumeration<InetAddress> addresses = interf.getInetAddresses();
if (addresses != null) {
while (addresses.hasMoreElements()) {
final InetAddress address = addresses.nextElement();
if (address instanceof Inet4Address) {
hostName = address.getHostAddress();
break;
}
}
}
}
}
}
if (hostName == null) {
ConcurrentLog.warn("SERVER", "Unable to find interface with name '" + interfaceName + "'. Binding server to all interfaces");
bindIP = null;
} else {
ConcurrentLog.info("SERVER", "Binding server to interface '" + interfaceName + "' with IP '" + hostName + "'.");
bindIP = hostName;
}
}
}
bindPort = Integer.parseInt(extendedPortString);
return (bindIP == null)
? new InetSocketAddress(bindPort)
: new InetSocketAddress(bindIP, bindPort);
}
/**
* get Jetty version
* @return version_string
*/
@Override
public String getVersion() {
return "Jetty " + Server.getVersion();
@ -505,5 +452,4 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
return null;
}
}
}

@ -1,9 +1,6 @@
package net.yacy.http;
import java.net.InetSocketAddress;
import java.net.SocketException;
/**
* Isolation of HttpServer
*
@ -11,15 +8,12 @@ import java.net.SocketException;
* to provide the routines and entry points required by the
* YaCy servlets
*
* currently Jetty implementation is ongoing
*
* Implementation Jetty8HttpServerImpl.java
* Implementation Jetty9HttpServerImpl.java
*/
public interface YaCyHttpServer {
abstract void startupServer() throws Exception;
abstract void stop() throws Exception;
abstract InetSocketAddress generateSocketAddress(String port) throws SocketException;
abstract int getSslPort();
abstract boolean withSSL();
abstract void reconnect(int milsec);

Loading…
Cancel
Save