com.fasterxml.jackson.annotation.JsonAlias#io.dropwizard.client.JerseyClientConfiguration源码实例Demo

下面列出了com.fasterxml.jackson.annotation.JsonAlias#io.dropwizard.client.JerseyClientConfiguration 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@JsonCreator
public HubMetadataConfiguration(
        @JsonProperty("uri") @JsonAlias({"url"}) URI uri,
        @JsonProperty("minRefreshDelay") Long minRefreshDelay,
        @JsonProperty("maxRefreshDelay") Long maxRefreshDelay,
        @JsonProperty("expectedEntityId") String expectedEntityId,
        @JsonProperty("client") JerseyClientConfiguration client,
        @JsonProperty("jerseyClientName") String jerseyClientName,
        @JsonProperty("hubFederationId") String hubFederationId,
        @JsonProperty("trustStore") TrustStoreConfiguration trustStoreConfiguration,
        @JsonProperty("hubTrustStore") TrustStoreConfiguration hubTrustStoreConfiguration,
        @JsonProperty("idpTrustStore") TrustStoreConfiguration idpTrustStoreConfiguration) {
    super(uri, minRefreshDelay, maxRefreshDelay, expectedEntityId, client,
            ofNullable(jerseyClientName).orElse(HUB_JERSEY_CLIENT_NAME), hubFederationId);
    this.trustStoreConfiguration = trustStoreConfiguration;
    this.hubTrustStoreConfiguration = hubTrustStoreConfiguration;
    this.idpTrustStoreConfiguration = idpTrustStoreConfiguration;
}
 
@JsonCreator
public EuropeanIdentityConfiguration(@JsonProperty("hubConnectorEntityId") String hubConnectorEntityId,
                                     @JsonProperty("acceptableHubConnectorEntityIds") List<String> acceptableHubConnectorEntityIds,
                                     @NotNull @Valid @JsonProperty("enabled") boolean enabled,
                                     @JsonProperty("trustAnchorUri") URI trustAnchorUri,
                                     @JsonProperty("minRefreshDelay") Long minRefreshDelay,
                                     @JsonProperty("maxRefreshDelay") Long maxRefreshDelay,
                                     @JsonProperty("trustAnchorMaxRefreshDelay") Long trustAnchorMaxRefreshDelay,
                                     @JsonProperty("trustAnchorMinRefreshDelay") Long trustAnchorMinRefreshDelay,
                                     @JsonProperty("client") JerseyClientConfiguration client,
                                     @JsonProperty("jerseyClientName") String jerseyClientName,
                                     @JsonProperty("trustStore") TrustStoreConfiguration trustStore,
                                     @JsonProperty("metadataSourceUri") URI metadataSourceUri
){
    super(trustAnchorUri, minRefreshDelay, maxRefreshDelay, trustAnchorMaxRefreshDelay, trustAnchorMinRefreshDelay, client, jerseyClientName, trustStore, metadataSourceUri);
    this.enabled = enabled;
    this.trustStoreConfiguration = trustStore;
    this.hubConnectorEntityId = hubConnectorEntityId;
    this.acceptableHubConnectorEntityIds = acceptableHubConnectorEntityIds;
}
 
源代码3 项目: soabase   文件: MockApplication.java
@Override
public void run(TestConfiguration configuration, Environment environment) throws Exception
{
    AbstractBinder binder = new AbstractBinder()
    {
        @Override
        protected void configure()
        {
            bind(throwInternalError).to(AtomicBoolean.class);
            bind(counter).to(AtomicInteger.class);
        }
    };
    environment.jersey().register(binder);
    environment.jersey().register(MockResource.class);

    JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
    clientConfiguration.setMaxConnectionsPerRoute(Integer.MAX_VALUE);
    clientConfiguration.setMaxConnections(Integer.MAX_VALUE);
    client = new ClientBuilder(environment).buildJerseyClient(clientConfiguration, "test");

    startedLatch.countDown();
}
 
public ComplianceToolClient createComplianceToolService(Environment environment, String url, Integer timeout) {
    JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setConnectionRequestTimeout(Duration.seconds(timeout));
    configuration.setTimeout(Duration.seconds(timeout));
    configuration.setConnectionTimeout(Duration.seconds(timeout));
    Client client = new JerseyClientBuilder(environment).using(configuration).build("Compliance Tool Initiation Client");
    return new ComplianceToolClient(client, url, serviceEntityId, getSigningCertificate(), getEncryptionCertificate());
}
 
@JsonCreator
public MsaMetadataConfiguration(
        @JsonProperty("uri") @JsonAlias({ "url" }) URI uri,
        @JsonProperty("minRefreshDelay") Long minRefreshDelay,
        @JsonProperty("maxRefreshDelay") Long maxRefreshDelay,
        @JsonProperty(value = "expectedEntityId", required = true) String expectedEntityId,
        @JsonProperty("client") JerseyClientConfiguration client,
        @JsonProperty("jerseyClientName") String jerseyClientName,
        @JsonProperty("hubFederationId") String hubFederationId
) {
    super(uri, minRefreshDelay, maxRefreshDelay, expectedEntityId, client, ofNullable(jerseyClientName).orElse(MSA_JERSEY_CLIENT_NAME), hubFederationId);
}
 
@Before
public void setUpBefore() {
    JerseyClientConfiguration configuration = new JerseyClientConfiguration();
    configuration.setTimeout(Duration.seconds(10));
    configuration.setConnectionTimeout(Duration.seconds(10));
    configuration.setConnectionRequestTimeout(Duration.seconds(10));
    client = new JerseyClientBuilder(appRule.getEnvironment()).using(configuration).build(ComplianceToolModeAcceptanceTest.class.getName());
    complianceTool = new ComplianceToolService(client);
}
 
源代码7 项目: emodb   文件: EmoModule.java
@Override
protected void configure() {
    bind(TaskRegistry.class).to(getTaskRegistryClass()).asEagerSingleton();
    bind(ResourceRegistry.class).to(DropwizardResourceRegistry.class).asEagerSingleton();
    bind(String.class).annotatedWith(ServerCluster.class).toInstance(_configuration.getCluster());
    bind(JerseyClientConfiguration.class).toInstance(_configuration.getHttpClientConfiguration());
    install(new SelfHostAndPortModule());
}
 
源代码8 项目: rx-jersey   文件: RxJerseyBundle.java
public RxJerseyBundle() {
    setClientConfigurationProvider(configuration -> {
        int cores = Runtime.getRuntime().availableProcessors();
        JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
        clientConfiguration.setMaxThreads(cores);

        return clientConfiguration;
    });
}
 
源代码9 项目: rx-jersey   文件: RxJerseyBundle.java
@Override
public void run(T configuration, Environment environment) throws Exception {
    JerseyEnvironment jersey = environment.jersey();

    JerseyClientConfiguration clientConfiguration = clientConfigurationProvider.apply(configuration);
    Client client = getClient(environment, clientConfiguration);

    rxJerseyClientFeature.setClient(client);

    jersey.register(rxJerseyServerFeature);
    jersey.register(rxJerseyClientFeature);
}
 
源代码10 项目: soabase   文件: ClientBuilder.java
public Client buildJerseyClient(JerseyClientConfiguration configuration, String clientName)
{
    ConnectorProvider localConnectorProvider;
    if ( connectorProvider != null )
    {
        localConnectorProvider = connectorProvider;
    }
    else
    {
        HttpClientBuilder apacheHttpClientBuilder = new HttpClientBuilder(environment).using(configuration);
        CloseableHttpClient closeableHttpClient = apacheHttpClientBuilder.build(clientName);
        localConnectorProvider = new JerseyRetryConnectorProvider(retryComponents, closeableHttpClient, configuration.isChunkedEncodingEnabled());
    }
    JerseyClientBuilder builder = new JerseyClientBuilder(environment)
        .using(configuration)
        .using(localConnectorProvider);
    for ( Class<?> klass : providerClasses )
    {
        builder = builder.withProvider(klass);
    }
    for ( Object provider : providers )
    {
        builder = builder.withProvider(provider);
    }
    Client client = builder
        .build(clientName);

    SoaBundle.getFeatures(environment).putNamed(client, Client.class, clientName);

    return client;
}
 
源代码11 项目: soabase   文件: HelloApp.java
@Override
protected void internalRun(Configuration configuration, Environment environment)
{
    ClientBuilder builder = new ClientBuilder(environment);
    builder.buildJerseyClient(new JerseyClientConfiguration(), "jersey");
    builder.buildHttpClient(new HttpClientConfiguration(), "apache");

    environment.jersey().register(HelloResourceJersey.class);
    environment.jersey().register(HelloResourceApache.class);
}
 
@JsonCreator
public BreakerboxServiceConfiguration(@JsonProperty("azure") AzureTableConfiguration azure,
                                      @JsonProperty("tenacityClient") JerseyClientConfiguration tenacityClientConfiguration,
                                      @JsonProperty("breakerboxServicesPropertyKeys") TenacityConfiguration breakerboxServicesPropertyKeys,
                                      @JsonProperty("breakerboxServicesConfiguration") TenacityConfiguration breakerboxServicesConfiguration,
                                      @JsonProperty("breakerbox") BreakerboxConfiguration breakerboxConfiguration,
                                      @JsonProperty("ldap") LdapConfiguration ldapConfiguration,
                                      @JsonProperty("archaiusOverride") ArchaiusOverrideConfiguration archaiusOverride,
                                      @JsonProperty("database") JdbiConfiguration jdbiConfiguration,
                                      @JsonProperty("breakerboxHostAndPort") HostAndPort breakerboxHostAndPort,
                                      @JsonProperty("defaultDashboard") String defaultDashboard,
                                      @JsonProperty("turbine") Path turbine,
                                      @JsonProperty("instanceDiscoveryClass") String instanceDiscoveryClass,
                                      @JsonProperty("hystrixStreamSuffix") String hystrixStreamSuffix,
                                      @JsonProperty("rancherDiscovery") RancherInstanceConfiguration rancherInstanceConfiguration,
                                      @JsonProperty("marathonDiscovery")List<MarathonClientConfiguration> marathonClientConfiguration) {
    this.azure = Optional.ofNullable(azure);
    this.tenacityClient = tenacityClientConfiguration;
    this.breakerboxServicesPropertyKeys = Optional.ofNullable(breakerboxServicesPropertyKeys).orElse(new TenacityConfiguration());
    this.breakerboxServicesConfiguration = Optional.ofNullable(breakerboxServicesConfiguration).orElse(new TenacityConfiguration());
    this.breakerboxConfiguration = breakerboxConfiguration;
    this.ldapConfiguration = Optional.ofNullable(ldapConfiguration);
    this.archaiusOverride = Optional.ofNullable(archaiusOverride).orElse(new ArchaiusOverrideConfiguration());
    this.jdbiConfiguration = Optional.ofNullable(jdbiConfiguration);
    this.breakerboxHostAndPort = Optional.ofNullable(breakerboxHostAndPort).orElse(HostAndPort.fromParts("localhost", 8080));
    this.defaultDashboard = Optional.ofNullable(defaultDashboard).orElse("production");
    this.turbine = Optional.ofNullable(turbine).orElse(Paths.get("breakerbox-instances.yml"));
    this.instanceDiscoveryClass = Objects.isNull(instanceDiscoveryClass) ? Optional.ofNullable(System.getProperty("InstanceDiscovery.impl")) : Optional.of(instanceDiscoveryClass);
    this.hystrixStreamSuffix = Optional.ofNullable(hystrixStreamSuffix);
    this.rancherInstanceConfiguration = Optional.ofNullable(rancherInstanceConfiguration);
    this.marathonClientConfiguration = Optional.ofNullable(marathonClientConfiguration);
}
 
源代码13 项目: tenacity   文件: ClientTimeoutTest.java
@Before
public void setup() {
    clientConfiguration = new JerseyClientConfiguration();
    clientConfiguration.setConnectionTimeout(Duration.milliseconds(100));
    tenacityConfiguration = new TenacityConfiguration();
    metricRegistry = new MetricRegistry();
    executorService = Executors.newSingleThreadExecutor();
}
 
源代码14 项目: emodb   文件: EmoConfiguration.java
public JerseyClientConfiguration getHttpClientConfiguration() {
    return _httpClientConfiguration;
}
 
源代码15 项目: emodb   文件: EmoConfiguration.java
public EmoConfiguration setHttpClientConfiguration(JerseyClientConfiguration httpClientConfiguration) {
    _httpClientConfiguration = httpClientConfiguration;
    return this;
}
 
源代码16 项目: emodb   文件: EmoModule.java
/** Configure the HTTP client for out-bound HTTP calls. */
@Provides @Singleton
Client provideJerseyClient(JerseyClientConfiguration configuration, Environment environment) {
    return new JerseyClientBuilder(environment).using(configuration).using(environment).build("emodb");
}
 
源代码17 项目: dcos-commons   文件: KeystoreConfiguration.java
@JsonProperty("jerseyClient")
public void setHttpClientConfiguration(JerseyClientConfiguration jerseyClient) {
    this.jerseyClient = jerseyClient;
}
 
源代码18 项目: dcos-commons   文件: KeystoreConfiguration.java
@JsonProperty("jerseyClient")
public JerseyClientConfiguration getJerseyClientConfiguration() {
    return jerseyClient;
}
 
源代码19 项目: rx-jersey   文件: RxJerseyBundle.java
public RxJerseyBundle<T> setClientConfigurationProvider(Function<T, JerseyClientConfiguration> provider) {
    clientConfigurationProvider = provider;
    return this;
}
 
源代码20 项目: rx-jersey   文件: RxJerseyBundle.java
private Client getClient(Environment environment, JerseyClientConfiguration jerseyClientConfiguration) {
    return new JerseyClientBuilder(environment)
            .using(jerseyClientConfiguration)
            .using(new GrizzlyConnectorProvider())
            .buildRx("rxJerseyClient", RxFlowableInvokerProvider.class);
}
 
@JsonProperty("httpClient")
public JerseyClientConfiguration getJerseyClientConfiguration() {
    return httpClient;
}
 
public JerseyClientConfiguration getTenacityClient() {
    return tenacityClient;
}
 
源代码23 项目: SeaCloudsPlatform   文件: DashboardConfiguration.java
@JsonProperty("jerseyClient")
public JerseyClientConfiguration getJerseyClientConfiguration() {
    return jerseyClient;
}
 
public JerseyClientConfiguration getJerseyClientConfiguration() {
    return jerseyClient;
}
 
源代码25 项目: tenacity   文件: TenacityClientBuilder.java
public TenacityClientBuilder using(JerseyClientConfiguration jerseyConfiguration) {
    this.jerseyConfiguration = jerseyConfiguration;
    return this;
}