org.atmosphere.wasync.transport
Class WebSocketTransport

java.lang.Object
  extended by com.ning.http.client.websocket.WebSocketUpgradeHandler
      extended by org.atmosphere.wasync.transport.WebSocketTransport
All Implemented Interfaces:
com.ning.http.client.AsyncHandler<com.ning.http.client.websocket.WebSocket>, com.ning.http.client.UpgradeHandler<com.ning.http.client.websocket.WebSocket>, Transport

public class WebSocketTransport
extends com.ning.http.client.websocket.WebSocketUpgradeHandler
implements Transport


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ning.http.client.websocket.WebSocketUpgradeHandler
com.ning.http.client.websocket.WebSocketUpgradeHandler.Builder
 
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler
com.ning.http.client.AsyncHandler.STATE
 
Constructor Summary
WebSocketTransport(Options options, List<Decoder<?,?>> decoders, List<FunctionWrapper> functions, FunctionResolver resolver)
           
 
Method Summary
 boolean canHandle(Request request)
          Return true if the transport can handle the request.
 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)
          
 com.ning.http.client.websocket.WebSocket onCompleted()
          
 void onFailure(Throwable t)
          
 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 onSuccess(com.ning.http.client.websocket.WebSocket webSocket)
          
 void onThrowable(Throwable t)
          Called when an unexpected exception ocurred.
 Transport registerF(FunctionWrapper function)
          Register a new FunctionResolver
 
Methods inherited from class com.ning.http.client.websocket.WebSocketUpgradeHandler
onClose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketTransport

public WebSocketTransport(Options options,
                          List<Decoder<?,?>> decoders,
                          List<FunctionWrapper> functions,
                          FunctionResolver resolver)
Method Detail

onThrowable

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

Specified by:
onThrowable in interface com.ning.http.client.AsyncHandler<com.ning.http.client.websocket.WebSocket>
Specified by:
onThrowable in interface Transport
Overrides:
onThrowable in class com.ning.http.client.websocket.WebSocketUpgradeHandler
Parameters:
t - a Throwable

close

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

Specified by:
close in interface Transport

canHandle

public boolean canHandle(Request request)
Description copied from interface: Transport
Return true if the transport can handle the request.

Specified by:
canHandle in interface Transport
Parameters:
request - Request
Returns:
true if the transport can handle the request.

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<com.ning.http.client.websocket.WebSocket>
Overrides:
onBodyPartReceived in class com.ning.http.client.websocket.WebSocketUpgradeHandler
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<com.ning.http.client.websocket.WebSocket>
Overrides:
onStatusReceived in class com.ning.http.client.websocket.WebSocketUpgradeHandler
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<com.ning.http.client.websocket.WebSocket>
Overrides:
onHeadersReceived in class com.ning.http.client.websocket.WebSocketUpgradeHandler
Throws:
Exception

onCompleted

public com.ning.http.client.websocket.WebSocket onCompleted()
                                                     throws Exception

Specified by:
onCompleted in interface com.ning.http.client.AsyncHandler<com.ning.http.client.websocket.WebSocket>
Overrides:
onCompleted in class com.ning.http.client.websocket.WebSocketUpgradeHandler
Throws:
Exception

onSuccess

public void onSuccess(com.ning.http.client.websocket.WebSocket webSocket)

Specified by:
onSuccess in interface com.ning.http.client.UpgradeHandler<com.ning.http.client.websocket.WebSocket>
Overrides:
onSuccess in class com.ning.http.client.websocket.WebSocketUpgradeHandler

name

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

Specified by:
name in interface Transport
Returns:
transport name

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;

onFailure

public final void onFailure(Throwable t)

Specified by:
onFailure in interface com.ning.http.client.UpgradeHandler<com.ning.http.client.websocket.WebSocket>
Overrides:
onFailure in class com.ning.http.client.websocket.WebSocketUpgradeHandler


Copyright © 2012. All Rights Reserved.