use of com.evolveum.midpoint.authentication.impl.factory.channel.AbstractChannelFactory in project midpoint by Evolveum.
the class AuthSequenceUtil method buildAuthChannel.
public static AuthenticationChannel buildAuthChannel(AuthChannelRegistryImpl registry, AuthenticationSequenceType sequence) {
Validate.notNull(sequence, "Couldn't build authentication channel object, because sequence is null");
String channelId = null;
AuthenticationSequenceChannelType channelSequence = sequence.getChannel();
if (channelSequence != null) {
channelId = channelSequence.getChannelId();
}
AbstractChannelFactory factory = registry.findModelFactory(channelId);
if (factory == null) {
LOGGER.error("Couldn't find factory for {}", channelId);
return null;
}
AuthenticationChannel channel = null;
try {
channel = factory.createAuthChannel(channelSequence);
} catch (Exception e) {
LOGGER.error("Couldn't create channel for {}", channelId);
}
return channel;
}
Aggregations