Configure twitter client.

@param properties the properties
515836
protected void configureTwitterClient(final Collection<BaseClient> properties) {
        val twitter = pac4jProperties.getTwitter();
        if (StringUtils.isNotBlank(twitter.getId()) && StringUtils.isNotBlank(twitter.getSecret())) {
            val client = new TwitterClient(twitter.getId(), twitter.getSecret(), twitter.isIncludeEmail());
            configureClient(client, twitter);

            LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
            properties.add(client);
        }
    }
1071802
public Configuration withProperties(java.util.Map<String, String> properties) {
        setProperties(properties);
        return this;
    }
940636
public void setConfiguration( Dictionary<?,?> properties ) {

		// Ignore iPojo properties
		final List<String> propertiesToSkip = Arrays.asList(
				"component",
				"felix.fileinstall.filename" );

		// Convert the dictionary into a map
		Map<String,String> map = new LinkedHashMap<> ();
		for( Enumeration<?> en = properties.keys(); en.hasMoreElements(); ) {

			Object key = en.nextElement();
			String keyAsString = String.valueOf( key );
			if( propertiesToSkip.contains( keyAsString ))
				continue;

			// "null" are not acceptable values in dictionaries
			// (OSGi often use Hash tables)
			Object value = properties.get( key );
			map.put( keyAsString, String.valueOf( value ));
		}

		// Invoked by iPojo => the messaging type is the right one in this method
		map.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, FACTORY_RABBITMQ );
		setConfiguration( map );
	}
542656
public void setProperties(Properties properties) {
		script = properties.getProperty("script", script);
		pageIntervalInMinutes = Integer.parseInt(properties.getProperty("page_interval_in_minutes",
				"" + pageIntervalInMinutes));
		pageOffsetInMinutes = Integer.parseInt(properties.getProperty("page_offset_in_minutes",
				"" + pageOffsetInMinutes));
	}
804931
public KafkaClient setProducerProperties(Properties props) {
        if (props == null) {
            producerProperties = null;
        } else {
            producerProperties = new Properties();
            producerProperties.putAll(props);
        }
        return this;
    }
1035200
public void createConfiguration(final Properties properties) {

        setHbcfg(HBaseConfiguration.create());

        getHbcfg().set(HBASE_ZOOKEEPER_QUORUM,
                properties.getProperty(HBASE_ZOOKEEPER_QUORUM, "hlt-services4"));

        getHbcfg().set(HBASE_ZOOKEEPER_CLIENT_PORT,
                properties.getProperty(HBASE_ZOOKEEPER_CLIENT_PORT, "2181"));

        getHbcfg().set(HADOOP_FS_DEFAULT_NAME,
                properties.getProperty(HADOOP_FS_DEFAULT_NAME, "hdfs://hlt-services4:9000"));

        // getHbcfg().set("hbase.client.retries.number", "1");
    }
680131
public void setProperties( Map<String,String> properties ) {
        Map<String,String> userProperties = systemSession.getUserProperties();
        if ( userProperties == null ) {
            userProperties = new HashMap<String,String>();
        }
        userProperties.putAll( properties );
        
        log.debug( "Session userProperties: {}", userProperties );
        
        systemSession = (MavenRepositorySystemSession)systemSession.setUserProperties( userProperties );
        
    }
978148
public CapsuleLauncher setProperties(Properties properties) {
        this.properties = properties != null ? properties : new Properties(System.getProperties());
        set(null, getCapsuleField("PROPERTIES"), this.properties);
        return this;
    }
108994
public void configure(Properties props) {
        this.refreshCount.set(0);
        this.overrideProps.clear();
        
        this.originalAsyncAppenderNameMap.clear();
       // First try to load the log4j configuration file from the classpath
        String log4jConfigurationFile = System.getProperty(PROP_LOG4J_CONFIGURATION);
        
        NFHierarchy nfHierarchy = null;
        
        // Make log4j use blitz4j implementations
        if ((!NFHierarchy.class.equals(LogManager.getLoggerRepository().getClass()))) {
            nfHierarchy = new NFHierarchy(new NFRootLogger(org.apache.log4j.Level.INFO));
            org.apache.log4j.LogManager.setRepositorySelector(new NFRepositorySelector(nfHierarchy), guard);
        }
        
        String log4jLoggerFactory = System.getProperty(PROP_LOG4J_LOGGER_FACTORY);
        if (log4jLoggerFactory != null) {
            this.initialProps.setProperty(PROP_LOG4J_LOGGER_FACTORY, log4jLoggerFactory);
            if (nfHierarchy != null) {
                try {
                    LoggerFactory loggerFactory = (LoggerFactory) Class.forName(log4jLoggerFactory).newInstance();
                    nfHierarchy.setLoggerFactory(loggerFactory);
                } catch (Exception e) {
                    System.err.println("Cannot set the logger factory. Hence reverting to default.");
                    e.printStackTrace();
                }
            }
        } else {
            this.initialProps.setProperty(PROP_LOG4J_LOGGER_FACTORY, BLITZ_LOGGER_FACTORY);

        }
        if (log4jConfigurationFile != null) {
            loadLog4jConfigurationFile(log4jConfigurationFile);
            // First configure without async so that we can capture the output
            // of dependent libraries
            clearAsyncAppenderList();
            PropertyConfigurator.configure(this.initialProps);
        }

        this.blitz4jConfig = new DefaultBlitz4jConfig(props);

        if ((log4jConfigurationFile == null) && (blitz4jConfig.shouldLoadLog4jPropertiesFromClassPath())) {
            try {
                URL url = Loader.getResource(LOG4J_PROPERTIES);
                if (url != null) {
                    try (InputStream in = url.openStream()) {
                        this.initialProps.load(in);
                    }
                }
            } catch (Exception t) {
                System.err.println("Error loading properties from " + LOG4J_PROPERTIES);
            } 
        }   
        
        Enumeration enumeration = props.propertyNames();
        while (enumeration.hasMoreElements()) {
            String key = (String) enumeration.nextElement();
            String propertyValue = props.getProperty(key);
            this.initialProps.setProperty(key, propertyValue);
        }
        
        this.blitz4jConfig = new DefaultBlitz4jConfig(this.initialProps);
    
        String[] asyncAppenderArray = blitz4jConfig.getAsyncAppenders();
        if (asyncAppenderArray == null) {
            return;
        }
        for (int i = 0; i < asyncAppenderArray.length; i++) {
            String oneAppenderName = asyncAppenderArray[i];
            if ((i == 0) || (oneAppenderName == null)) {
                continue;
            }
            oneAppenderName = oneAppenderName.trim();
            String oneAsyncAppenderName = oneAppenderName + ASYNC_APPENDERNAME_SUFFIX;
            originalAsyncAppenderNameMap.put(oneAppenderName, oneAsyncAppenderName);
        }
        try {
            convertConfiguredAppendersToAsync(this.initialProps);
        } catch (Exception e) {
            throw new RuntimeException("Could not configure async appenders ",
                    e);
        }
        // Yes second time init required as properties would have been during async appender conversion
        this.blitz4jConfig = new DefaultBlitz4jConfig(this.initialProps);
        clearAsyncAppenderList();
        PropertyConfigurator.configure(this.initialProps);
        closeNonexistingAsyncAppenders();
        this.logger = org.slf4j.LoggerFactory.getLogger(LoggingConfiguration.class);
        ConfigurationManager.getConfigInstance().addConfigurationListener(
                new ExpandedConfigurationListenerAdapter(this));
    }
805278
public void setMapperProperties(Properties properties) {
        if (this.mapperHelper == null) {
            this.mapperHelper = new MapperHelper();
        }
        this.mapperHelper.setProperties(properties);
    }
1181141
@SuppressWarnings("unchecked")
    public void raConfigure(ConfigProperties properties) {
        String httpClientFactoryClassName = (String) properties.getProperty(CFG_PROPERTY_HTTP_CLIENT_FACTORY)
                .getValue();
        if (!httpClientFactoryClassName.isEmpty()) {
            try {
                httpClientFactory = ((Class<? extends HttpAsyncClientFactory>) Class
                        .forName(httpClientFactoryClassName)).newInstance();
            } catch (Exception e) {
                tracer.severe("failed to load http client factory class", e);
            }
        } else {
            this.maxTotal = (Integer) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL).getValue();
            this.defaultMaxPerRoute = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_MAX_CONNECTIONS_PER_ROUTE)
                    .getValue();
            this.connectTimeout = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_CONNECT_TIMEOUT).getValue();
            this.socketTimeout = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_SOCKET_TIMEOUT).getValue();
        }
    }
692071
public static function setProperties($properties = null)
    {
        if ($properties === null) {
            $properties = self::getProperties();
        }

        self::$properties = $properties;
    }
623623
public void setProperties(final Properties properties) {
    this.properties = (null == properties) ? new Properties() : (Properties)properties.clone();
  }
860305
@Override
    public void populateClientProperties(Client client, Map<String, Object> properties)
    {
        new MongoDBClientProperties().populateClientProperties(client, properties);
    }
147294
public void setConfigurationProperties(java.util.Collection<SdkConfigurationProperty> configurationProperties) {
        if (configurationProperties == null) {
            this.configurationProperties = null;
            return;
        }

        this.configurationProperties = new java.util.ArrayList<SdkConfigurationProperty>(configurationProperties);
    }
934999
private void setProperties(Properties properties) {
        Props props = new Props(properties);
        if(props.containsKey(BOOTSTRAP_URLS_PROPERTY)) {
            setBootstrapURLs(props.getList(BOOTSTRAP_URLS_PROPERTY));
        }

        if(props.containsKey(FAT_CLIENTS_CONFIG_SOURCE)) {
            setFatClientConfigSource(StoreClientConfigSource.get(props.getString(FAT_CLIENTS_CONFIG_SOURCE)));
        }

        if(props.containsKey(FAT_CLIENTS_CONFIG_FILE_PATH_PROPERTY)) {
            setFatClientConfigPath(props.getString(FAT_CLIENTS_CONFIG_FILE_PATH_PROPERTY));
        }

        if(props.containsKey(METADATA_CHECK_INTERVAL_IN_MS)) {
            setMetadataCheckIntervalInMs(props.getInt(METADATA_CHECK_INTERVAL_IN_MS));
        }

        if(props.containsKey(NETTY_SERVER_PORT)) {
            setServerPort(props.getInt(NETTY_SERVER_PORT));
        }

        if(props.containsKey(NETTY_SERVER_BACKLOG)) {
            setNettyServerBacklog(props.getInt(NETTY_SERVER_BACKLOG));
        }

        if(props.containsKey(COORDINATOR_CORE_THREADS)) {
            setCoordinatorCoreThreads(props.getInt(COORDINATOR_CORE_THREADS));
        }

        if(props.containsKey(COORDINATOR_MAX_THREADS)) {
            setCoordinatorMaxThreads(props.getInt(COORDINATOR_MAX_THREADS));
        }

        if(props.containsKey(COORDINATOR_QUEUED_REQUESTS)) {
            setCoordinatorQueuedRequestsSize(props.getInt(COORDINATOR_QUEUED_REQUESTS));
        }

        if(props.containsKey(HTTP_MESSAGE_DECODER_MAX_INITIAL_LINE_LENGTH)) {
            setHttpMessageDecoderMaxInitialLength(props.getInt(HTTP_MESSAGE_DECODER_MAX_INITIAL_LINE_LENGTH));
        }

        if(props.containsKey(HTTP_MESSAGE_DECODER_MAX_HEADER_SIZE)) {
            setHttpMessageDecoderMaxHeaderSize(props.getInt(HTTP_MESSAGE_DECODER_MAX_HEADER_SIZE));
        }

        if(props.containsKey(HTTP_MESSAGE_DECODER_MAX_CHUNK_SIZE)) {
            setHttpMessageDecoderMaxChunkSize(props.getInt(HTTP_MESSAGE_DECODER_MAX_CHUNK_SIZE));
        }

        if(props.containsKey(ADMIN_ENABLE)) {
            setAdminServiceEnabled(props.getBoolean(ADMIN_ENABLE));
        }

        if(props.containsKey(ADMIN_PORT)) {
            setAdminPort(props.getInt(ADMIN_PORT));
        }

    }
137609
public KafkaClient setConsumerProperties(Properties props) {
        if (props == null) {
            consumerProperties = null;
        } else {
            consumerProperties = new Properties();
            consumerProperties.putAll(props);
        }
        return this;
    }