예제 #1
0
  private Uid doUpdate() throws IOException {

    if (!objectClass.equals(ObjectClass.ACCOUNT) && (!objectClass.equals(ObjectClass.GROUP))) {
      throw new IllegalStateException("Wrong object class");
    }

    if (!userExists(
        uid.getUidValue(), configuration.getOpenamRealm(), adminToken.getToken(), connection)) {
      LOG.error("User " + uid.getUidValue() + " do not exists");
      throw new ConnectorException("User " + uid.getUidValue() + " do not exists");
    }

    try {
      connection.update(createUpdateQueryString(uid, attrs, adminToken).toString());
      LOG.ok("User " + uid.getUidValue() + " updated");
    } catch (HttpClientErrorException hcee) {
      throw hcee;
    }
    return uid;
  }