public static SiteConfig defaultSiteConfig( String baseUrl ) { return new SiteConfigBuilder( "indy", baseUrl ).withRequestTimeoutSeconds( 30 ) .withMaxConnections( IndyClientHttp.GLOBAL_MAX_CONNECTIONS ) .build(); }
@Override public int hashCode() { return config.hashCode(); }
private int getProxyPort( final SiteConfig location ) { int port = location.getProxyPort(); if ( port < 1 ) { port = -1; } return port; }
public String getHost() throws MalformedURLException { return new URL( getUri() ).getHost(); }
public String getId() { return config.getId(); } }
public int getMaxConnections() { return config.getMaxConnections(); }
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 ); }
public int getMaxPerRoute() { return maxPerRoute == null ? getMaxConnections() : maxPerRoute; }
public int getMaxPerRoute() { return config.getMaxPerRoute(); }
public ConnectionConfig getConnectionConfig() { return config.getConnectionConfig(); }
public SocketConfig getSocketConfig() { return config.getSocketConfig(); }
@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof SiteConnectionConfig ) ) { return false; } SiteConnectionConfig that = (SiteConnectionConfig) o; return config.equals( that.config ); }
public int getConnectionPoolTimeoutSeconds() { return config.getConnectionPoolTimeoutSeconds(); }
public <T> T getAttribute( String key, Class<T> type, T defaultValue ) { Object value = getAttribute( key ); return value == null ? defaultValue : type.cast( value ); }
public String getHost() throws MalformedURLException { return new URL( getUri() ).getHost(); }
public int getPort() throws MalformedURLException { URL u = new URL( getUri() ); int port = u.getPort(); if ( port < 1 ) { port = u.getDefaultPort(); } return port; }
public PasswordKey( SiteConfig config, PasswordType type ) { this( config.getId(), type ); }
public int getMaxPerRoute() { return maxPerRoute == null ? getMaxConnections() : maxPerRoute; }