public RocketChatEndpoint( @Value("${rocketchat.proxy.hostname:}") String proxyHostname, @Value("${rocketchat.proxy.port:80}") int proxyPort, @Value("${rocketchat.proxy.scheme:http}") String proxyScheme ) { httpClientBuilder = HttpClientBuilder.create() .setRetryHandler((exception, executionCount, context) -> executionCount < 3) .setConnectionBackoffStrategy(new ConnectionBackoffStrategy() { @Override public boolean shouldBackoff(Throwable t) { return t instanceof IOException; } @Override public boolean shouldBackoff(HttpResponse resp) { return false; } }) .setUserAgent("Smarti/0.0 Rocket.Chat-Endpoint/0.1"); if(StringUtils.isNotBlank(proxyHostname)) { httpClientBuilder.setProxy(new HttpHost(proxyHostname, proxyPort, proxyScheme)); } }
/** * Creates the duo authentication service. * @param duoIntegrationKey duo integration key * @param duoSecretKey duo secret key * @param duoApplicationKey duo application key * @param duoApiHost duo API host url */ @Autowired public DuoAuthenticationService(@NotNull @Value("${cas.duo.integration.key:}") final String duoIntegrationKey, @NotNull @Value("${cas.duo.secret.key:}") final String duoSecretKey, @NotNull @Value("${cas.duo.application.key:}") final String duoApplicationKey, @NotNull @Value("${cas.duo.api.host:}") final String duoApiHost) { if (StringUtils.isBlank(duoIntegrationKey)) { throw new IllegalArgumentException("Duo integration key cannot be blank"); } if (StringUtils.isBlank(duoSecretKey)) { throw new IllegalArgumentException("Duo secret key cannot be blank"); } if (StringUtils.isBlank(duoApplicationKey)) { throw new IllegalArgumentException("Duo application key cannot be blank"); } if (StringUtils.isBlank(duoApiHost)) { throw new IllegalArgumentException("Duo api host cannot be blank"); } this.duoIntegrationKey = duoIntegrationKey; this.duoSecretKey = duoSecretKey; this.duoApplicationKey = duoApplicationKey; this.duoApiHost = duoApiHost; }
/** * Configures the embedded jetty server. The values are configured in * <b>application.yaml</b> file. * * @param port jetty server port * @param maxThreads thread pool min thread * @param minThreads thread pool max thread * @param idleTimeout maximum thread idle time * @param jmxEnabled true, if jetty jmx is enabled. * @return {@link JettyEmbeddedServletContainerFactory} */ @Bean public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory(@Value("${server.port:8443}") final int port, @Value("${jetty.thread-pool.max-threads:200}") final int maxThreads, @Value("${jetty.thread-pool.min-threads:8}") final int minThreads, @Value("${jetty.thread-pool.idle-timeout:60000}") final int idleTimeout, @Value("${jetty.jmx.enabled:true}") final boolean jmxEnabled) { log.info("Configuring Jetty server."); final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(port); factory.addServerCustomizers(server -> { final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class); threadPool.setMinThreads(minThreads); threadPool.setMaxThreads(maxThreads); threadPool.setIdleTimeout(idleTimeout); log.info("Server thread pool config: " + server.getThreadPool()); // Jetty JMX config. if (jmxEnabled) { log.info("Exposing Jetty managed beans to the JMX platform server."); server.addBean(new MBeanContainer(ManagementFactory.getPlatformMBeanServer())); } }); return factory; }
@Bean public ServerMeta serverMeta(@Value("#{publickeyPem}") String publickeyPem) { ServerMeta meta = new ServerMeta(); meta.setSignaturePublickey(publickeyPem); meta.setSkinDomains(skinDomains); meta.setMeta(ofEntries( entry("serverName", "yggdrasil mock server"), entry("implementationName", "yggdrasil-mock-server"), entry("implementationVersion", "0.0.1"))); return meta; }
/** * Sets the kerberos conf. * * @param kerberosConf the new kerberos conf */ @Autowired public void setKerberosConf(@Value("${cas.spnego.kerb.conf:}") final String kerberosConf) { if (StringUtils.isNotBlank(kerberosConf)) { logger.debug("kerberosConf is set to :{}", kerberosConf); System.setProperty(SYS_PROP_KERBEROS_CONF, kerberosConf); } }
@Autowired public CatalogClient(@Value("${catalog.service.host:catalog}") String catalogServiceHost, @Value("${catalog.service.port:8080}") long catalogServicePort) { super(); this.restTemplate = getRestTemplate(); this.catalogServiceHost = catalogServiceHost; this.catalogServicePort = catalogServicePort; }
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, @Value("${eureka.instance.instanceId}") String instanceId, JHipsterProperties jHipsterProperties) { this.appName = appName; this.serverPort = serverPort; this.instanceId = instanceId; this.jHipsterProperties = jHipsterProperties; if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { addLogstashAppender(context); // Add context listener LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener(); loggerContextListener.setContext(context); context.addListener(loggerContextListener); } }
@Value("${kafka.subscribed.topics}") public void setKafkaSuscribedTopics(final String rawKafkaSubscribedTopics) { final List<String> topicNumThreadPairs = splitCsStrings(rawKafkaSubscribedTopics); this.kafkaSubscribedTopics = topicNumThreadPairs.stream().map(p -> { final List<String> topicNumThreadPair = Splitter.on(':').omitEmptyStrings().splitToList(p); return new TopicInfo(topicNumThreadPair.get(0), topicNumThreadPair.size() == 2 ? Integer.valueOf(topicNumThreadPair.get(1)) : 1); }).collect(Collectors.toList()); }
@Bean StepResultSerializer getStepResultSerializer( @Value("${json.step.result.serializer.impl:#{null}}") Class<? extends StepResultSerializer> impl ) { return null == impl ? beanFactory.createBean(DefaultStepResultSerializer.class) : beanFactory.createBean(impl); }
@Profile({ Modules.REPLICATION }) @Bean Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier( SourceCatalog sourceCatalog, @Value("#{sourceHiveConf}") HiveConf sourceHiveConf, MetaStoreClientFactoryManager metaStoreClientFactoryManager) { String metaStoreUris = sourceCatalog.getHiveMetastoreUris(); if (metaStoreUris == null) { // Default to Thrift is not specified - optional attribute in SourceCatalog metaStoreUris = ThriftMetaStoreClientFactory.ACCEPT_PREFIX; } MetaStoreClientFactory sourceMetaStoreClientFactory = metaStoreClientFactoryManager.factoryForUrl(metaStoreUris); return metaStoreClientSupplier(sourceCatalog.getName(), sourceHiveConf, sourceCatalog.getMetastoreTunnel(), sourceMetaStoreClientFactory); }
/** * Sets the use subject creds only. * * @param useSubjectCredsOnly the new use subject creds only */ @Autowired public void setUseSubjectCredsOnly(@Value("${cas.spnego.use.subject.creds:false}") final boolean useSubjectCredsOnly) { logger.debug("useSubjectCredsOnly is set to {}", useSubjectCredsOnly); System.setProperty(SYS_PROP_USE_SUBJECT_CRED_ONLY, Boolean.toString(useSubjectCredsOnly)); }
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, JHipsterProperties jHipsterProperties) { this.appName = appName; this.serverPort = serverPort; this.jHipsterProperties = jHipsterProperties; if (jHipsterProperties.getLogging().getLogstash().isEnabled()) { addLogstashAppender(context); addContextListener(context); } if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { setMetricsMarkerLogbackFilter(context); } }
@Override @Autowired public void setAfterInitialization( @Value("${validation.processing.afterinit:true}") final boolean afterInitialization) { super.setAfterInitialization(afterInitialization); }
@Autowired protected DefaultMixologist( GherkinResourceLoader loader, Mixology mixology, Categories categories, @Value("${unimplemented.steps.fatal:#{false}}") boolean missingStepFatal ) { this.loader = loader; this.mixology = mixology; this.categories = categories; this.unimplementedStepsFatal = missingStepFatal; this.martinisReference = new AtomicReference<>(); }
@Autowired public HashingService(@Value("${karate.hashing.pepper}") String pepperValue) { try { pepper = pepperValue; salt = getSalt(); digest = MessageDigest.getInstance("SHA-256"); ensureInitOfPepper(); } catch (Exception e) { //Wrap Exception into RuntimeException... throw new IllegalStateException("HashingService not correctly intialized!", e); } }
@Autowired public SourceFactory( SourceCatalog sourceCatalog, @Value("#{sourceHiveConf}") HiveConf sourceHiveConf, @Value("#{sourceMetaStoreClientSupplier}") Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier, SourceCatalogListener sourceCatalogListener) { this.sourceCatalog = sourceCatalog; this.sourceHiveConf = sourceHiveConf; this.sourceMetaStoreClientSupplier = sourceMetaStoreClientSupplier; this.sourceCatalogListener = sourceCatalogListener; }
public FacebookLoginFilter( @Value("${facebook.filter.callback-uri}") String callbackUri, @Value("${facebook.filter.api-base-uri}")String apiBaseUri) { super(new OrRequestMatcher( new AntPathRequestMatcher(callbackUri), new AntPathRequestMatcher(apiBaseUri) )); this.localMatcher = new AntPathRequestMatcher(apiBaseUri); setAuthenticationManager(new NoopAuthenticationManager()); }
@Inject public GoodPasswordGenerator(@Value("${security.password.length}") Integer minPasswordLength, @Value("${security.password.digit}") Boolean requireDigit, @Value("${security.password.alphabet}") Boolean requireAlphabet) { this.minPasswordLength = minPasswordLength; this.requireDigit = requireDigit; this.requireAlphabet = requireAlphabet; LengthRule lengthRule = new LengthRule(minPasswordLength, Integer.MAX_VALUE); WhitespaceRule whitespaceRule = new WhitespaceRule(); // control allowed characters characterRules = new ArrayList<>(); if (requireDigit) { characterRules.add(new CharacterRule(EnglishCharacterData.Digit, 1)); } if (requireAlphabet) { characterRules.add(new CharacterRule(EnglishCharacterData.Alphabetical, 1)); } CharacterCharacteristicsRule charRule = new CharacterCharacteristicsRule(); charRule.getRules().addAll(characterRules); charRule.setNumberOfCharacteristics(charRule.getRules().size()); // group all rules together in a List rules = new ArrayList<>(); rules.add(lengthRule); rules.add(whitespaceRule); rules.add(charRule); }
@Bean Mixology getMixology( @Value("${martini.mixology:#{null}}") Class<? extends Mixology> impl ) { return null == impl ? beanFactory.createBean(DefaultMixology.class) : beanFactory.createBean(impl); }
@Autowired public SimpMessagingServiceImpl(final SimpMessagingTemplate messagingTemplate, @Value("${spring.messaging.topic.serverStates:/topic/server-states}") final String topic) { this.messagingTemplate = messagingTemplate; this.topic = topic; }
@Autowired public Mongo(@Value("${mongo.partition}") String partition, @Value("${mongo.batchSize}") int batchSize, MongoDatabase db) { this.partition = PartitionFactory.ofPattern(partition); this.batchSize = batchSize; this.db = db; }
@Bean(name = "jvmTaskExecutor") public TaskExecutor getJvmTaskExecutor(@Qualifier("pollingThreadFactory") final ThreadFactory threadFactory, @Value("${jvm.thread-task-executor.pool.size}") final int corePoolSize, @Value("${jvm.thread-task-executor.pool.max-size}") final int maxPoolSize, @Value("${jvm.thread-task-executor.pool.queue-capacity}") final int queueCapacity, @Value("${jvm.thread-task-executor.pool.keep-alive-sec}") final int keepAliveSeconds) { final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); threadPoolTaskExecutor.setCorePoolSize(corePoolSize); threadPoolTaskExecutor.setMaxPoolSize(maxPoolSize); threadPoolTaskExecutor.setQueueCapacity(queueCapacity); threadPoolTaskExecutor.setKeepAliveSeconds(keepAliveSeconds); threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); threadPoolTaskExecutor.setThreadFactory(threadFactory); return threadPoolTaskExecutor; }
@Autowired TableComparatorFactory( HiveEndpoint source, HiveEndpoint replica, ComparatorRegistry comparatorRegistry, DiffListener diffListener, @Value("${sourcePartitionBatchSize:1000}") short sourcePartitionBatchSize, @Value("${replicaPartitionBufferSize:1000}") short replicaPartitionBufferSize) { this.sourcePartitionBatchSize = sourcePartitionBatchSize; this.replicaPartitionBufferSize = replicaPartitionBufferSize; this.source = source; this.replica = replica; this.comparatorRegistry = comparatorRegistry; this.diffListener = diffListener; }
@Bean protected RetryTemplate getRetryTemplate(@Value("${controller.retryCount:3}") int retryCount, @Value("${controller.intial_delay:1000}") int initialDelay, @Value("${controller.maxInterval:10000}") int maxInterval) { RetryTemplate retryTemplate = new RetryTemplate(); retryTemplate.setRetryPolicy(new SimpleRetryPolicy(retryCount, Collections.singletonMap(RestClientException.class, true))); ExponentialBackOffPolicy backOffPolicy = new ExponentialBackOffPolicy(); backOffPolicy.setInitialInterval(initialDelay); backOffPolicy.setMaxInterval(maxInterval); retryTemplate.setBackOffPolicy(backOffPolicy); retryTemplate.setThrowLastExceptionOnExhausted(true); retryTemplate.registerListener(new DefaultListenerSupport()); return retryTemplate; }
@Bean(name = "jvmService") public JvmService getJvmService(final GroupPersistenceService groupPersistenceService, final ApplicationService applicationService, final ResourceService resourceService, final ClientFactoryHelper clientFactoryHelper, @Value("${spring.messaging.topic.serverStates:/topic/server-states}") final String topicServerStates, final JvmControlService jvmControlService, final HistoryFacadeService historyFacadeService, final FileUtility fileUtility) { final JvmPersistenceService jvmPersistenceService = aemPersistenceServiceConfiguration.getJvmPersistenceService(); return new JvmServiceImpl(jvmPersistenceService, groupPersistenceService, applicationService, messagingTemplate, groupStateNotificationService, resourceService, clientFactoryHelper, topicServerStates, jvmControlService, binaryDistributionService, binaryDistributionLockManager, historyFacadeService, fileUtility); }
@Bean public Categories getCategories( @Value("${categories.implementation:#{null}}") Class<? extends Categories> impl ) { return null == impl ? beanFactory.createBean(DefaultCategories.class) : beanFactory.createBean(impl); }
/** * Instantiates a new Tgc cipher executor. * * @param secretKeyEncryption the secret key encryption * @param secretKeySigning the secret key signing */ @Autowired public TGCCipherExecutor(@Value("${tgc.encryption.key:}") final String secretKeyEncryption, @Value("${tgc.signing.key:}") final String secretKeySigning) { super(secretKeyEncryption, secretKeySigning); }
/** * Instantiates a new Web security config. * * @param secureCookie the secure cookie * @param userDetailsService the user details service * @param dataSource the data source * @param serverConfigSettings the server config settings */ @Autowired public WebSecurityConfig(@Value("${security.secure_cookie}") final Boolean secureCookie, final DetailsService userDetailsService, final DataSource dataSource, ServerConfigSettings serverConfigSettings, final EndpointPermissionsManifest endpointPermissionsManifest) { this.secureCookie = secureCookie; this.userDetailsService = userDetailsService; this.dataSource = dataSource; this.serverConfigSettings = serverConfigSettings; this.endpointPermissions = endpointPermissionsManifest; }
@Profile({ Modules.REPLICATION }) @Bean Supplier<CloseableMetaStoreClient> replicaMetaStoreClientSupplier( ReplicaCatalog replicaCatalog, @Value("#{replicaHiveConf}") HiveConf replicaHiveConf, MetaStoreClientFactoryManager metaStoreClientFactoryManager) { MetaStoreClientFactory replicaMetaStoreClientFactory = metaStoreClientFactoryManager .factoryForUrl(replicaCatalog.getHiveMetastoreUris()); return metaStoreClientSupplier(replicaCatalog.getName(), replicaHiveConf, replicaCatalog.getMetastoreTunnel(), replicaMetaStoreClientFactory); }
/** * Instantiates a new Service ticket id generator. * * @param maxLength the max length * @param suffix the suffix */ @Autowired public ServiceTicketIdGenerator(@Value("${st.ticket.maxlength:20}") final int maxLength, @Value("${host.name:cas01.example.org}") final String suffix) { super(maxLength, suffix); }
@Value("${hub.fortify.batch.job.status.file.path}") public void setBatchJobStatusFilePath(String batchJobStatusFilePath) { this.batchJobStatusFilePath = batchJobStatusFilePath; }
@Value("${application.database.type}") public void setType(String type) { this.type = type; }
@Inject public void setDebug(@Value("${security.kerberos.debug}") Boolean debug) { this.debug = debug; }
@Value("${" + MODULE_NAME + ".dbmigrate.enabled}") public void setEnabled(boolean enabled) { this.enabled = enabled; }
@Override @Autowired public void setDefaultEncoding(@Value("${message.bundle.encoding:UTF-8}") final String defaultEncoding) { super.setDefaultEncoding(defaultEncoding); }
/** * Sets salt field name. Default is {@link #DEFAULT_SALT_FIELD}. * * @param saltFieldName the password field name */ @Autowired public final void setSaltFieldName(@Value("${cas.jdbc.authn.query.encode.salt:" + DEFAULT_SALT_FIELD + '}') final String saltFieldName) { this.saltFieldName = saltFieldName; }
@Inject public void setPathTasks(@Value("${mail.app.path.tasks}") String pathTasks) { this.pathTasks = pathTasks; }