use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.
the class HandlerAddHandler method toHandlerConfig.
public static Handler toHandlerConfig(OperationContext context, ModelNode handler) throws OperationFailedException {
Handler newHandler = new Handler();
String typeName = HandlerResourceDefinition.getHandlerType(context, handler);
newHandler.setClazz(typeName);
return newHandler;
}
use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.
the class HandlerAddHandler method performRuntime.
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
PathAddress pathAddress = PathAddress.pathAddress(operation.get(ADDRESS));
String providerAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();
EntityProviderService providerService = EntityProviderService.getService(context, providerAlias);
Handler handler = toHandlerConfig(context, model);
providerService.addHandler(handler);
}
use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.
the class EntityProviderService method addHandler.
void addHandler(Class<? extends SAML2Handler> handlerClassName, Handlers handlers) {
for (Handler handler : handlers.getHandler()) {
if (handler.getClazz().equals(handlerClassName.getName())) {
return;
}
}
Handler handler = new Handler();
handler.setClazz(handlerClassName.getName());
handlers.add(handler);
}
use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.
the class EntityProviderService method configureHandlers.
/**
* <p> Configure the SAML Handlers. </p>
*/
private void configureHandlers() {
Handlers actualHandlers = new Handlers();
actualHandlers.setHandlers(new ArrayList<Handler>());
if (this.handlers.isEmpty()) {
for (Class<? extends SAML2Handler> commonHandlerClass : getDefaultHandlers()) {
addHandler(commonHandlerClass, actualHandlers);
}
} else {
for (Handler handler : this.handlers) {
actualHandlers.add(handler);
}
}
getPicketLinkType().setHandlers(actualHandlers);
}
use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.
the class AbstractEntityProviderAddHandler method configureHandler.
protected static void configureHandler(OperationContext context, ModelNode model, EntityProviderService service) throws OperationFailedException {
if (model.hasDefined(ModelElement.COMMON_HANDLER.getName())) {
for (Property handlerProperty : model.get(ModelElement.COMMON_HANDLER.getName()).asPropertyList()) {
ModelNode handler = handlerProperty.getValue();
Handler newHandler = toHandlerConfig(context, handler);
if (handler.hasDefined(COMMON_HANDLER_PARAMETER.getName())) {
for (Property handlerParameter : handler.get(COMMON_HANDLER_PARAMETER.getName()).asPropertyList()) {
String paramName = handlerParameter.getName();
ModelNode parameterNode = handlerParameter.getValue();
KeyValueType kv = toHandlerParameterConfig(context, paramName, parameterNode);
newHandler.add(kv);
}
}
service.addHandler(newHandler);
}
}
}
Aggregations