org.exist.http
Class HttpServerConnection

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.exist.http.HttpServerConnection
All Implemented Interfaces:
java.lang.Runnable

public class HttpServerConnection
extends java.lang.Thread

Description of the Class

Author:
Wolfgang Meier

Field Summary
protected  DBBroker broker
           
protected  Configuration config
           
protected  javax.xml.parsers.DocumentBuilder docBuilder
           
protected  XPathParser parser
           
protected  org.exist.http.HttpServer.ConnectionPool pool
           
protected  javax.xml.parsers.SAXParser sax
           
protected  java.net.Socket sock
           
protected  boolean terminate
           
protected  java.lang.String tmpDir
           
protected  User user
           
protected  java.lang.String xslStyle
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpServerConnection(Configuration config, org.exist.http.HttpServer.ConnectionPool pool)
          Constructor for the HttpServerConnection object
 
Method Summary
protected  void doGet(java.util.HashMap parameters, java.lang.String name, int len)
          Description of the Method
protected  java.lang.String doPost(java.lang.String request, java.lang.String name)
          Description of the Method
protected  void errorReply(int code)
          Description of the Method
protected  void errorReply(int code, java.lang.String message)
          Description of the Method
protected  java.lang.String formatErrorMsg(java.lang.String message, int status)
          Description of the Method
protected  void get(java.lang.String name, int len)
          Description of the Method
protected  void post(java.lang.String input, java.lang.String name, int len, java.lang.String contentType)
          Description of the Method
protected  java.lang.String printAll(org.w3c.dom.NodeList resultSet, int howmany, int start, long queryTime, boolean indent, java.lang.String stylesheet)
          Description of the Method
protected  java.lang.String printCollection(java.lang.String collection, java.lang.String[] names)
          Description of the Method
protected  java.lang.String printSummary(org.w3c.dom.NodeList resultSet, long queryTime)
          Description of the Method
protected  java.lang.String printValues(ValueSet resultSet, int howmany, int start)
          Description of the Method
 void process(java.net.Socket sock)
          Description of the Method
protected  java.util.HashMap processParameters(java.lang.String args)
          Description of the Method
protected  void put(java.io.File tempFile, java.lang.String name, int len)
          Description of the Method
 void run()
          Main processing method for the HttpServerConnection object
protected  java.lang.String search(java.lang.String query, int howmany, int start, boolean printSummary, boolean indent, java.lang.String stylesheet)
          Description of the Method
 void terminate()
          Description of the Method
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

broker

protected DBBroker broker

config

protected Configuration config

docBuilder

protected javax.xml.parsers.DocumentBuilder docBuilder

parser

protected XPathParser parser

pool

protected org.exist.http.HttpServer.ConnectionPool pool

sax

protected javax.xml.parsers.SAXParser sax

sock

protected java.net.Socket sock

terminate

protected boolean terminate

tmpDir

protected java.lang.String tmpDir

user

protected User user

xslStyle

protected java.lang.String xslStyle
Constructor Detail

HttpServerConnection

public HttpServerConnection(Configuration config,
                            org.exist.http.HttpServer.ConnectionPool pool)
Constructor for the HttpServerConnection object

Parameters:
config - Description of the Parameter
pool - Description of the Parameter
Method Detail

doGet

protected void doGet(java.util.HashMap parameters,
                     java.lang.String name,
                     int len)
Description of the Method

Parameters:
parameters - Description of the Parameter
name - Description of the Parameter
len - Description of the Parameter

doPost

protected java.lang.String doPost(java.lang.String request,
                                  java.lang.String name)
Description of the Method

Parameters:
request - Description of the Parameter
name - Description of the Parameter
Returns:
Description of the Return Value

errorReply

protected void errorReply(int code)
Description of the Method

Parameters:
code - Description of the Parameter

errorReply

protected void errorReply(int code,
                          java.lang.String message)
Description of the Method

Parameters:
code - Description of the Parameter
message - Description of the Parameter

formatErrorMsg

protected java.lang.String formatErrorMsg(java.lang.String message,
                                          int status)
Description of the Method

Parameters:
message - Description of the Parameter
status - Description of the Parameter
Returns:
Description of the Return Value

get

protected void get(java.lang.String name,
                   int len)
Description of the Method

Parameters:
name - Description of the Parameter
len - Description of the Parameter

post

protected void post(java.lang.String input,
                    java.lang.String name,
                    int len,
                    java.lang.String contentType)
Description of the Method

Parameters:
input - Description of the Parameter
name - Description of the Parameter
len - Description of the Parameter
contentType - Description of the Parameter

printAll

protected java.lang.String printAll(org.w3c.dom.NodeList resultSet,
                                    int howmany,
                                    int start,
                                    long queryTime,
                                    boolean indent,
                                    java.lang.String stylesheet)
Description of the Method

Parameters:
resultSet - Description of the Parameter
howmany - Description of the Parameter
start - Description of the Parameter
queryTime - Description of the Parameter
indent - Description of the Parameter
stylesheet - Description of the Parameter
Returns:
Description of the Return Value

printCollection

protected java.lang.String printCollection(java.lang.String collection,
                                           java.lang.String[] names)
Description of the Method

Parameters:
collection - Description of the Parameter
names - Description of the Parameter
Returns:
Description of the Return Value

printSummary

protected java.lang.String printSummary(org.w3c.dom.NodeList resultSet,
                                        long queryTime)
Description of the Method

Parameters:
resultSet - Description of the Parameter
queryTime - Description of the Parameter
Returns:
Description of the Return Value

printValues

protected java.lang.String printValues(ValueSet resultSet,
                                       int howmany,
                                       int start)
Description of the Method

Parameters:
resultSet - Description of the Parameter
howmany - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

process

public void process(java.net.Socket sock)
Description of the Method

Parameters:
sock - Description of the Parameter

processParameters

protected java.util.HashMap processParameters(java.lang.String args)
Description of the Method

Parameters:
args - Description of the Parameter
Returns:
Description of the Return Value

put

protected void put(java.io.File tempFile,
                   java.lang.String name,
                   int len)
Description of the Method

Parameters:
tempFile - Description of the Parameter
name - Description of the Parameter
len - Description of the Parameter

run

public void run()
Main processing method for the HttpServerConnection object

Throws:
java.lang.RuntimeException - DOCUMENT ME!

search

protected java.lang.String search(java.lang.String query,
                                  int howmany,
                                  int start,
                                  boolean printSummary,
                                  boolean indent,
                                  java.lang.String stylesheet)
Description of the Method

Parameters:
query - Description of the Parameter
howmany - Description of the Parameter
start - Description of the Parameter
printSummary - Description of the Parameter
indent - Description of the Parameter
stylesheet - Description of the Parameter
Returns:
Description of the Return Value

terminate

public void terminate()
Description of the Method



Copyright (C) Wolfgang Meier. All rights reserved.