public class StreamTransport extends java.lang.Object implements com.ning.http.client.AsyncHandler<java.lang.String>, Transport
Transport implementation| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
charSet |
protected java.util.concurrent.atomic.AtomicBoolean |
closed |
protected Future |
connectOperationFuture |
protected java.util.List<Decoder<? extends java.lang.Object,?>> |
decoders |
protected java.util.concurrent.atomic.AtomicBoolean |
errorHandled |
protected java.util.List<FunctionWrapper> |
functions |
protected boolean |
isBinary |
protected Options |
options |
protected boolean |
protocolEnabled |
protected boolean |
protocolReceived |
protected Request |
request |
protected com.ning.http.client.RequestBuilder |
requestBuilder |
protected FunctionResolver |
resolver |
protected Socket.STATUS |
status |
protected java.util.concurrent.ScheduledExecutorService |
timer |
protected Future |
underlyingFuture |
| Constructor and Description |
|---|
StreamTransport(com.ning.http.client.RequestBuilder requestBuilder,
Options options,
Request request,
java.util.List<FunctionWrapper> functions) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying transport}
|
void |
connectedFuture(Future f)
Set the
Future, which will unlock the Socket.fire(java.lang.Object) method once the connection has been fully established. |
void |
error(java.lang.Throwable t)
Set a
Throwable |
boolean |
errorHandled()
Error handled by a
Function |
void |
future(Future f)
Set the
Future, which can be used to clone the connection. |
Request.TRANSPORT |
name()
The transport name
|
com.ning.http.client.AsyncHandler.STATE |
onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart) |
java.lang.String |
onCompleted() |
com.ning.http.client.AsyncHandler.STATE |
onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) |
com.ning.http.client.AsyncHandler.STATE |
onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus) |
void |
onThrowable(java.lang.Throwable t)
Called when an unexpected exception ocurred.
|
Transport |
registerF(FunctionWrapper function)
Register a new
FunctionResolver |
Socket.STATUS |
status()
Return the current
Socket.STATUS |
protected final java.util.List<FunctionWrapper> functions
protected final java.util.List<Decoder<? extends java.lang.Object,?>> decoders
protected java.lang.String charSet
protected final FunctionResolver resolver
protected final Options options
protected final com.ning.http.client.RequestBuilder requestBuilder
protected final Request request
protected final java.util.concurrent.atomic.AtomicBoolean closed
protected final boolean isBinary
protected Socket.STATUS status
protected final java.util.concurrent.atomic.AtomicBoolean errorHandled
protected Future underlyingFuture
protected Future connectOperationFuture
protected final boolean protocolEnabled
protected final java.util.concurrent.ScheduledExecutorService timer
protected boolean protocolReceived
public StreamTransport(com.ning.http.client.RequestBuilder requestBuilder,
Options options,
Request request,
java.util.List<FunctionWrapper> functions)
public Transport registerF(FunctionWrapper function)
FunctionResolverregisterF in interface Transportfunction - FunctionResolverpublic void onThrowable(java.lang.Throwable t)
onThrowable in interface com.ning.http.client.AsyncHandler<java.lang.String>onThrowable in interface Transportt - a Throwablepublic com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart)
throws java.lang.Exception
onBodyPartReceived in interface com.ning.http.client.AsyncHandler<java.lang.String>java.lang.Exceptionpublic com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers)
throws java.lang.Exception
onHeadersReceived in interface com.ning.http.client.AsyncHandler<java.lang.String>java.lang.Exceptionpublic com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus)
throws java.lang.Exception
onStatusReceived in interface com.ning.http.client.AsyncHandler<java.lang.String>java.lang.Exceptionpublic java.lang.String onCompleted()
throws java.lang.Exception
onCompleted in interface com.ning.http.client.AsyncHandler<java.lang.String>java.lang.Exceptionpublic Request.TRANSPORT name()
public void close()
public Socket.STATUS status()
Socket.STATUSpublic boolean errorHandled()
FunctionerrorHandled in interface Transportpublic void error(java.lang.Throwable t)
Throwablepublic void connectedFuture(Future f)
TransportFuture, which will unlock the Socket.fire(java.lang.Object) method once the connection has been fully established.connectedFuture in interface Transportf - FutureCopyright © 2019. All Rights Reserved.