public class StreamTransport extends Object implements com.ning.http.client.AsyncHandler<String>, Transport
Transport
implementationModifier and Type | Field and Description |
---|---|
protected String |
charSet |
protected AtomicBoolean |
closed |
protected Future |
connectOperationFuture |
protected List<Decoder<? extends Object,?>> |
decoders |
protected AtomicBoolean |
errorHandled |
protected 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 ScheduledExecutorService |
timer |
protected Future |
underlyingFuture |
Constructor and Description |
---|
StreamTransport(com.ning.http.client.RequestBuilder requestBuilder,
Options options,
Request request,
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(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) |
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(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 List<FunctionWrapper> functions
protected String charSet
protected final FunctionResolver resolver
protected final Options options
protected final com.ning.http.client.RequestBuilder requestBuilder
protected final Request request
protected final AtomicBoolean closed
protected final boolean isBinary
protected Socket.STATUS status
protected final AtomicBoolean errorHandled
protected Future underlyingFuture
protected Future connectOperationFuture
protected final boolean protocolEnabled
protected final ScheduledExecutorService timer
protected boolean protocolReceived
public StreamTransport(com.ning.http.client.RequestBuilder requestBuilder, Options options, Request request, List<FunctionWrapper> functions)
public Transport registerF(FunctionWrapper function)
FunctionResolver
registerF
in interface Transport
function
- FunctionResolver
public void onThrowable(Throwable t)
onThrowable
in interface com.ning.http.client.AsyncHandler<String>
onThrowable
in interface Transport
t
- a Throwable
public com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart) throws Exception
public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) throws Exception
public com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus) throws Exception
public Request.TRANSPORT name()
public void close()
public Socket.STATUS status()
Socket.STATUS
public boolean errorHandled()
Function
errorHandled
in interface Transport
public void connectedFuture(Future f)
Transport
Future
, which will unlock the Socket.fire(java.lang.Object)
method once the connection has been fully established.connectedFuture
in interface Transport
f
- Future
Copyright © 2015. All Rights Reserved.