use of org.apache.archiva.rest.api.model.UserManagerImplementationInformation in project archiva by apache.
the class DefaultRedbackRuntimeConfigurationService method getUserManagerImplementationInformations.
@Override
public List<UserManagerImplementationInformation> getUserManagerImplementationInformations() throws ArchivaRestServiceException {
Map<String, UserManager> beans = applicationContext.getBeansOfType(UserManager.class);
if (beans.isEmpty()) {
return Collections.emptyList();
}
List<UserManagerImplementationInformation> informations = new ArrayList<>(beans.size());
for (Map.Entry<String, UserManager> entry : beans.entrySet()) {
UserManager userManager = applicationContext.getBean(entry.getKey(), UserManager.class);
if (userManager.isFinalImplementation()) {
UserManagerImplementationInformation information = new UserManagerImplementationInformation();
information.setBeanId(StringUtils.substringAfter(entry.getKey(), "#"));
information.setDescriptionKey(userManager.getDescriptionKey());
information.setReadOnly(userManager.isReadOnly());
informations.add(information);
}
}
return informations;
}
use of org.apache.archiva.rest.api.model.UserManagerImplementationInformation in project archiva by apache.
the class RedbackRuntimeConfigurationServiceTest method usermanagersinformations.
@Test
public void usermanagersinformations() throws Exception {
RedbackRuntimeConfigurationService service = getRedbackRuntimeConfigurationService();
List<UserManagerImplementationInformation> infos = service.getUserManagerImplementationInformations();
assertThat(infos).isNotNull().isNotEmpty().contains(new UserManagerImplementationInformation("jpa", null, false));
}
Aggregations