org.fourthline.cling.transport.impl.apache
Class StreamClientConfigurationImpl

java.lang.Object
  extended by org.fourthline.cling.transport.impl.apache.StreamClientConfigurationImpl
All Implemented Interfaces:
StreamClientConfiguration

public class StreamClientConfigurationImpl
extends Object
implements StreamClientConfiguration

Settings for the Apache HTTP Components implementation.

Author:
Christian Bauer

Constructor Summary
StreamClientConfigurationImpl()
           
 
Method Summary
 int getConnectionTimeoutSeconds()
          Defaults to 20 seconds.
 String getContentCharset()
           
 int getDataReadTimeoutSeconds()
          Defaults to 60 seconds.
 int getMaxTotalConnections()
          Defaults to 1024.
 int getMaxTotalPerRoute()
          Defaults to 100.
 int getRequestRetryCount()
          If -1, the default value of HttpClient will be used (3 in httpclient 4.1)
 int getSocketBufferSize()
          If -1, the default value of HttpClient will be used (8192 in httpclient 4.1)
 boolean getStaleCheckingEnabled()
           
 String getUserAgentValue(int majorVersion, int minorVersion)
          Defaults to string value of ServerClientTokens.
 void setConnectionTimeoutSeconds(int connectionTimeoutSeconds)
           
 void setContentCharset(String contentCharset)
           
 void setDataReadTimeoutSeconds(int dataReadTimeoutSeconds)
           
 void setMaxTotalConnections(int maxTotalConnections)
           
 void setMaxTotalPerRoute(int maxTotalPerRoute)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamClientConfigurationImpl

public StreamClientConfigurationImpl()
Method Detail

getMaxTotalConnections

public int getMaxTotalConnections()
Defaults to 1024.


setMaxTotalConnections

public void setMaxTotalConnections(int maxTotalConnections)

getMaxTotalPerRoute

public int getMaxTotalPerRoute()
Defaults to 100.


setMaxTotalPerRoute

public void setMaxTotalPerRoute(int maxTotalPerRoute)

getConnectionTimeoutSeconds

public int getConnectionTimeoutSeconds()
Defaults to 20 seconds.


setConnectionTimeoutSeconds

public void setConnectionTimeoutSeconds(int connectionTimeoutSeconds)

getDataReadTimeoutSeconds

public int getDataReadTimeoutSeconds()
Defaults to 60 seconds.


setDataReadTimeoutSeconds

public void setDataReadTimeoutSeconds(int dataReadTimeoutSeconds)

getContentCharset

public String getContentCharset()
Returns:
Character set of textual content, defaults to "UTF-8".

setContentCharset

public void setContentCharset(String contentCharset)

getUserAgentValue

public String getUserAgentValue(int majorVersion,
                                int minorVersion)
Defaults to string value of ServerClientTokens.

Specified by:
getUserAgentValue in interface StreamClientConfiguration
Parameters:
majorVersion - The UPnP UDA major version.
minorVersion - The UPnP UDA minor version.
Returns:
The HTTP user agent value.

getSocketBufferSize

public int getSocketBufferSize()
If -1, the default value of HttpClient will be used (8192 in httpclient 4.1)

This will also avoid OOM on the HTC Thunderbolt where default size is 2MB (!): http://stackoverflow.com/questions/5358014/android-httpclient-oom-on-4g-lte-htc-thunderbolt


getStaleCheckingEnabled

public boolean getStaleCheckingEnabled()

getRequestRetryCount

public int getRequestRetryCount()
If -1, the default value of HttpClient will be used (3 in httpclient 4.1)



Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.