public NetworkModule createNetworkModule(String address,MqttConnectOptions options,String clientid) throws MqttException {
  final String methodName="createNetworkModule";
  log.fine(className,methodName,"115",new Object[]{address});
  NetworkModule netModule;
  String shortAddress;
  String host;
  int port;
  int serverURIType=validateURI(address);
switch (serverURIType) {
case URI_TYPE_TCP:
    shortAddress=address.substring(6);
  host=getHostName(shortAddress);
port=getPort(shortAddress,1883);
netModule=new TCPMicroNetworkModule(host,port);
break;
case URI_TYPE_SSL:
shortAddress=address.substring(6);
host=getHostName(shortAddress);
port=getPort(shortAddress,8883);
netModule=new SSLMicroNetworkModule(host,port);
break;
default :
netModule=null;
}
return netModule;
}

public NetworkModule createNetworkModule ( String address , MqttConnectOptions options , String clientid ) throws MqttException { final String methodName = "createNetworkModule" ; log . fine ( className , methodName , "115" , new Object [ ] { address } ) ; NetworkModule netModule ; String shortAddress ; String host ; int port ; int serverURIType = validateURI ( address ) ; switch ( serverURIType ) { case URI_TYPE_TCP : shortAddress = address . substring ( 6 ) ; host = getHostName ( shortAddress ) ; port = getPort ( shortAddress , 1883 ) ; netModule = new TCPMicroNetworkModule ( host , port ) ; break ; case URI_TYPE_SSL : shortAddress = address . substring ( 6 ) ; host = getHostName ( shortAddress ) ; port = getPort ( shortAddress , 8883 ) ; netModule = new SSLMicroNetworkModule ( host , port ) ; break ; default : netModule = null ; } return netModule ; }
factory method to create the correct network module , based on the supplied address uri .
