|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.teleal.cling.transport.impl.StreamClientImpl
public class StreamClientImpl
Default implementation based on the JDK's HttpURLConnection.
This class works around a serious design issue in the SUN JDK, so it will not work on any JDK that
doesn't offer the sun.net.www.protocol.http.HttpURLConnection implementation.
| Field Summary | |
|---|---|
protected StreamClientConfigurationImpl |
configuration
|
| Constructor Summary | |
|---|---|
StreamClientImpl(StreamClientConfigurationImpl configuration)
|
|
| Method Summary | |
|---|---|
protected void |
applyHeaders(HttpURLConnection urlConnection,
org.teleal.common.http.Headers headers)
|
protected void |
applyRequestBody(HttpURLConnection urlConnection,
StreamRequestMessage requestMessage)
|
protected void |
applyRequestProperties(HttpURLConnection urlConnection,
StreamRequestMessage requestMessage)
|
protected StreamResponseMessage |
createResponse(HttpURLConnection urlConnection,
InputStream inputStream)
|
StreamClientConfigurationImpl |
getConfiguration()
|
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
| Constructor Detail |
|---|
public StreamClientImpl(StreamClientConfigurationImpl configuration)
throws InitializationException
InitializationException| Method Detail |
|---|
public StreamClientConfigurationImpl getConfiguration()
getConfiguration in interface StreamClientpublic 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 might add a User-Agent HTTP header to the outgoing HTTP request.
sendRequest in interface StreamClientrequestMessage - The message to send.
null if no response has been received or an error occured.public void stop()
StreamClient
stop in interface StreamClient
protected void applyRequestProperties(HttpURLConnection urlConnection,
StreamRequestMessage requestMessage)
protected void applyHeaders(HttpURLConnection urlConnection,
org.teleal.common.http.Headers headers)
protected void applyRequestBody(HttpURLConnection urlConnection,
StreamRequestMessage requestMessage)
throws IOException
IOException
protected StreamResponseMessage createResponse(HttpURLConnection urlConnection,
InputStream inputStream)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||