protected RestClientItf createNewRestClient(URI endpoint,String username,String password,String version,Client client){
  XtremIOClient xioClient=null;
  if (version != null && !version.isEmpty() && Integer.valueOf(version.split(DOT_OPERATOR)[0]) >= XIO_MIN_4X_VERSION) {
    xioClient=new XtremIOV2Client(endpoint,username,password,client);
  }
 else {
    xioClient=new XtremIOV1Client(endpoint,username,password,client);
  }
  return xioClient;
}

protected RestClientItf createNewRestClient ( URI endpoint , String username , String password , String version , Client client ) { XtremIOClient xioClient = null ; if ( version != null && ! version . isEmpty ( ) && Integer . valueOf ( version . split ( DOT_OPERATOR ) [ 0 ] ) >= XIO_MIN_4X_VERSION ) { xioClient = new XtremIOV2Client ( endpoint , username , password , client ) ; } else { xioClient = new XtremIOV1Client ( endpoint , username , password , client ) ; } return xioClient ; }
create a new xtremio rest client for the given endpoint , username , password and xtremio version . for xtremio 4 . x and higher , return a rest client which will support version 2 rest apis .
