Creates a server setup based on provided properties.

@param properties the properties.
@return the server setup, or an empty array.
544073
public ServerSetup[] build(Properties properties) {
        List<ServerSetup> serverSetups = new ArrayList<>();

        String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress());
        long serverStartupTimeout =
                Long.parseLong(properties.getProperty("greenmail.startup.timeout", "-1"));

        // Default setups
        addDefaultSetups(hostname, properties, serverSetups);

        // Default setups for test
        addTestSetups(hostname, properties, serverSetups);

        // Default setups
        for (String protocol : ServerSetup.PROTOCOLS) {
            addSetup(hostname, protocol, properties, serverSetups);
        }

        for (ServerSetup setup : serverSetups) {
            if (properties.containsKey(GREENMAIL_VERBOSE)) {
                setup.setVerbose(true);
            }
            if (serverStartupTimeout >= 0L) {
                setup.setServerStartupTimeout(serverStartupTimeout);
            }
        }

        return serverSetups.toArray(new ServerSetup[serverSetups.size()]);
    }
255248
private void setProperties(Properties properties) {
        Props props = new Props(properties);
        if(props.containsKey(ClientConfig.ENABLE_JMX_PROPERTY)) {
            this.setEnableJmx(props.getBoolean(ClientConfig.ENABLE_JMX_PROPERTY));
        }

        if(props.containsKey(ClientConfig.BOOTSTRAP_URLS_PROPERTY)) {
            List<String> urls = props.getList(ClientConfig.BOOTSTRAP_URLS_PROPERTY);
            if(urls.size() > 0) {
                setHttpBootstrapURL(urls.get(0));
            }
        }

        if(props.containsKey(ClientConfig.MAX_TOTAL_CONNECTIONS_PROPERTY)) {
            setMaxR2ConnectionPoolSize(props.getInt(ClientConfig.MAX_TOTAL_CONNECTIONS_PROPERTY,
                                                    maxR2ConnectionPoolSize));
        }

        if(props.containsKey(ClientConfig.ROUTING_TIMEOUT_MS_PROPERTY))
            this.setTimeoutMs(props.getLong(ClientConfig.ROUTING_TIMEOUT_MS_PROPERTY, timeoutMs),
                              TimeUnit.MILLISECONDS);

        // By default, make all the timeouts equal to routing timeout
        timeoutConfig = new TimeoutConfig(timeoutMs, false);

        if(props.containsKey(ClientConfig.GETALL_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_ALL_OP_CODE,
                                              props.getInt(ClientConfig.GETALL_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.GET_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_OP_CODE,
                                              props.getInt(ClientConfig.GET_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.PUT_ROUTING_TIMEOUT_MS_PROPERTY)) {
            long putTimeoutMs = props.getInt(ClientConfig.PUT_ROUTING_TIMEOUT_MS_PROPERTY);
            timeoutConfig.setOperationTimeout(VoldemortOpCode.PUT_OP_CODE, putTimeoutMs);
            // By default, use the same thing for getVersions() also
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_VERSION_OP_CODE, putTimeoutMs);
        }

        // of course, if someone overrides it, we will respect that
        if(props.containsKey(ClientConfig.GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_VERSION_OP_CODE,
                                              props.getInt(ClientConfig.GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.DELETE_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.DELETE_OP_CODE,
                                              props.getInt(ClientConfig.DELETE_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.ALLOW_PARTIAL_GETALLS_PROPERTY))
            timeoutConfig.setPartialGetAllAllowed(props.getBoolean(ClientConfig.ALLOW_PARTIAL_GETALLS_PROPERTY));

    }
34666
public final void server() {

    // load parameters into a properties
    String port = parsedArguments.getString("port");
    String model = parsedArguments.getString("model");
    String headFinder = parsedArguments.getString("headFinder");
    String outputFormat = parsedArguments.getString("outputFormat");
    // language parameter
    String lang = parsedArguments.getString("language");
    Properties serverproperties = setServerProperties(port, model, lang, headFinder, outputFormat);
    new ConstituentParserServer(serverproperties);
  }
1228520
public ConnectionPoolConfigurationBuilder withPoolProperties(Properties properties) {
      TypedProperties typed = TypedProperties.toTypedProperties(properties);
      exhaustedAction(typed.getEnumProperty(ConfigurationProperties.CONNECTION_POOL_EXHAUSTED_ACTION, ExhaustedAction.class,
         ExhaustedAction.values()[typed.getIntProperty("whenExhaustedAction", exhaustedAction.ordinal(), true)],
            true));
      maxActive(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MAX_ACTIVE,
                  typed.getIntProperty("maxActive", maxActive, true),
                  true));
      maxWait(typed.getLongProperty(ConfigurationProperties.CONNECTION_POOL_MAX_WAIT,
            typed.getLongProperty("maxWait", maxWait, true),
            true));
      minIdle(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MIN_IDLE,
            typed.getIntProperty("minIdle", minIdle, true),
            true));
      minEvictableIdleTime(typed.getLongProperty(ConfigurationProperties.CONNECTION_POOL_MIN_EVICTABLE_IDLE_TIME,
            typed.getLongProperty("minEvictableIdleTimeMillis", minEvictableIdleTime, true),
            true));
      maxPendingRequests(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MAX_PENDING_REQUESTS,
            typed.getIntProperty("maxPendingRequests", maxPendingRequests, true),
            true));

      lifo(typed.getBooleanProperty("lifo", lifo, true));
      maxTotal(typed.getIntProperty("maxTotal", maxTotal, true));
      maxIdle(typed.getIntProperty("maxIdle", maxIdle, true));
      numTestsPerEvictionRun(typed.getIntProperty("numTestsPerEvictionRun", numTestsPerEvictionRun, true));
      timeBetweenEvictionRuns(typed.getLongProperty("timeBetweenEvictionRunsMillis", timeBetweenEvictionRuns, true));
      testOnBorrow(typed.getBooleanProperty("testOnBorrow", testOnBorrow, true));
      testOnReturn(typed.getBooleanProperty("testOnReturn", testOnReturn, true));
      testWhileIdle(typed.getBooleanProperty("testWhileIdle", testWhileIdle, true));

      return this;
   }
1320
public Properties asProperties() {
        final Properties props = new Properties();
        other.forEach(props::setProperty);
        props.setProperty("bootstrap.servers", bootstrapServers);
        return props;
    }
978148
public CapsuleLauncher setProperties(Properties properties) {
        this.properties = properties != null ? properties : new Properties(System.getProperties());
        set(null, getCapsuleField("PROPERTIES"), this.properties);
        return this;
    }
753100
public Deployment setServerGroups(final Collection<String> serverGroups) {
        this.serverGroups.clear();
        this.serverGroups.addAll(serverGroups);
        return this;
    }
746168
protected void configureFoursquareClient(final Collection<BaseClient> properties) {
        val foursquare = pac4jProperties.getFoursquare();
        if (StringUtils.isNotBlank(foursquare.getId()) && StringUtils.isNotBlank(foursquare.getSecret())) {
            val client = new FoursquareClient(foursquare.getId(), foursquare.getSecret());
            configureClient(client, foursquare);

            LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
            properties.add(client);
        }
    }
1072837
public ServerSetup createCopy(String bindAddress) {
        ServerSetup setup = new ServerSetup(getPort(), bindAddress, getProtocol());
        setup.setServerStartupTimeout(getServerStartupTimeout());
        setup.setConnectionTimeout(getConnectionTimeout());
        setup.setReadTimeout(getReadTimeout());
        setup.setWriteTimeout(getWriteTimeout());
        setup.setVerbose(isVerbose());

        return setup;
    }
816661
public function setup(array $properties) {
        if (is_array(reset($properties))) {
            $modelList = array();
            foreach ($properties as $p) {
                $o = clone $this;
                $o->setupOne($p);
                $modelList[] = $o;
            }
            return $modelList;
        }

        return $this->setupOne($properties);
    }
842576
private void setupRequestProperties(HttpURLConnection connection, Map<String, Object> properties) {
		Set<Entry<String, Object>> entries = properties.entrySet();
		for (Entry<String, Object> e : entries) {
			String name = e.getKey();
			Object value = e.getValue();

			if (name != null && value != null) {
				connection.setRequestProperty(name, value.toString());
			}
		}
	}
321405
static public Map<String,Object> propertiesToMap(Properties properties)
    {
        Map<String,Object> map = null;
        if (properties != null)
        {
	        map = new Hashtable<String,Object>();
	        for (Object key : properties.keySet())
	        {
                map.put((String)key, properties.get(key));	            
	        }
        }
        return map;
    }
961443
public static Session getSession(final ServerSetup setup, Properties mailProps) {
        Properties props = setup.configureJavaMailSessionProperties(mailProps, false);

        log.debug("Mail session properties are {}", props);

        return Session.getInstance(props, null);
    }
923963
public void setProperties(Collection<String> properties) {
        if (null == this.properties) {
            this.properties = new ArrayList<>();
        }
        this.properties.clear();
        this.properties.addAll(properties);
    }
50061
public VarValueDef addProperties( Collection<String> properties)
    {
    if( properties != null)
      {
      assertPropertyIdentifiers( properties);
      properties_.addAll( properties);
      }

    return this;
    }
644103
public ApiResponse createEntity(Map<String, Object> properties) {
        assertValidApplicationId();
        if (isEmpty(properties.get("type"))) {
            throw new IllegalArgumentException("Missing entity type");
        }
        ApiResponse response = apiRequest(HttpMethod.POST, null, properties,
                organizationId, applicationId, properties.get("type").toString());
        return response;
    }
1298601
public static PrefixedProperties createCascadingPrefixProperties(final String[] prefixes) {
		PrefixedProperties properties = null;
		for (final String aPrefix : prefixes) {
			if (properties == null) {
				properties = new PrefixedProperties(aPrefix);
			} else {
				properties = new PrefixedProperties(properties, aPrefix);
			}
		}
		return properties;
	}