private void parseServers ( List < String > servers ) { if ( servers != null && servers . size ( ) > 0 ) { this . servers = new ArrayList < InetSocketAddress > ( ) ; for ( String server : servers ) { String [ ] ss = server . split ( ":" ) ; if ( ss . length == 2 ) { String host = ss [ 0 ] ; int port = 0 ; try { port = Integer . valueOf ( ss [ 1 ] ) ; } catch ( NumberFormatException e ) { // do nothing. } if ( validateServer ( host , port ) ) { this . servers . add ( InetSocketAddress . createUnresolved ( host , port ) ) ; } } } } }
Parser the server list .