public INodeEndpointClient GetNodeEndpointClientForEndpointUserId(string targetEndpointUrl, EndpointVersionType type, string endpointUserId, out string endpointUsername) { if (string.IsNullOrEmpty(endpointUserId)) { endpointUsername = NodeEndpointClientFactory.DefaultAuthenticationCredentials.UserName; return(GetNodeEndpointClient(targetEndpointUrl, type, null)); } else { UserAccount account = EndpointUserDao.GetById(endpointUserId); if (account == null) { throw new ArgumentException(string.Format("The node endpoint user with id \"{0}\" could not be found.", endpointUserId)); } endpointUsername = account.NaasAccount; return(GetNodeEndpointClient(targetEndpointUrl, type, endpointUsername)); } }