Skip to content

Commit

Permalink
Merge pull request #59 from yma96/master
Browse files Browse the repository at this point in the history
Add proxyAllowHttpJobTypes param for SiteConfig
  • Loading branch information
yma96 authored Aug 7, 2024
2 parents 2f0dcc1 + a5b4c9b commit 8c8b384
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
21 changes: 16 additions & 5 deletions src/main/java/org/commonjava/util/jhttpc/model/SiteConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public final class SiteConfig

public static final int DEFAULT_CONNECTION_POOL_TIMEOUT_SECONDS = 60;

public static final String DEFAULT_PROXY_ALLOW_HTTP_JOB_TYPES = "download,existence,listing";

private final String id;

private final String uri;
Expand All @@ -52,6 +54,8 @@ public final class SiteConfig

private final String proxyUser;

private final String proxyAllowHttpJobTypes;

private final SiteTrustType trustType;

private final String keyCertPem;
Expand Down Expand Up @@ -87,18 +91,20 @@ public final class SiteConfig
private final Integer baseSampleRate;

SiteConfig( String id, String uri, String user, String proxyHost, Integer proxyPort, String proxyUser,
SiteTrustType trustType, String keyCertPem, String serverCertPem, Integer requestTimeoutSeconds,
Integer connectionPoolTimeoutSeconds, Integer maxConnections, Integer maxPerRoute,
final ConnectionConfig connectionConfig, final SocketConfig socketConfig,
final RequestConfig requestConfig, HttpClientContext clientContextPrototype, boolean ignoreHostnameVerification, Map<String, Object> attributes,
Boolean metricEnabled, String honeycombDataset, String honeycombWriteKey, Integer baseSampleRate )
String proxyAllowHttpJobTypes, SiteTrustType trustType, String keyCertPem, String serverCertPem,
Integer requestTimeoutSeconds, Integer connectionPoolTimeoutSeconds, Integer maxConnections,
Integer maxPerRoute, final ConnectionConfig connectionConfig, final SocketConfig socketConfig,
final RequestConfig requestConfig, HttpClientContext clientContextPrototype,
boolean ignoreHostnameVerification, Map<String, Object> attributes, Boolean metricEnabled,
String honeycombDataset, String honeycombWriteKey, Integer baseSampleRate )
{
this.id = id;
this.uri = uri;
this.user = user;
this.proxyHost = proxyHost;
this.proxyPort = proxyPort;
this.proxyUser = proxyUser;
this.proxyAllowHttpJobTypes = proxyAllowHttpJobTypes;
this.trustType = trustType;
this.keyCertPem = keyCertPem;
this.serverCertPem = serverCertPem;
Expand Down Expand Up @@ -168,6 +174,11 @@ public String getProxyUser()
return proxyUser;
}

public String getProxyAllowHttpJobTypes()
{
return proxyAllowHttpJobTypes == null ? DEFAULT_PROXY_ALLOW_HTTP_JOB_TYPES : proxyAllowHttpJobTypes;
}

public String getKeyCertPem()
{
return keyCertPem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class SiteConfigBuilder

private String proxyUser;

private String proxyAllowHttpJobTypes;

private SiteTrustType trustType;

private String keyCertPem;
Expand Down Expand Up @@ -99,10 +101,11 @@ public SiteConfigBuilder( String id, String uri )

public SiteConfig build()
{
return new SiteConfig( id, uri, user, proxyHost, proxyPort, proxyUser, trustType, keyCertPem, serverCertPem,
requestTimeoutSeconds, connectionPoolTimeoutSeconds, maxConnections, maxPerRoute,
connectionConfig, socketConfig, requestConfig, clientContextProtoype,
ignoreHostnameVerification, attributes, metricEnabled, honeycombDataset, honeycombWriteKey, baseSampleRate );
return new SiteConfig( id, uri, user, proxyHost, proxyPort, proxyUser, proxyAllowHttpJobTypes, trustType,
keyCertPem, serverCertPem, requestTimeoutSeconds, connectionPoolTimeoutSeconds,
maxConnections, maxPerRoute, connectionConfig, socketConfig, requestConfig,
clientContextProtoype, ignoreHostnameVerification, attributes, metricEnabled,
honeycombDataset, honeycombWriteKey, baseSampleRate );
}

public String getId()
Expand Down Expand Up @@ -149,6 +152,11 @@ public String getProxyUser()
return proxyUser;
}

public String getProxyAllowHttpJobTypes()
{
return proxyAllowHttpJobTypes;
}

public String getKeyCertPem()
{
return keyCertPem;
Expand Down Expand Up @@ -227,6 +235,12 @@ public SiteConfigBuilder withProxyUser( String proxyUser )
return this;
}

public SiteConfigBuilder withProxyAllowHttpJobTypes( String proxyAllowHttpJobTypes )
{
this.proxyAllowHttpJobTypes = proxyAllowHttpJobTypes;
return this;
}

public SiteConfigBuilder withTrustType( SiteTrustType trustType )
{
this.trustType = trustType;
Expand Down

0 comments on commit 8c8b384

Please sign in to comment.