public void setUser(User user) throws RemoteException, VOMSException {

    log.info("setUser(" + StringUtils.join(new Object[] {user}, ',') + ");");

    if (user == null) throw new NullArgumentException("User passed as argument is null!");

    VOMSUser u = (VOMSUser) FindUserOperation.instance(user.getDN(), user.getCA()).execute();

    if (u == null)
      throw new NoSuchUserException(
          "User (" + user.getDN() + "," + user.getCA() + ") not found in database!");

    Validator.validateUser(user);

    u.fromUser(user);

    UpdateUserOperation.instance(u).execute();
  }
  public void createUser(User user) throws RemoteException, VOMSException {

    log.info(
        "createUser(" + StringUtils.join(new Object[] {user.getDN(), user.getCA()}, ',') + ");");

    try {

      Validator.validateUser(user);
      CreateUserOperation.instance(
              user.getDN(), user.getCA(), user.getCN(), user.getCertUri(), user.getMail())
          .execute();

      HibernateFactory.commitTransaction();

    } catch (RuntimeException e) {

      ServiceExceptionHelper.handleServiceException(log, e);
      throw e;
    }
  }