use of org.apache.archiva.redback.users.UserManager in project archiva by apache.
the class ArchivaConfigurableUsersManager method userExists.
@Override
public boolean userExists(String userName) throws UserManagerException {
Exception lastException = null;
boolean allFailed = true;
boolean exists = false;
for (UserManager userManager : userManagerPerId.values()) {
try {
if (userManager.userExists(userName)) {
exists = true;
}
allFailed = false;
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new UserManagerException(lastException.getMessage(), lastException);
}
return exists;
}
use of org.apache.archiva.redback.users.UserManager in project archiva by apache.
the class ArchivaConfigurableUsersManager method updateUser.
@Override
public User updateUser(User user) throws UserNotFoundException, UserManagerException {
UserManager userManager = userManagerPerId.get(user.getUserManagerId());
user = userManager.updateUser(user);
if (useUsersCache()) {
usersCache.put(user.getUsername(), user);
}
return user;
}
use of org.apache.archiva.redback.users.UserManager in project archiva by apache.
the class ArchivaConfigurableUsersManager method createUser.
@Override
public User createUser(String username, String fullName, String emailAddress) throws UserManagerException {
Exception lastException = null;
boolean allFailed = true;
User user = null;
for (UserManager userManager : userManagerPerId.values()) {
try {
if (!userManager.isReadOnly()) {
user = userManager.createUser(username, fullName, emailAddress);
allFailed = false;
}
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new UserManagerException(lastException.getMessage(), lastException);
}
return user;
}
use of org.apache.archiva.redback.users.UserManager in project archiva by apache.
the class ArchivaConfigurableUsersManager method deleteUser.
@Override
public void deleteUser(String username) throws UserNotFoundException, UserManagerException {
Exception lastException = null;
boolean allFailed = true;
User user = null;
for (UserManager userManager : userManagerPerId.values()) {
try {
if (!userManager.isReadOnly()) {
userManager.deleteUser(username);
allFailed = false;
}
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new UserManagerException(lastException.getMessage(), lastException);
}
}
use of org.apache.archiva.redback.users.UserManager in project archiva by apache.
the class ArchivaConfigurableUsersManager method createGuestUser.
@Override
public User createGuestUser() throws UserManagerException {
Exception lastException = null;
boolean allFailed = true;
User user = null;
for (UserManager userManager : userManagerPerId.values()) {
try {
if (!userManager.isReadOnly()) {
user = userManager.createGuestUser();
allFailed = false;
}
} catch (Exception e) {
lastException = e;
}
}
if (lastException != null && allFailed) {
throw new UserManagerException(lastException.getMessage(), lastException);
}
return user;
}
Aggregations