de.grogra.imp.net
Class HttpResponse

java.lang.Object
  extended by de.grogra.imp.net.HttpResponse
All Implemented Interfaces:
Command

public class HttpResponse
extends java.lang.Object
implements Command


Field Summary
 
Fields inherited from interface de.grogra.pf.ui.Command
DISPOSE
 
Constructor Summary
HttpResponse(HttpServer server, Request request, java.net.Socket client)
           
 
Method Summary
static HttpResponse get(Context ctx)
           
 java.net.Socket getClient()
           
 java.lang.String getCommandName()
          Returns a name which can be used in the graphical user interface to represent this command.
 Request getRequest()
           
 HttpServer getServer()
           
protected  void handleRequest()
           
 void run(java.lang.Object info, Context context)
          Performs the actions of this command.
 void send(boolean cont)
           
 void send(boolean cont, int status, java.lang.String reason)
           
 void sendBadRequest()
           
 void setContent(java.lang.String mimeType, byte[] content)
           
 void setContent(java.lang.String mimeType, java.lang.String encoding, java.lang.String content)
           
 void setException(java.io.IOException ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResponse

public HttpResponse(HttpServer server,
                    Request request,
                    java.net.Socket client)
Method Detail

get

public static HttpResponse get(Context ctx)

getClient

public java.net.Socket getClient()

getCommandName

public java.lang.String getCommandName()
Description copied from interface: Command
Returns a name which can be used in the graphical user interface to represent this command.

Specified by:
getCommandName in interface Command
Returns:
this commands's name

getRequest

public Request getRequest()

getServer

public HttpServer getServer()

handleRequest

protected void handleRequest()

run

public void run(java.lang.Object info,
                Context context)
Description copied from interface: Command
Performs the actions of this command. This method is invoked by the JobManager after the command has been submitted to the job manager by one of execute, runAt, or runLater-methods. The arguments info and context are the arguments which have been provided as arguments to the JobManager-methods.

Specified by:
run in interface Command
Parameters:
info - an argument
context - a context

send

public void send(boolean cont)

send

public void send(boolean cont,
                 int status,
                 java.lang.String reason)

sendBadRequest

public void sendBadRequest()

setContent

public void setContent(java.lang.String mimeType,
                       byte[] content)

setContent

public void setContent(java.lang.String mimeType,
                       java.lang.String encoding,
                       java.lang.String content)
                throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

setException

public void setException(java.io.IOException ex)