org.atmosphere.wasync.transport
Class StreamTransport<T>

java.lang.Object
  extended by org.atmosphere.wasync.transport.StreamTransport<T>
All Implemented Interfaces:
com.ning.http.client.AsyncHandler<String>, Transport
Direct Known Subclasses:
LongPollingTransport, SSETransport

public class StreamTransport<T>
extends Object
implements com.ning.http.client.AsyncHandler<String>, Transport


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler
com.ning.http.client.AsyncHandler.STATE
 
Nested classes/interfaces inherited from interface org.atmosphere.wasync.Transport
Transport.EVENT_TYPE
 
Field Summary
protected  String charSet
           
protected  Future f
           
protected  List<FunctionWrapper> functions
           
 
Constructor Summary
StreamTransport(com.ning.http.client.RequestBuilder requestBuilder, Options options, Request request, List<FunctionWrapper> functions)
           
 
Method Summary
 void close()
          Close the underlying transport}
 Transport future(Future f)
          The current Socket's Future
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f

protected Future f

functions

protected final List<FunctionWrapper> functions

charSet

protected String charSet
Constructor Detail

StreamTransport

public StreamTransport(com.ning.http.client.RequestBuilder requestBuilder,
                       Options options,
                       Request request,
                       List<FunctionWrapper> functions)
Method Detail

future

public Transport future(Future f)
Description copied from interface: Transport
The current Socket's Future

Specified by:
future in interface Transport
Returns:
this

registerF

public Transport registerF(FunctionWrapper function)
Description copied from interface: Transport
Register a new FunctionResolver

Specified by:
registerF in interface Transport
Parameters:
function - FunctionResolver
Returns:
this;

onThrowable

public void onThrowable(Throwable t)
Called when an unexpected exception ocurred.

Specified by:
onThrowable in interface com.ning.http.client.AsyncHandler<String>
Specified by:
onThrowable in interface Transport
Parameters:
t - a Throwable

onBodyPartReceived

public com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart)
                                                           throws Exception

Specified by:
onBodyPartReceived in interface com.ning.http.client.AsyncHandler<String>
Throws:
Exception

onHeadersReceived

public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers)
                                                          throws Exception

Specified by:
onHeadersReceived in interface com.ning.http.client.AsyncHandler<String>
Throws:
Exception

onStatusReceived

public com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus)
                                                         throws Exception

Specified by:
onStatusReceived in interface com.ning.http.client.AsyncHandler<String>
Throws:
Exception

onCompleted

public String onCompleted()
                   throws Exception
Specified by:
onCompleted in interface com.ning.http.client.AsyncHandler<String>
Throws:
Exception

name

public Request.TRANSPORT name()
Description copied from interface: Transport
The transport name

Specified by:
name in interface Transport
Returns:
transport name

close

public void close()
Description copied from interface: Transport
Close the underlying transport}

Specified by:
close in interface Transport


Copyright © 2013. All Rights Reserved.