diff options
Diffstat (limited to 'doc/uk/org/ury/server/Server.html')
-rw-r--r-- | doc/uk/org/ury/server/Server.html | 425 |
1 files changed, 425 insertions, 0 deletions
diff --git a/doc/uk/org/ury/server/Server.html b/doc/uk/org/ury/server/Server.html new file mode 100644 index 0000000..abb6497 --- /dev/null +++ b/doc/uk/org/ury/server/Server.html @@ -0,0 +1,425 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_20) on Sun Mar 20 03:05:36 GMT 2011 --> +<TITLE> +Server +</TITLE> + +<META NAME="date" CONTENT="2011-03-20"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Server"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Server.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../../uk/org/ury/server/RequestHandler.html" title="interface in uk.org.ury.server"><B>PREV CLASS</B></A> + <A HREF="../../../../uk/org/ury/server/ServerProtocol.html" title="class in uk.org.ury.server"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../../index.html?uk/org/ury/server/Server.html" target="_top"><B>FRAMES</B></A> + <A HREF="Server.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +uk.org.ury.server</FONT> +<BR> +Class Server</H2> +<PRE> +java.lang.Object + <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>uk.org.ury.server.Server</B> +</PRE> +<HR> +<DL> +<DT><PRE>public class <B>Server</B><DT>extends java.lang.Object</DL> +</PRE> + +<P> +The unified URY server, accepting requests over HTTP. +<P> + +<P> +<DL> +<DT><B>Author:</B></DT> + <DD>Matt Windsor</DD> +</DL> +<HR> + +<P> + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#Server()">Server</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#doConnection(java.net.Socket)">doConnection</A></B>(java.net.Socket clientSocket)</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../../../uk/org/ury/database/DatabaseDriver.html" title="class in uk.org.ury.database">DatabaseDriver</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#getDatabaseConnection(uk.org.ury.database.UserClass)">getDatabaseConnection</A></B>(<A HREF="../../../../uk/org/ury/database/UserClass.html" title="enum in uk.org.ury.database">UserClass</A> userClass)</CODE> + +<BR> + Get a database connection using the given user class.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#getVersion()">getVersion</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> org.apache.http.HttpResponse</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#handleGet(java.util.List)">handleGet</A></B>(java.util.List<java.lang.String> buffer)</CODE> + +<BR> + Handle a HTTP GET request.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> + +<BR> + The main method, which serves to create a server.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.util.Map<java.lang.String,java.lang.String></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#parseQueryString(java.lang.String)">parseQueryString</A></B>(java.lang.String query)</CODE> + +<BR> + Parse a query string, populating a key-value map of the + URL-unescaped results.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../../uk/org/ury/server/Server.html#processBuffer(java.util.List, java.io.PrintWriter)">processBuffer</A></B>(java.util.List<java.lang.String> buffer, + java.io.PrintWriter out)</CODE> + +<BR> + </TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="Server()"><!-- --></A><H3> +Server</H3> +<PRE> +public <B>Server</B>()</PRE> +<DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="main(java.lang.String[])"><!-- --></A><H3> +main</H3> +<PRE> +public static void <B>main</B>(java.lang.String[] args)</PRE> +<DL> +<DD>The main method, which serves to create a server. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>args</CODE> - The argument vector.</DL> +</DD> +</DL> +<HR> + +<A NAME="doConnection(java.net.Socket)"><!-- --></A><H3> +doConnection</H3> +<PRE> +public void <B>doConnection</B>(java.net.Socket clientSocket) + throws java.io.IOException</PRE> +<DL> +<DD><DL> + +<DT><B>Throws:</B> +<DD><CODE>java.io.IOException</CODE></DL> +</DD> +</DL> +<HR> + +<A NAME="processBuffer(java.util.List, java.io.PrintWriter)"><!-- --></A><H3> +processBuffer</H3> +<PRE> +public void <B>processBuffer</B>(java.util.List<java.lang.String> buffer, + java.io.PrintWriter out)</PRE> +<DL> +<DD><DL> +</DL> +</DD> +</DL> +<HR> + +<A NAME="handleGet(java.util.List)"><!-- --></A><H3> +handleGet</H3> +<PRE> +public org.apache.http.HttpResponse <B>handleGet</B>(java.util.List<java.lang.String> buffer) + throws <A HREF="../../../../uk/org/ury/server/exceptions/HandlerNotFoundException.html" title="class in uk.org.ury.server.exceptions">HandlerNotFoundException</A>, + <A HREF="../../../../uk/org/ury/server/exceptions/HandlerSetupFailureException.html" title="class in uk.org.ury.server.exceptions">HandlerSetupFailureException</A>, + <A HREF="../../../../uk/org/ury/server/exceptions/HandleFailureException.html" title="class in uk.org.ury.server.exceptions">HandleFailureException</A>, + <A HREF="../../../../uk/org/ury/server/exceptions/BadRequestException.html" title="class in uk.org.ury.server.exceptions">BadRequestException</A>, + <A HREF="../../../../uk/org/ury/server/exceptions/NotAHandlerException.html" title="class in uk.org.ury.server.exceptions">NotAHandlerException</A></PRE> +<DL> +<DD>Handle a HTTP GET request. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The HTTP request as a list of strings. +<DT><B>Returns:</B><DD>The HTTP response. +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../../uk/org/ury/server/exceptions/HandlerNotFoundException.html" title="class in uk.org.ury.server.exceptions">HandlerNotFoundException</A></CODE> - if the client requested + a request handler that could not be found on the + class path. +<DD><CODE><A HREF="../../../../uk/org/ury/server/exceptions/HandlerSetupFailureException.html" title="class in uk.org.ury.server.exceptions">HandlerSetupFailureException</A></CODE> - if the handler was + found but could not be set up (eg does not + implement appropriate interface or cannot be + instantiated). +<DD><CODE><A HREF="../../../../uk/org/ury/server/exceptions/HandleFailureException.html" title="class in uk.org.ury.server.exceptions">HandleFailureException</A></CODE> - if an appropriate handler + was contacted, but it failed to process the + request. +<DD><CODE><A HREF="../../../../uk/org/ury/server/exceptions/BadRequestException.html" title="class in uk.org.ury.server.exceptions">BadRequestException</A></CODE> - if the request was malformed + or invalid. +<DD><CODE><A HREF="../../../../uk/org/ury/server/exceptions/NotAHandlerException.html" title="class in uk.org.ury.server.exceptions">NotAHandlerException</A></CODE> - if the class requested to + handle the request is not a handler.</DL> +</DD> +</DL> +<HR> + +<A NAME="parseQueryString(java.lang.String)"><!-- --></A><H3> +parseQueryString</H3> +<PRE> +public java.util.Map<java.lang.String,java.lang.String> <B>parseQueryString</B>(java.lang.String query) + throws java.io.UnsupportedEncodingException</PRE> +<DL> +<DD>Parse a query string, populating a key-value map of the + URL-unescaped results. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>query</CODE> - The query string to parse. +<DT><B>Returns:</B><DD>A map associating parameter keys and values. +<DT><B>Throws:</B> +<DD><CODE>java.io.UnsupportedEncodingException</CODE> - if the URL decoder + fails.</DL> +</DD> +</DL> +<HR> + +<A NAME="getDatabaseConnection(uk.org.ury.database.UserClass)"><!-- --></A><H3> +getDatabaseConnection</H3> +<PRE> +public <A HREF="../../../../uk/org/ury/database/DatabaseDriver.html" title="class in uk.org.ury.database">DatabaseDriver</A> <B>getDatabaseConnection</B>(<A HREF="../../../../uk/org/ury/database/UserClass.html" title="enum in uk.org.ury.database">UserClass</A> userClass) + throws <A HREF="../../../../uk/org/ury/database/exceptions/MissingCredentialsException.html" title="class in uk.org.ury.database.exceptions">MissingCredentialsException</A>, + <A HREF="../../../../uk/org/ury/database/exceptions/ConnectionFailureException.html" title="class in uk.org.ury.database.exceptions">ConnectionFailureException</A></PRE> +<DL> +<DD>Get a database connection using the given user class. +<P> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>userClass</CODE> - The user class to get a connection for. +<DT><B>Returns:</B><DD>a database connection, which may or may not + have been created on this call. +<DT><B>Throws:</B> +<DD><CODE><A HREF="../../../../uk/org/ury/database/exceptions/MissingCredentialsException.html" title="class in uk.org.ury.database.exceptions">MissingCredentialsException</A></CODE> - if the credentials + for the given userclass are missing. +<DD><CODE><A HREF="../../../../uk/org/ury/database/exceptions/ConnectionFailureException.html" title="class in uk.org.ury.database.exceptions">ConnectionFailureException</A></CODE> - if the connection + failed.</DL> +</DD> +</DL> +<HR> + +<A NAME="getVersion()"><!-- --></A><H3> +getVersion</H3> +<PRE> +public java.lang.String <B>getVersion</B>()</PRE> +<DL> +<DD><DL> + +<DT><B>Returns:</B><DD>the version string of the server.</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Server.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../../uk/org/ury/server/RequestHandler.html" title="interface in uk.org.ury.server"><B>PREV CLASS</B></A> + <A HREF="../../../../uk/org/ury/server/ServerProtocol.html" title="class in uk.org.ury.server"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../../index.html?uk/org/ury/server/Server.html" target="_top"><B>FRAMES</B></A> + <A HREF="Server.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> |