use of org.springframework.roo.addon.security.addon.security.providers.SecurityProvider in project spring-roo by spring-projects.
the class SecurityOperationsImpl method getAllSecurityProviders.
@Override
public List<SecurityProvider> getAllSecurityProviders() {
if (securityProviders.isEmpty()) {
// Get all Services implement SecurityProvider interface
try {
ServiceReference<?>[] references = this.context.getAllServiceReferences(SecurityProvider.class.getName(), null);
for (ServiceReference<?> ref : references) {
SecurityProvider securityProvider = (SecurityProvider) this.context.getService(ref);
securityProviders.add(securityProvider);
}
return securityProviders;
} catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load SecurityProvider on SecurityOperationsImpl.");
return null;
}
} else {
return securityProviders;
}
}
use of org.springframework.roo.addon.security.addon.security.providers.SecurityProvider in project spring-roo by spring-projects.
the class SecurityCommands method getAllSecurityProviders.
@CliOptionAutocompleteIndicator(command = "security setup", param = "provider", help = "You must select a valid security provider.", validate = true)
public List<String> getAllSecurityProviders(ShellContext context) {
List<String> results = new ArrayList<String>();
List<SecurityProvider> securityProviders = securityOperations.getAllSecurityProviders();
for (SecurityProvider provider : securityProviders) {
if (provider.isInstallationAvailable()) {
results.add(provider.getName());
}
}
return results;
}
Aggregations