/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String layer = LAYER.resolveModelAttribute(context, model).asString(); final String applicationContext = APPLICATION_CONTEXT.resolveModelAttribute(context, model).asString(); final String description = DESCRIPTION.resolveModelAttribute(context, model).asStringOrNull(); final String addressValue = context.getCurrentAddressValue(); final JaspiConfigurationBuilder builder = JaspiConfigurationBuilder.builder("*".equals(layer) ? null : layer, "*".equals(applicationContext) ? null : applicationContext) .setDescription(description); final List<ModelNode> serverAuthModules = SERVER_AUTH_MODULES.resolveModelAttribute(context, model).asList(); for (ModelNode serverAuthModule : serverAuthModules) { final String className = CLASS_NAME.resolveModelAttribute(context, serverAuthModule).asString(); final String module = MODULE.resolveModelAttribute(context, serverAuthModule).asStringOrNull(); final Flag flag = Flag.valueOf(FLAG.resolveModelAttribute(context, serverAuthModule).asString()); final Map<String, String> options = OPTIONS.unwrap(context, serverAuthModule); builder.addAuthModuleFactory(createServerAuthModuleSupplier(className, module), flag, options); } final String registrationId = builder.register(); REGISTRATION_MAP.put(addressValue, registrationId); }