Creates and configures a new StandardUserAgentClient instance.

@param settings the configuration settings
@return a new configured StandardUserAgentClient
@see Factory#newUserAgentClient(Settings)
338231
public static StandardUserAgentClient newInstance(Settings settings)
    {
        UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY);
        TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY);
        return new StandardUserAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings);
    }
305106
@Transactional
	public OAuthSessionContextEntity create(final UserEntity user, final OAuthServiceEntity service, final String scope)
	{
		// Create a new context
		OAuthSessionContextEntity entity = get(user.getId(), service.getId(), scope);

		// No active context exists, we must create one
		if (entity == null)
		{
			entity = new OAuthSessionContextEntity();

			entity.setUser(user);
			entity.setScope(StringUtils.trimToEmpty(scope));
			entity.setService(service);
			entity.setActive(true);

			entity.setId(save(entity));
		}

		return entity;
	}
519528
public Client build(final ZipkinClientConfiguration configuration) {
    final Client client =
        new JerseyClientBuilder(environment)
            .using(configuration)
            .build(configuration.getServiceName());
    return build(client);
  }
1161442
@Override
    public Map<String, String> createDefaultOptions() {
        HashMap<String, String> ret = new HashMap<String, String>();
        // Add any default options needed here (like path to default properties)

        ret.put("client", "client.properties");

        return ret;
    }
714820
public static Client http(ClientSettings clientSettings) {
    HttpClientCodec clientCodec =
        new HttpClientCodec(DataCodec.getInstance(clientSettings.contentType()));

    ClientTransport clientTransport =
        new HttpClientTransport(clientSettings, clientCodec, clientSettings.loopResources());

    return new Client(clientTransport, clientCodec, clientSettings.errorMapper());
  }
81635
public Client newClient(String clientName, Collection<JaxRsFeatureGroup> featureGroups) {
        return newBuilder(clientName, featureGroups).build();
    }
205418
public static ClientConfigurationBuilder builder(final String url, final String username, final String password) {
        return new ClientConfigurationBuilder(url, username, password);
    }
1141153
function DiscogsClient(userAgent, auth) {
    // Allow the class to be called as a function, returning an instance
    if (!(this instanceof DiscogsClient)) {
        return new DiscogsClient(userAgent, auth);
    }
    // Set the default configuration
    this.config = util.merge({}, defaultConfig);
    // Set the custom User Agent when provided
    if (typeof userAgent === 'string') {
        this.config.userAgent = userAgent;
    }
    // No userAgent provided, but instead we have an accessObject
    if ((arguments.length === 1) && (typeof userAgent === 'object')) {
        auth = userAgent;
    }
    // Set auth data when provided
    if (auth && (typeof auth === 'object')) {
        queue.setConfig({maxCalls: this.config.requestLimitAuth});
        if (!auth.hasOwnProperty('method')) {
            auth.method = 'discogs';
        }
        if (!auth.hasOwnProperty('level')) {
            if (auth.userToken) {
                auth.level = 2;
            } else if (auth.consumerKey && auth.consumerSecret) {
                auth.level = 1;
            }
        }
        this.auth = util.merge({}, auth);
    // Unauthenticated new client instances will decrease the shared request limit
    } else {
        queue.setConfig({maxCalls: this.config.requestLimit});
    }
}
957184
private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
        HttpHost proxy = new HttpHost(settings.getProxyUrl().getHost(), settings.getProxyUrl().getPort());
        if (settings.getProxyUser() != null) {
            CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            String proxyUser = settings.getProxyUser();
            String proxyPassword = settings.getProxyPassword();
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(proxyUser, proxyPassword);
            credentialsProvider.setCredentials(new AuthScope(proxy), credentials);
            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
        }
        return new DefaultProxyRoutePlanner(proxy);
    }
1103038
public void setUserAgent(String agent, String agentVersion) {
    userAgent = String.format("Algolia for Java (%s); JVM (%s); %s (%s)", version, System.getProperty("java.version"), agent, agentVersion);
  }
32654
@Override
    public void createAgent(String agent_name, String path) {
        logger.fine("Creating agent " + agent_name + " in Main Container");
        Object reference = new Object();
        Object empty[] = new Object[1];
        empty[0] = reference;
        try {
            AgentController agentController = mainContainer.createNewAgent(
                    agent_name, path, empty);
            this.createdAgents.put(agent_name, agentController);
            agentController.start();
            logger.fine("Agent " + agent_name
                    + " created and started in Main Container");
            try {
                Thread.sleep(MILLIS_TO_WAIT_FOR_AGENT_STARTING);
            } catch (InterruptedException e) {
                logger.warning("It was not possible to wait for agent starting... Maybe, the agent is not completely started yet.");
            }
        } catch (StaleProxyException e) {
            logger.warning("Exception creating or starting agent in MainContainer... "
                    + e);
        }
        // Register the agent
    }
1265013
public static ClientConfiguration createClient(final DataProvider provider) {
        return createClient(null, null, emptyList(), singletonList(provider));
    }
171153
public Agent newAgent(Agent a) {
	Agent res = newAgent(a.getId());
	res.getType().addAll(a.getType());
	res.getLabel().addAll(a.getLabel());
	return res;
    }
343154
public static function create(ApiClientInterface $client, UserInterface $user = null)
    {
        $accessToken = new self();
        $accessToken->setUser($user);
        $accessToken->setClient($client);

        return $accessToken;
    }
1066405
public static JedisPool create(final PippoSettings settings) {
        String host = settings.getString(HOST, Protocol.DEFAULT_HOST).trim();
        int minIdle = settings.getInteger(MIN_IDLE, GenericObjectPoolConfig.DEFAULT_MIN_IDLE);
        int maxIdle = settings.getInteger(MAX_IDLE, GenericObjectPoolConfig.DEFAULT_MAX_IDLE);
        int maxTotal = settings.getInteger(MAX_TOTAL, GenericObjectPoolConfig.DEFAULT_MAX_TOTAL);
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMinIdle(minIdle);
        config.setMaxIdle(maxIdle);
        config.setMaxTotal(maxTotal);

        try {
            return new JedisPool(config, new URI(host));
        } catch (URISyntaxException e) {
            throw new PippoRuntimeException("Malformed redis URI", e);
        }
    }
1138765
private SailthruHttpClient create() {
        HttpParams params = new BasicHttpParams();
        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
        HttpProtocolParams.setContentCharset(params, DEFAULT_ENCODING);
        HttpProtocolParams.setUserAgent(params, DEFAULT_USER_AGENT);
        HttpProtocolParams.setUseExpectContinue(params, true);

        HttpConnectionParams.setConnectionTimeout(params, sailthruHttpClientConfiguration.getConnectionTimeout());
        HttpConnectionParams.setSoTimeout(params, sailthruHttpClientConfiguration.getSoTimeout());
        HttpConnectionParams.setSoReuseaddr(params, sailthruHttpClientConfiguration.getSoReuseaddr());
        HttpConnectionParams.setTcpNoDelay(params, sailthruHttpClientConfiguration.getTcpNoDelay());

        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(getScheme());

        ThreadSafeClientConnManager connManager = new ThreadSafeClientConnManager(schemeRegistry);
        return new SailthruHttpClient(connManager, params);
    }
266182
public synchronized void setUserAgent(String applicationName,
            String applicationVersion, String programmingLanguage,
            String... additionalNameValuePairs) {
        checkUpdatable();
        StringBuilder b = new StringBuilder();
        b.append(applicationName);
        b.append("/");
        b.append(applicationVersion);
        b.append(" (Language=");
        b.append(programmingLanguage);
        int i = 0;
        while (i < additionalNameValuePairs.length) {
            String name = additionalNameValuePairs[i];
            String value = additionalNameValuePairs[i + 1];
            b.append("; ");
            b.append(name);
            b.append("=");
            b.append(value);
            i += 2;
        }
        b.append(")");
        this.userAgent = b.toString();
    }