Search in sources :

Example 1 with UniqueTypeValidationStepHandler

use of org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler in project wildfly by wildfly.

the class HandlerAddHandler method execute.

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
    context.addStep(new AlternativeAttributeValidationStepHandler(new SimpleAttributeDefinition[] { HandlerResourceDefinition.CLASS_NAME, HandlerResourceDefinition.CODE }), OperationContext.Stage.MODEL);
    context.addStep(new UniqueTypeValidationStepHandler(ModelElement.COMMON_HANDLER) {

        @Override
        protected String getType(OperationContext context, ModelNode model) throws OperationFailedException {
            return getHandlerType(context, model);
        }
    }, OperationContext.Stage.MODEL);
    super.execute(context, operation);
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) OperationFailedException(org.jboss.as.controller.OperationFailedException) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) UniqueTypeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler) ModelNode(org.jboss.dmr.ModelNode) AlternativeAttributeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler)

Aggregations

OperationContext (org.jboss.as.controller.OperationContext)1 OperationFailedException (org.jboss.as.controller.OperationFailedException)1 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)1 ModelNode (org.jboss.dmr.ModelNode)1 AlternativeAttributeValidationStepHandler (org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler)1 UniqueTypeValidationStepHandler (org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler)1