use of io.micronaut.core.value.ValueResolver in project micronaut-security by micronaut-projects.
the class LdapEnabledCondition method matches.
@Override
public boolean matches(ConditionContext context) {
AnnotationMetadataProvider component = context.getComponent();
if (component instanceof ValueResolver) {
Optional<String> optional = ((ValueResolver) component).get(Named.class.getName(), String.class);
if (optional.isPresent()) {
String name = optional.get();
LdapConfiguration ldapConfiguration = context.getBean(LdapConfiguration.class, Qualifiers.byName(name));
return ldapConfiguration.isEnabled();
}
}
return true;
}
Aggregations