public synchronized IReviewboardClient getClient(boolean refreshForce, String serverUrl,
String userName, String password, String charactorEncoding) {
serverUrl = ReviewboardUtil.norminateRepositoryUrl( serverUrl.trim() ) ;
IReviewboardClient reviewboardClient = this.urlToClientMap.get(serverUrl);
boolean isClientDataNull = false;
ReviewboardClientData clientData = null;
if (null == reviewboardClient) {
isClientDataNull = true;
clientData = new ReviewboardClientData();
reviewboardClient = new ReviewboardClientImpl(clientData, serverUrl, userName, password, charactorEncoding);
}
clientData = reviewboardClient.getClientData();
if( null == clientData.getReviewGroupList() || clientData.getReviewGroupList().isEmpty()
|| null == clientData.getRepositoryList() || clientData.getRepositoryList().isEmpty()
|| null == clientData.getUserList() || clientData.getUserList().isEmpty() ){
isClientDataNull = true;
}
//强制刷新RepositoryData
if( isClientDataNull || refreshForce ){
IReviewboardService reviewboardService = new ReviewboardServiceImpl( reviewboardClient );