org.atmosphere.cpr
Interface AsyncIOWriter

All Known Implementing Classes:
AsyncIOWriterAdapter, GrizzlyWebSocket, Jetty8WebSocket, TomcatWebSocket, WebSocket

public interface AsyncIOWriter

An Asynchronous I/O Writer is used by a AtmosphereResponse when writing data.

Author:
Jeanfrancois Arcand

Method Summary
 void close()
          Close the underlying connection.
 void close(AtmosphereResponse r)
          Close the underlying connection.
 AsyncIOWriter flush()
          Flush the buffered content
 AsyncIOWriter flush(AtmosphereResponse r)
          Flush the buffered content
 AsyncIOWriter redirect(AtmosphereResponse r, String location)
          Redirect a WebSocket request to another location
 AsyncIOWriter redirect(String location)
          Redirect a WebSocket request to another location
 AsyncIOWriter write(AtmosphereResponse r, byte[] data)
          Write a WebSocket message
 AsyncIOWriter write(AtmosphereResponse r, byte[] data, int offset, int length)
          Write a WebSocket message
 AsyncIOWriter write(AtmosphereResponse r, String data)
          Write a WebSocket message
 AsyncIOWriter write(byte[] data)
          Write a WebSocket message
 AsyncIOWriter write(byte[] data, int offset, int length)
          Write a WebSocket message
 AsyncIOWriter write(String data)
          Write a WebSocket message
 AsyncIOWriter writeError(AtmosphereResponse r, int errorCode, String message)
          Write an error code
 AsyncIOWriter writeError(int errorCode, String message)
          Write an error code
 

Method Detail

redirect

AsyncIOWriter redirect(AtmosphereResponse r,
                       String location)
                       throws IOException
Redirect a WebSocket request to another location

Parameters:
location -
Throws:
IOException

writeError

AsyncIOWriter writeError(AtmosphereResponse r,
                         int errorCode,
                         String message)
                         throws IOException
Write an error code

Parameters:
errorCode - the error code
message -
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    String data)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    byte[] data)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    byte[] data,
                    int offset,
                    int length)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
offset - offset of the message
length - length if the message
Throws:
IOException

close

void close(AtmosphereResponse r)
           throws IOException
Close the underlying connection.

Throws:
IOException

flush

AsyncIOWriter flush(AtmosphereResponse r)
                    throws IOException
Flush the buffered content

Throws:
IOException

redirect

AsyncIOWriter redirect(String location)
                       throws IOException
Redirect a WebSocket request to another location

Parameters:
location -
Throws:
IOException

writeError

AsyncIOWriter writeError(int errorCode,
                         String message)
                         throws IOException
Write an error code

Parameters:
errorCode - the error code
message -
Throws:
IOException

write

AsyncIOWriter write(String data)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(byte[] data)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(byte[] data,
                    int offset,
                    int length)
                    throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
offset - offset of the message
length - length if the message
Throws:
IOException

close

void close()
           throws IOException
Close the underlying connection.

Throws:
IOException

flush

AsyncIOWriter flush()
                    throws IOException
Flush the buffered content

Throws:
IOException


Copyright © 2012. All Rights Reserved.