Package se.michaelthelin.spotify
Class SpotifyHttpManager.Builder
java.lang.Object
se.michaelthelin.spotify.SpotifyHttpManager.Builder
- Enclosing class:
SpotifyHttpManager
Builder class for creating
SpotifyHttpManager
instances.
Provides a fluent interface for configuring HTTP client settings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newSpotifyHttpManager
instance with the configured settings.setCacheMaxEntries
(Integer cacheMaxEntries) Sets the maximum number of cache entries.setCacheMaxObjectSize
(Integer cacheMaxObjectSize) Sets the maximum size of cached objects.setCacheShared
(Boolean cacheShared) Sets whether the cache is shared between multiple HTTP clients.setConnectionManager
(org.apache.hc.client5.http.io.HttpClientConnectionManager connectionManager) Sets the HTTP client connection manager.setConnectionRequestTimeout
(Integer connectionRequestTimeout) Sets the connection request timeout in milliseconds.setProxy
(org.apache.hc.core5.http.HttpHost proxy) Sets the HTTP proxy configuration.setProxyCredentials
(org.apache.hc.client5.http.auth.UsernamePasswordCredentials proxyCredentials) Sets the proxy authentication credentials.setSocketTimeout
(Integer socketTimeout) Sets the socket timeout in milliseconds.
-
Constructor Details
-
Builder
public Builder()Default constructor.
-
-
Method Details
-
setConnectionManager
public SpotifyHttpManager.Builder setConnectionManager(org.apache.hc.client5.http.io.HttpClientConnectionManager connectionManager) Sets the HTTP client connection manager.- Parameters:
connectionManager
- the connection manager to use- Returns:
- this builder instance for method chaining
-
setProxy
Sets the HTTP proxy configuration.- Parameters:
proxy
- the HTTP proxy host- Returns:
- this builder instance for method chaining
-
setProxyCredentials
public SpotifyHttpManager.Builder setProxyCredentials(org.apache.hc.client5.http.auth.UsernamePasswordCredentials proxyCredentials) Sets the proxy authentication credentials.- Parameters:
proxyCredentials
- the proxy credentials- Returns:
- this builder instance for method chaining
-
setCacheMaxEntries
Sets the maximum number of cache entries.- Parameters:
cacheMaxEntries
- the maximum cache entries- Returns:
- this builder instance for method chaining
-
setCacheMaxObjectSize
Sets the maximum size of cached objects.- Parameters:
cacheMaxObjectSize
- the maximum cache object size- Returns:
- this builder instance for method chaining
-
setConnectionRequestTimeout
Sets the connection request timeout in milliseconds.- Parameters:
connectionRequestTimeout
- the connection request timeout- Returns:
- this builder instance for method chaining
-
setSocketTimeout
Sets the socket timeout in milliseconds.- Parameters:
socketTimeout
- the socket timeout- Returns:
- this builder instance for method chaining
-
build
Builds a newSpotifyHttpManager
instance with the configured settings.- Returns:
- a new SpotifyHttpManager instance
-