code: public void setUser(String userName, String password){
          if(userName != null && ! userName.isEmpty()){
              connection.setDirectoryUser(userName, password);
          }
      }
docs: Set the user for the DirectoryServiceClient.
  
  It will ask the DirectoryConnection to do authentication again.
  
  @param userName
  the user name.
  @param password
  the password.