com.nhncorp.neptune.common.util
Class NetUtils

java.lang.Object
  extended by com.nhncorp.neptune.common.util.NetUtils

public class NetUtils
extends java.lang.Object


Constructor Summary
NetUtils()
           
 
Method Summary
static javax.net.SocketFactory getDefaultSocketFactory(NConfiguration conf)
          Get the default socket factory as specified by the configuration parameter hadoop.rpc.socket.factory.default
static javax.net.SocketFactory getSocketFactoryFromProperty(NConfiguration conf, java.lang.String propValue)
          Get the socket factory corresponding to the given proxy URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtils

public NetUtils()
Method Detail

getDefaultSocketFactory

public static javax.net.SocketFactory getDefaultSocketFactory(NConfiguration conf)
Get the default socket factory as specified by the configuration parameter hadoop.rpc.socket.factory.default

Parameters:
conf - the configuration
Returns:
the default socket factory as specified in the configuration or the JVM default socket factory if the configuration does not contain a default socket factory property.

getSocketFactoryFromProperty

public static javax.net.SocketFactory getSocketFactoryFromProperty(NConfiguration conf,
                                                                   java.lang.String propValue)
Get the socket factory corresponding to the given proxy URI. If the given proxy URI corresponds to an absence of configuration parameter, returns null. If the URI is malformed raises an exception.

Parameters:
propValue - the property which is the class name of the SocketFactory to instantiate; assumed non null and non empty.
Returns:
a socket factory as defined in the property value.