use of org.apache.archiva.rest.api.v2.svc.ErrorKeys.REPOSITORY_ADMIN_ERROR in project archiva by apache.
the class DefaultSecurityConfigurationService method updateLdapConfiguration.
@Override
public LdapConfiguration updateLdapConfiguration(LdapConfiguration configuration) throws ArchivaRestServiceException {
try {
RedbackRuntimeConfiguration redbackRuntimeConfiguration = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
log.debug("getRedbackRuntimeConfiguration -> {}", redbackRuntimeConfiguration);
updateConfig(configuration, redbackRuntimeConfiguration);
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
ldapConnectionFactory.initialize();
} catch (RepositoryAdminException e) {
throw new ArchivaRestServiceException(ErrorMessage.of(REPOSITORY_ADMIN_ERROR));
}
try {
return LdapConfiguration.of(redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getLdapConfiguration());
} catch (RepositoryAdminException e) {
log.error("Error while retrieve updated configuration: {}", e.getMessage());
throw new ArchivaRestServiceException(ErrorMessage.of(REPOSITORY_ADMIN_ERROR, e.getMessage()));
}
}
use of org.apache.archiva.rest.api.v2.svc.ErrorKeys.REPOSITORY_ADMIN_ERROR in project archiva by apache.
the class DefaultSecurityConfigurationService method updateCacheConfiguration.
@Override
public CacheConfiguration updateCacheConfiguration(CacheConfiguration cacheConfiguration) throws ArchivaRestServiceException {
if (cacheConfiguration == null) {
throw new ArchivaRestServiceException(ErrorMessage.of(ErrorKeys.MISSING_DATA), 400);
}
try {
RedbackRuntimeConfiguration redbackRuntimeConfiguration = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
log.debug("getRedbackRuntimeConfiguration -> {}", redbackRuntimeConfiguration);
updateConfig(cacheConfiguration, redbackRuntimeConfiguration);
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
return getCacheConfiguration();
} catch (RepositoryAdminException e) {
throw new ArchivaRestServiceException(ErrorMessage.of(REPOSITORY_ADMIN_ERROR));
}
}
use of org.apache.archiva.rest.api.v2.svc.ErrorKeys.REPOSITORY_ADMIN_ERROR in project archiva by apache.
the class DefaultSecurityConfigurationService method getConfiguration.
@Override
public SecurityConfiguration getConfiguration() throws ArchivaRestServiceException {
try {
RedbackRuntimeConfiguration redbackRuntimeConfiguration = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
log.debug("getRedbackRuntimeConfiguration -> {}", redbackRuntimeConfiguration);
return SecurityConfiguration.ofRedbackConfiguration(redbackRuntimeConfiguration);
} catch (RepositoryAdminException e) {
throw new ArchivaRestServiceException(ErrorMessage.of(REPOSITORY_ADMIN_ERROR));
}
}
Aggregations