@Bean(name = "jdbcMessageSourceDao") @ConditionalOnMissingBean public SimpleJdbcMessageSourceDao jdbcMessageSourceDa(DataSource dataSource) { SimpleJdbcMessageSourceDao jdbcMessageSourceDao = new SimpleJdbcMessageSourceDao(); jdbcMessageSourceDao.setDataSource(dataSource); if (hasText(getTableName())) { jdbcMessageSourceDao.setTable(getTableName()); } if (hasText(getMessageColumnName())) { jdbcMessageSourceDao.setMessage(getMessageColumnName()); } if (hasText(getTypeColumnName())) { jdbcMessageSourceDao.setType(getTypeColumnName()); } if (hasText(getCodeIdColumnName())) { jdbcMessageSourceDao.setCodeId(getCodeIdColumnName()); } if (hasText(getLangIdColumnName())) { jdbcMessageSourceDao.setLangId(getLangIdColumnName()); } return jdbcMessageSourceDao; }
@Bean @ConditionalOnMissingBean({ ConnectionFactoryLocator.class, ResourceServerTokenServices.class }) public UserInfoTokenServices userInfoTokenServices() { UserInfoTokenServices services = new UserInfoTokenServices( this.sso.getUserInfoUri(), this.sso.getClientId()); services.setTokenType(this.sso.getTokenType()); services.setRestTemplate(this.restTemplate); if (this.authoritiesExtractor != null) { services.setAuthoritiesExtractor(this.authoritiesExtractor); } if (this.principalExtractor != null) { services.setPrincipalExtractor(this.principalExtractor); } return services; }
@Autowired @Bean @ConditionalOnMissingBean(name = "proxyValidateController") public ProxyValidateController proxyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor, @Qualifier("defaultAuthenticationSystemSupport") final AuthenticationSystemSupport authenticationSystemSupport) { final ProxyValidateController c = new ProxyValidateController(); c.setValidationSpecification(cas20ProtocolValidationSpecification); c.setSuccessView(cas3ServiceSuccessView()); c.setFailureView(cas3ServiceFailureView); c.setProxyHandler(proxy20Handler); c.setAuthenticationSystemSupport(authenticationSystemSupport); c.setServicesManager(servicesManager); c.setCentralAuthenticationService(centralAuthenticationService); c.setArgumentExtractor(argumentExtractor); c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy); c.setAuthenticationContextValidator(authenticationContextValidator); c.setJsonView(cas3ServiceJsonView()); c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute()); return c; }
@Bean @ConditionalOnClass(DefaultMQProducer.class) @ConditionalOnMissingBean(DefaultMQProducer.class) @ConditionalOnProperty(prefix = "spring.rocketmq", value = {"nameServer", "producer.group"}) public DefaultMQProducer mqProducer(RocketMQProperties rocketMQProperties) { RocketMQProperties.Producer producerConfig = rocketMQProperties.getProducer(); String groupName = producerConfig.getGroup(); Assert.hasText(groupName, "[spring.rocketmq.producer.group] must not be null"); DefaultMQProducer producer = new DefaultMQProducer(producerConfig.getGroup()); producer.setNamesrvAddr(rocketMQProperties.getNameServer()); producer.setSendMsgTimeout(producerConfig.getSendMsgTimeout()); producer.setRetryTimesWhenSendFailed(producerConfig.getRetryTimesWhenSendFailed()); producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed()); producer.setMaxMessageSize(producerConfig.getMaxMessageSize()); producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMsgBodyOverHowmuch()); producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk()); return producer; }
@Bean @ConditionalOnMissingBean(name = "tensorflowInputConverter") @SuppressWarnings("unchecked") public TensorflowInputConverter tensorflowInputConverter() { return new TensorflowInputConverter() { @Override public Map<String, Object> convert(Object input, Map<String, Object> processorContext) { if (input instanceof Map) { return (Map<String, Object>) input; } throw new MessageConversionException("Unsupported input format: " + input); } }; }
@ConditionalOnMissingBean(name = "attributeRepositories") @Bean @RefreshScope public List<IPersonAttributeDao> attributeRepositories() { final List<IPersonAttributeDao> list = new ArrayList<>(); list.addAll(ldapAttributeRepositories()); list.addAll(jdbcAttributeRepositories()); list.addAll(jsonAttributeRepositories()); list.addAll(groovyAttributeRepositories()); list.addAll(grouperAttributeRepositories()); list.addAll(stubAttributeRepositories()); OrderComparator.sort(list); LOGGER.debug("Final list of attribute repositories is [{}]", list); return list; }
@Bean @ConditionalOnMissingBean(LoggerFormats.class) public LoggerFormats loggerFormats() { return LoggerFormats.builder() .enter("#${method.name}(${method.args}): " + "entered") .warnBefore("#${method.name}(${method.args}): " + "in ${method.duration} and still running (max ${method.warn.duration})") .warnAfter("#${method.name}(${method.args}): " + "${method.result} in ${method.duration} (max ${method.warn.duration})") .after("#${method.name}(${method.args}): " + "${method.result} in ${method.duration}") .error("#${method.name}(${method.args}): " + "thrown ${error.class.name}(${error.message}) " + "from ${error.source.class.name}[${error.source.line}] in ${method.duration}") .build(); }
@Bean(destroyMethod = "close") @ConditionalOnMissingBean(name = "tarantoolClient") public TarantoolClient tarantoolClient( SocketChannelProvider socketChannelProvider, TarantoolClientConfig config ) { return new TarantoolClientImpl(socketChannelProvider, config); }
@ConditionalOnMissingBean(name = "multifactorAuthenticationProviderSelector") @Bean @RefreshScope public MultifactorAuthenticationProviderSelector multifactorAuthenticationProviderSelector() { final Resource script = casProperties.getAuthn().getMfa().getProviderSelectorGroovyScript(); if (script != null) { return new GroovyScriptMultifactorAuthenticationProviderSelector(script); } return new RankedMultifactorAuthenticationProviderSelector(); }
@Bean(destroyMethod = "stop") @ConditionalOnProperty({ "nakadi-producer.access-token-uri", "nakadi-producer.access-token-scopes" }) @ConditionalOnMissingBean(AccessTokenProvider.class) public StupsTokenComponent accessTokenProvider( @Value("${nakadi-producer.access-token-uri}") URI accessTokenUri, @Value("${nakadi-producer.access-token-scopes}") String[] accessTokenScopes) { return new StupsTokenComponent(accessTokenUri, Arrays.asList(accessTokenScopes)); }
/** * CLI handler bean * @param springApplicationArguments for CLI args * @return constructed MyBatisMigrationsCliHandler bean */ @Bean(name = MY_BATIS_MIGRATIONS_CLI_HANDLER_BEAN) @ConditionalOnMissingBean public MyBatisMigrationsCliHandler myBatisMigrationsCliHandler( ApplicationArguments springApplicationArguments) { return new MyBatisMigrationsCliHandler(springApplicationArguments.getSourceArgs()); }
@Lazy @Bean(name = "activemq-respond-map-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQRespondMapComponent configureActiveMQRespondMapComponent() throws Exception { ActiveMQRespondMapComponent connector = new ActiveMQRespondMapComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<ActiveMQRespondMapComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-map.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-map.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Bean @ConditionalOnMissingBean public ClickHouseDataSource clickHouseDataSource(Environment environment, ClickHouseProperties clickHouseProperties) { return new ClickHouseDataSource( environment.getProperty("clickhouse.metrics.datasource.url", CLICKHOUSE_JDBC_URL), clickHouseProperties); }
@RefreshScope @ConditionalOnMissingBean(name = "sendTicketGrantingTicketAction") @Bean public Action sendTicketGrantingTicketAction() { return new SendTicketGrantingTicketAction(centralAuthenticationService, servicesManager, ticketGrantingTicketCookieGenerator, casProperties.getSso().isRenewedAuthn()); }
@Bean @ConditionalOnMissingBean public WxSessionManager wxSessionManager() { return new DefaultWxSessionManager(wxProperties.getServer().getSessionTimeout(), wxProperties.getServer().getMaxActiveLimit(), BeanUtils.instantiate(wxProperties.getServer().getWxSessionIdGeneratorClass())); }
@ConditionalOnMissingBean(name = "globalAuthenticationPolicyWebflowEventResolver") @Bean @RefreshScope public CasWebflowEventResolver globalAuthenticationPolicyWebflowEventResolver() { return new GlobalMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, selector, casProperties); }
@Lazy @Bean(name = "salesforce-delete-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceDeleteSObjectComponent configureSalesforceDeleteSObjectComponent() throws Exception { SalesforceDeleteSObjectComponent connector = new SalesforceDeleteSObjectComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<SalesforceDeleteSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-delete-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-delete-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Bean @ConditionalOnMissingBean public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) { ExecutorType executorType = this.properties.getExecutorType(); if (executorType != null) { return new SqlSessionTemplate(sqlSessionFactory, executorType); } else { return new SqlSessionTemplate(sqlSessionFactory); } }
@Autowired @ConditionalOnMissingBean(name = "jsonServiceRegistryDao") @Bean public ServiceRegistryInitializer serviceRegistryInitializer(@Qualifier(BEAN_NAME_SERVICE_REGISTRY_DAO) final ServiceRegistryDao serviceRegistryDao) { return new ServiceRegistryInitializer(embeddedJsonServiceRegistry(eventPublisher), serviceRegistryDao, servicesManager(serviceRegistryDao), casProperties.getServiceRegistry().isInitFromJson()); }
@ConditionalOnMissingBean( name = {"jdbcPrincipalFactory"} ) @Bean @RefreshScope public PrincipalFactory jdbcPrincipalFactory() { return new DefaultPrincipalFactory(); }
@Bean @ConditionalOnMissingBean public static Storage storage(CredentialsProvider credentialsProvider, GcpStorageProperties gcpStorageProperties) throws IOException { return StorageOptions.newBuilder() .setCredentials(gcpStorageProperties.getCredentials().getLocation() != null ? GoogleCredentials .fromStream(gcpStorageProperties.getCredentials() .getLocation().getInputStream()) .createScoped(gcpStorageProperties.getCredentials().getScopes()) : credentialsProvider.getCredentials()) .build().getService(); }
@ConditionalOnMissingBean(name = "auditActionResolverMap") @Bean public Map<String, AuditActionResolver> auditActionResolverMap() { final Map<String, AuditActionResolver> map = new HashMap<>(); final AuditActionResolver resolver = authenticationActionResolver(); map.put("AUTHENTICATION_RESOLVER", resolver); map.put("SAVE_SERVICE_ACTION_RESOLVER", resolver); map.put("CHANGE_PASSWORD_ACTION_RESOLVER", resolver); final AuditActionResolver defResolver = new DefaultAuditActionResolver(); map.put("DESTROY_TICKET_GRANTING_TICKET_RESOLVER", defResolver); map.put("DESTROY_PROXY_GRANTING_TICKET_RESOLVER", defResolver); final AuditActionResolver cResolver = ticketCreationActionResolver(); map.put("CREATE_PROXY_GRANTING_TICKET_RESOLVER", cResolver); map.put("GRANT_SERVICE_TICKET_RESOLVER", cResolver); map.put("GRANT_PROXY_TICKET_RESOLVER", cResolver); map.put("CREATE_TICKET_GRANTING_TICKET_RESOLVER", cResolver); map.put("TRUSTED_AUTHENTICATION_ACTION_RESOLVER", cResolver); map.put("AUTHENTICATION_EVENT_ACTION_RESOLVER", new DefaultAuditActionResolver("_TRIGGERED", StringUtils.EMPTY)); final AuditActionResolver adResolver = new DefaultAuditActionResolver(); map.put("ADAPTIVE_RISKY_AUTHENTICATION_ACTION_RESOLVER", adResolver); map.put("VALIDATE_SERVICE_TICKET_RESOLVER", ticketValidationActionResolver()); return map; }
@Lazy @Bean(name = "salesforce-update-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceUpdateSObjectComponent configureSalesforceUpdateSObjectComponent() throws Exception { SalesforceUpdateSObjectComponent connector = new SalesforceUpdateSObjectComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<SalesforceUpdateSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-update-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-update-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Bean @ConditionalOnMissingBean(ProxyWebSocketErrorHandler.class) public ProxyWebSocketErrorHandler proxyWebSocketErrorHandler() { Set<ProxyWebSocketErrorHandler> handlerSet = new HashSet<>(); handlerSet.add(new DefaultProxyWebSocketErrorHandler()); handlerSet.add(new ReconnectErrorHandler()); return new CompositeErrorHandler(handlerSet); }
@Lazy @Bean(name = "day-trade-get-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public DayTradeGetComponent configureDayTradeGetComponent() throws Exception { DayTradeGetComponent connector = new DayTradeGetComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<DayTradeGetComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-get.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-get.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@RefreshScope @Bean @ConditionalOnMissingBean(name = "authenticationContextValidator") public AuthenticationContextValidator authenticationContextValidator() { final String contextAttribute = casProperties.getAuthn().getMfa().getAuthenticationContextAttribute(); final String failureMode = casProperties.getAuthn().getMfa().getGlobalFailureMode(); final String authnAttributeName = casProperties.getAuthn().getMfa().getTrusted().getAuthenticationContextAttribute(); return new DefaultAuthenticationContextValidator(contextAttribute, failureMode, authnAttributeName); }
@ConditionalOnMissingBean(name = "authorizationGenerator") @Bean @RefreshScope public AuthorizationGenerator authorizationGenerator() { final List<String> authzAttributes = casProperties.getMgmt().getAuthzAttributes(); if (!authzAttributes.isEmpty()) { if ("*".equals(authzAttributes)) { return new PermitAllAuthorizationGenerator(); } return new FromAttributesAuthorizationGenerator(authzAttributes.toArray(new String[]{}), new String[]{}); } return new SpringSecurityPropertiesAuthorizationGenerator(userProperties()); }
@ConditionalOnMissingBean(name = "defaultSingleLogoutServiceMessageHandler") @Bean public SingleLogoutServiceMessageHandler defaultSingleLogoutServiceMessageHandler() { return new DefaultSingleLogoutServiceMessageHandler(httpClient, logoutBuilder(), servicesManager, singleLogoutServiceLogoutUrlBuilder(), casProperties.getSlo().isAsynchronous(), authenticationRequestServiceSelectionStrategies); }
@ConditionalOnMissingBean(name = "shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy") @Bean @RefreshScope public AuthenticationServiceSelectionStrategy shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy() { return new ShibbolethIdPEntityIdAuthenticationServiceSelectionStrategy(webApplicationServiceFactory, casProperties.getAuthn().getShibIdP().getServerUrl()); }
@Lazy @Bean(name = "activemq-publish-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQPublishComponent configureActiveMQPublishComponent() throws Exception { ActiveMQPublishComponent connector = new ActiveMQPublishComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<ActiveMQPublishComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Bean @ConditionalOnMissingBean(JobRepository.class) public JobRepository getJobRepository() throws Exception { BatchConfigurer batchConfigurer = getBatchConfigurer(); if (batchConfigurer != null) { return batchConfigurer.getJobRepository(); } JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(dataSource); factory.setTransactionManager(transactionManager); factory.afterPropertiesSet(); // factory.setIsolationLevelForCreate("ISOLATION_DEFAULT"); return factory.getObject(); }
@ConditionalOnMissingBean(name = "registeredServiceAuthenticationPolicyWebflowEventResolver") @Bean @RefreshScope public CasWebflowEventResolver registeredServiceAuthenticationPolicyWebflowEventResolver() { return new RegisteredServiceMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport, centralAuthenticationService, servicesManager, ticketRegistrySupport, warnCookieGenerator, authenticationRequestServiceSelectionStrategies, selector); }
@Bean @ConditionalOnMissingBean(name = "jerseyFilterRegistration") @ConditionalOnProperty(prefix = "holon.resteasy", name = "type", havingValue = "filter") public FilterRegistrationBean resteasyFilterRegistration() { final Filter filter = new Filter30Dispatcher(); FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setFilter(filter); registration.setUrlPatterns(Arrays.asList(this.path)); registration.setOrder(this.resteasy.getFilter().getOrder()); registration.setName("resteasyFilter"); registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class)); return registration; }
@Lazy @Bean(name = "swagger-operation-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SwaggerConnectorComponent configureSwaggerConnectorComponent() throws Exception { SwaggerConnectorComponent connector = new SwaggerConnectorComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<SwaggerConnectorComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "day-trade-place-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public DayTradePlaceComponent configureDayTradePlaceComponent() throws Exception { DayTradePlaceComponent connector = new DayTradePlaceComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<DayTradePlaceComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-place.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-place.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@RefreshScope @Bean @ConditionalOnMissingBean(name = "genericSuccessViewAction") public Action genericSuccessViewAction() { return new GenericSuccessViewAction(centralAuthenticationService, servicesManager, webApplicationServiceFactory, casProperties.getView().getDefaultRedirectUrl()); }
@ConditionalOnMissingBean(name = "jdbcAuthenticationHandlers") @Bean @RefreshScope public Collection<AuthenticationHandler> jdbcAuthenticationHandlers() { final Collection<AuthenticationHandler> handlers = new HashSet<>(); final JdbcAuthenticationProperties jdbc = casProperties.getAuthn().getJdbc(); jdbc.getBind().forEach(b -> handlers.add(bindModeSearchDatabaseAuthenticationHandler(b))); jdbc.getEncode().forEach(b -> handlers.add(queryAndEncodeDatabaseAuthenticationHandler(b))); jdbc.getQuery().forEach(b -> handlers.add(queryDatabaseAuthenticationHandler(b))); jdbc.getSearch().forEach(b -> handlers.add(searchModeSearchDatabaseAuthenticationHandler(b))); return handlers; }
@ConditionalOnMissingBean(name = "httpClient") @Bean public FactoryBean<SimpleHttpClient> httpClient() { final SimpleHttpClientFactoryBean.DefaultHttpClient c = new SimpleHttpClientFactoryBean.DefaultHttpClient(); c.setConnectionTimeout(casProperties.getHttpClient().getConnectionTimeout()); c.setReadTimeout(Long.valueOf(casProperties.getHttpClient().getReadTimeout()).intValue()); return c; }
@Lazy @Bean(name = "activemq-respond-text-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQRespondTextComponent configureActiveMQRespondTextComponent() throws Exception { ActiveMQRespondTextComponent connector = new ActiveMQRespondTextComponent(); connector.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false); connector.setOptions(parameters); if (ObjectHelper.isNotEmpty(customizers)) { for (ConnectorCustomizer<ActiveMQRespondTextComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-text.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-text.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Bean @ConditionalOnBean(name = {"serverAcceptor", "serverSessionSettings"}) @ConditionalOnClass({Acceptor.class, SessionSettings.class}) @ConditionalOnMissingBean @ConditionalOnEnabledEndpoint("quickfixjserver") public QuickFixJServerEndpoint quickfixjServerEndpoint(Acceptor serverAcceptor, SessionSettings serverSessionSettings) { return new QuickFixJServerEndpoint(serverAcceptor, serverSessionSettings); }