|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fourthline.cling.transport.impl.apache.StreamClientImpl
public class StreamClientImpl
Implementation based on Apache HTTP Components 4.2.
This implementation DOES NOT WORK on Android. Read the Cling manual for alternatives on Android.
Field Summary | |
---|---|
protected org.apache.http.impl.conn.PoolingClientConnectionManager |
clientConnectionManager
|
protected StreamClientConfigurationImpl |
configuration
|
protected org.apache.http.params.HttpParams |
globalParams
|
protected org.apache.http.impl.client.DefaultHttpClient |
httpClient
|
Constructor Summary | |
---|---|
StreamClientImpl(StreamClientConfigurationImpl configuration)
|
Method Summary | |
---|---|
protected org.apache.http.client.methods.HttpUriRequest |
createHttpRequest(UpnpMessage upnpMessage,
UpnpRequest upnpRequestOperation)
|
protected org.apache.http.HttpEntity |
createHttpRequestEntity(UpnpMessage upnpMessage)
|
protected org.apache.http.client.ResponseHandler<StreamResponseMessage> |
createResponseHandler()
|
StreamClientConfigurationImpl |
getConfiguration()
|
protected org.apache.http.params.HttpParams |
getRequestParams(StreamRequestMessage requestMessage)
|
StreamResponseMessage |
sendRequest(StreamRequestMessage requestMessage)
Sends the given request via TCP (HTTP) and returns the response. |
void |
stop()
Stops the service, closes any connection pools etc. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final StreamClientConfigurationImpl configuration
protected final org.apache.http.impl.conn.PoolingClientConnectionManager clientConnectionManager
protected final org.apache.http.impl.client.DefaultHttpClient httpClient
protected final org.apache.http.params.HttpParams globalParams
Constructor Detail |
---|
public StreamClientImpl(StreamClientConfigurationImpl configuration) throws InitializationException
InitializationException
Method Detail |
---|
public StreamClientConfigurationImpl getConfiguration()
getConfiguration
in interface StreamClient<StreamClientConfigurationImpl>
public StreamResponseMessage sendRequest(StreamRequestMessage requestMessage)
StreamClient
This method will always try to complete execution without throwing an exception. It will
return null
if an error occurs, and optionally log any exception messages.
This method is required to add a Host
HTTP header to the
outgoing HTTP request, even if the given
StreamRequestMessage
does not contain such a header.
This method will add the User-Agent
HTTP header to the outgoing HTTP request if
the given message did not already contain such a header. You can set this default value in your
StreamClientConfiguration
.
sendRequest
in interface StreamClient<StreamClientConfigurationImpl>
requestMessage
- The message to send.
null
if no response has been received or an error occurred.public void stop()
StreamClient
stop
in interface StreamClient<StreamClientConfigurationImpl>
protected org.apache.http.client.methods.HttpUriRequest createHttpRequest(UpnpMessage upnpMessage, UpnpRequest upnpRequestOperation) throws org.apache.http.MethodNotSupportedException
org.apache.http.MethodNotSupportedException
protected org.apache.http.HttpEntity createHttpRequestEntity(UpnpMessage upnpMessage)
protected org.apache.http.client.ResponseHandler<StreamResponseMessage> createResponseHandler()
protected org.apache.http.params.HttpParams getRequestParams(StreamRequestMessage requestMessage)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |