Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.teleal.cling.transport.impl.apache
Class StreamClientImpl

    java.lang.Object
      org.teleal.cling.transport.impl.apache.StreamClientImpl

All Implemented Interfaces:
  StreamClient<StreamClientConfigurationImpl>

    public class StreamClientImpl

extends Object
implements StreamClient<StreamClientConfigurationImpl>

Implementation based on Apache HTTP Components.

This implementation works on Android.

Author:
  Christian Bauer

Field Summary
`protected org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager` | `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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### configuration

    protected final StreamClientConfigurationImpl configuration

### clientConnectionManager

    protected final org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager clientConnectionManager

### httpClient

    protected final org.apache.http.impl.client.DefaultHttpClient httpClient

### globalParams

    protected final org.apache.http.params.HttpParams globalParams

Constructor Detail

### StreamClientImpl

    public StreamClientImpl(StreamClientConfigurationImpl configuration)
                     throws InitializationException

Throws:
  `InitializationException`

Method Detail

### getConfiguration

    public StreamClientConfigurationImpl getConfiguration()

  Specified by:
    `getConfiguration` in interface `StreamClient<StreamClientConfigurationImpl>`
  Returns:
    This service's configuration.

### sendRequest

    public StreamResponseMessage sendRequest(StreamRequestMessage requestMessage)

  Description copied from interface: `StreamClient`
  Sends the given request via TCP (HTTP) and returns the response.

  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 might add a `User-Agent` HTTP header to the outgoing HTTP request.

  Specified by:
    `sendRequest` in interface `StreamClient<StreamClientConfigurationImpl>`
  Parameters:
    `requestMessage` - The message to send.
  Returns:
    The response or `null` if no response has been received or an error occured.

### createHttpRequest

    protected org.apache.http.client.methods.HttpUriRequest createHttpRequest(UpnpMessage upnpMessage,
                                                                              UpnpRequest upnpRequestOperation)
                                                                       throws org.apache.http.MethodNotSupportedException

  Throws:
    `org.apache.http.MethodNotSupportedException`

### createHttpRequestEntity

    protected org.apache.http.HttpEntity createHttpRequestEntity(UpnpMessage upnpMessage)

### createResponseHandler

    protected org.apache.http.client.ResponseHandler<StreamResponseMessage> createResponseHandler()

### getRequestParams

    protected org.apache.http.params.HttpParams getRequestParams(StreamRequestMessage requestMessage)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011 Teleal GmbH, Switzerland. All Rights Reserved.