com.koushikdutta.async.http.server
Class AsyncHttpServerResponseImpl

java.lang.Object
  extended by com.koushikdutta.async.http.server.AsyncHttpServerResponseImpl
All Implemented Interfaces:
CompletedCallback, DataSink, AsyncHttpServerResponse

public class AsyncHttpServerResponseImpl
extends java.lang.Object
implements AsyncHttpServerResponse


Method Summary
 void close()
           
 void end()
           
 CompletedCallback getClosedCallback()
           
 ResponseHeaders getHeaders()
           
 AsyncServer getServer()
           
 AsyncSocket getSocket()
           
 WritableCallback getWriteableCallback()
           
 boolean isOpen()
           
 void onCompleted(java.lang.Exception ex)
          Alias for end.
protected  void onEnd()
           
 void redirect(java.lang.String location)
           
protected  void report(java.lang.Exception e)
           
 void responseCode(int code)
           
 void send(JSONObject json)
           
 void send(java.lang.String string)
           
 void send(java.lang.String contentType, java.lang.String string)
           
 void sendFile(java.io.File file)
           
 void setClosedCallback(CompletedCallback handler)
           
 void setContentType(java.lang.String contentType)
           
 void setWriteableCallback(WritableCallback handler)
           
 void write(java.nio.ByteBuffer bb)
           
 void write(ByteBufferList bb)
           
 void writeHead()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHeaders

public ResponseHeaders getHeaders()
Specified by:
getHeaders in interface AsyncHttpServerResponse

getSocket

public AsyncSocket getSocket()
Specified by:
getSocket in interface AsyncHttpServerResponse

write

public void write(java.nio.ByteBuffer bb)
Specified by:
write in interface DataSink

write

public void write(ByteBufferList bb)
Specified by:
write in interface DataSink

setWriteableCallback

public void setWriteableCallback(WritableCallback handler)
Specified by:
setWriteableCallback in interface DataSink

getWriteableCallback

public WritableCallback getWriteableCallback()
Specified by:
getWriteableCallback in interface DataSink

end

public void end()
Specified by:
end in interface DataSink
Specified by:
end in interface AsyncHttpServerResponse

writeHead

public void writeHead()
Specified by:
writeHead in interface AsyncHttpServerResponse

setContentType

public void setContentType(java.lang.String contentType)
Specified by:
setContentType in interface AsyncHttpServerResponse

send

public void send(java.lang.String contentType,
                 java.lang.String string)
Specified by:
send in interface AsyncHttpServerResponse

onEnd

protected void onEnd()

report

protected void report(java.lang.Exception e)

send

public void send(java.lang.String string)
Specified by:
send in interface AsyncHttpServerResponse

send

public void send(JSONObject json)
Specified by:
send in interface AsyncHttpServerResponse

sendFile

public void sendFile(java.io.File file)
Specified by:
sendFile in interface AsyncHttpServerResponse

responseCode

public void responseCode(int code)
Specified by:
responseCode in interface AsyncHttpServerResponse

redirect

public void redirect(java.lang.String location)
Specified by:
redirect in interface AsyncHttpServerResponse

onCompleted

public void onCompleted(java.lang.Exception ex)
Description copied from interface: AsyncHttpServerResponse
Alias for end. Used with CompletedEmitters

Specified by:
onCompleted in interface CompletedCallback
Specified by:
onCompleted in interface AsyncHttpServerResponse

isOpen

public boolean isOpen()
Specified by:
isOpen in interface DataSink

close

public void close()
Specified by:
close in interface DataSink

setClosedCallback

public void setClosedCallback(CompletedCallback handler)
Specified by:
setClosedCallback in interface DataSink

getClosedCallback

public CompletedCallback getClosedCallback()
Specified by:
getClosedCallback in interface DataSink

getServer

public AsyncServer getServer()
Specified by:
getServer in interface DataSink