String getHost ( ) { LOGGER . entering ( ) ; String val = "" ; InstanceType type = getType ( ) ; if ( commands . contains ( HOST_ARG ) ) { val = commands . get ( commands . indexOf ( HOST_ARG ) + 1 ) ; LOGGER . exiting ( val ) ; return val ; } try { if ( type . equals ( InstanceType . SELENIUM_NODE ) || type . equals ( InstanceType . SELENIUM_HUB ) ) { val = getSeleniumConfigAsJsonObject ( ) . get ( "host" ) . getAsString ( ) ; } } catch ( JsonParseException | NullPointerException e ) { // ignore } // return the value if it looks okay, otherwise return "localhost" as a last ditch effort val = ( StringUtils . isNotEmpty ( val ) && ! val . equalsIgnoreCase ( "ip" ) ) ? val : "localhost" ; LOGGER . exiting ( val ) ; return val ; }
Get the host for the instance represented by this launcher