Search in sources :

Example 1 with UserAddOperation

use of com.sequenceiq.freeipa.client.operation.UserAddOperation in project cloudbreak by hortonworks.

the class UserSyncService method addUsers.

void addUsers(boolean fmsToFreeipaBatchCallEnabled, FreeIpaClient freeIpaClient, Set<FmsUser> fmsUsers, BiConsumer<String, String> warnings) throws FreeIpaClientException {
    List<UserAddOperation> operations = Lists.newArrayList();
    for (FmsUser fmsUser : fmsUsers) {
        operations.add(UserAddOperation.create(fmsUser.getName(), fmsUser.getFirstName(), fmsUser.getLastName(), fmsUser.getState() == FmsUser.State.DISABLED));
    }
    invokeOperation(operations, fmsToFreeipaBatchCallEnabled, freeIpaClient, warnings, Set.of(FreeIpaErrorCodes.DUPLICATE_ENTRY), true);
}
Also used : FmsUser(com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser) UserAddOperation(com.sequenceiq.freeipa.client.operation.UserAddOperation)

Example 2 with UserAddOperation

use of com.sequenceiq.freeipa.client.operation.UserAddOperation in project cloudbreak by hortonworks.

the class UserSyncOperations method addUsers.

public void addUsers(boolean fmsToFreeipaBatchCallEnabled, FreeIpaClient freeIpaClient, Set<FmsUser> fmsUsers, BiConsumer<String, String> warnings) throws FreeIpaClientException, TimeoutException {
    List<UserAddOperation> operations = Lists.newArrayList();
    for (FmsUser fmsUser : fmsUsers) {
        threadInterruptChecker.throwTimeoutExIfInterrupted();
        operations.add(UserAddOperation.create(fmsUser.getName(), fmsUser.getFirstName(), fmsUser.getLastName(), fmsUser.getState() == FmsUser.State.DISABLED));
    }
    invokeOperation(operations, fmsToFreeipaBatchCallEnabled, freeIpaClient, warnings, Set.of(FreeIpaErrorCodes.DUPLICATE_ENTRY), true);
}
Also used : FmsUser(com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser) UserAddOperation(com.sequenceiq.freeipa.client.operation.UserAddOperation)

Aggregations

UserAddOperation (com.sequenceiq.freeipa.client.operation.UserAddOperation)2 FmsUser (com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser)2