|
|||||||||
| Home >> All >> com >> clra >> [ web overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.clra.web
Class MembershipServlet

java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.clra.web.MembershipServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class MembershipServlet
- extends javax.servlet.http.HttpServlet
Converts a soap response to CSV or beautified XML message. The only valid request parameters are:
format. Specifies what action to perform.
The only valid values for this parameter are:CSV
Converts a SOAP message to comma-separarted-value format.XML
Converts a SOAP message to a simplified XML format.
If the
formatparameter is omitted, the output format defaults to beautified XML.- Version:
- $Revision: 1.2 $
Nested Class Summary static classMembershipServlet.MembershipSoapException
An implementation-specific exception that indicates a SOAP problemField Summary private static java.lang.Stringbase
private static intBUFSIZE
Default buffer sizeprivate static java.lang.StringcsvStylesheet
The csv stylesheetstatic java.lang.StringFILE_CSV_STYLESHEET
The file that holds the CVS stylesheetstatic java.lang.StringFILE_FINDALL_CONTENT
The file that holds the pre-built SOAP "findAll" request contentstatic java.lang.StringFILE_FINDALL_HEADERS
The file that holds the pre-built SOAP "findAll" request headersstatic java.lang.StringFILE_XML_STYLESHEET
The file that holds the simplified-XML stylesheetprivate static java.lang.StringrequestContent
The pre-built "findAll" request messageprivate static java.lang.StringrequestHeaders
The pre-built "findAll" request headersstatic java.lang.StringRPN_FORMAT
The name of the "format" request parameterstatic java.lang.StringRPV_FORMAT_CSV
The "CSV" value for the "format" request parameterstatic java.lang.StringRPV_FORMAT_XML
The "XML" value for the "format" request parameterprivate static org.apache.log4j.CategorytheLog
private static inttimeoutMillis
Socket timeout (milliseconds)private static java.lang.StringxmlStylesheet
The simplified-XML stylesheetFields inherited from class javax.servlet.http.HttpServlet Fields inherited from class javax.servlet.GenericServlet Constructor Summary MembershipServlet()
Method Summary voiddestroy()
Destroys the servletprotected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Delegates to theprocessRequestmethodprotected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Delegates to theprocessRequestmethodprivate static booleanfoundCRNL_CRNL(char[] buf)
private static java.net.SocketgetFindAllResponseSocket(java.lang.String username, java.lang.String password)
java.lang.StringgetServletInfo()
Returns a short description of the servlet.voidinit(javax.servlet.ServletConfig config)
Initializes the servletprivate static java.lang.StringloadStringFromFile(java.lang.String strFile)
private static java.lang.StringloadStringFromInputStream(java.io.InputStream is)
protected voidprocessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Processes requests for both HTTPGETandPOSTmethods.private static voidreadUntilEndOfHttpHeaders(java.io.InputStream is)
static voidwriteFindAllCsvResponse(java.lang.String username, java.lang.String password, java.io.PrintWriter out)
Writes the CSV-formatted response forMember.findAllMembersto the specified PrintWriter.static voidwriteFindAllSimplifiedXmlResponse(java.lang.String name, java.lang.String pass, java.io.PrintWriter out)
Returns a simplified XML-formatted response forMember.findAllMembers.static voidwriteFindAllSoapXmlResponse(java.lang.String username, java.lang.String password, java.io.PrintWriter out)
Writes the entire SOAP response forMember.findAllMembersto the specified PrintWriter.private static voidwriteFromInputStreamToWriter(java.io.InputStream is, java.io.Writer out)
private static voidwriteResponse(java.lang.String username, java.lang.String password, java.lang.String xsl, java.io.PrintWriter out)
Methods inherited from class javax.servlet.http.HttpServlet doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceMethods inherited from class javax.servlet.GenericServlet getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, logMethods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitField Detail base
private static final java.lang.String base
theLog
private static final org.apache.log4j.Category theLog
timeoutMillis
private static final int timeoutMillis
- Socket timeout (milliseconds)
- See Also:
- Constant Field Values
BUFSIZE
private static final int BUFSIZE
- Default buffer size
- See Also:
- Constant Field Values
RPN_FORMAT
public static final java.lang.String RPN_FORMAT
- The name of the "format" request parameter
- See Also:
- Constant Field Values
RPV_FORMAT_CSV
public static final java.lang.String RPV_FORMAT_CSV
- The "CSV" value for the "format" request parameter
- See Also:
- Constant Field Values
RPV_FORMAT_XML
public static final java.lang.String RPV_FORMAT_XML
- The "XML" value for the "format" request parameter
- See Also:
- Constant Field Values
FILE_FINDALL_HEADERS
public static final java.lang.String FILE_FINDALL_HEADERS
- The file that holds the pre-built SOAP "findAll" request headers
- See Also:
- Constant Field Values
FILE_FINDALL_CONTENT
public static final java.lang.String FILE_FINDALL_CONTENT
- The file that holds the pre-built SOAP "findAll" request content
- See Also:
- Constant Field Values
FILE_CSV_STYLESHEET
public static final java.lang.String FILE_CSV_STYLESHEET
- The file that holds the CVS stylesheet
- See Also:
- Constant Field Values
FILE_XML_STYLESHEET
public static final java.lang.String FILE_XML_STYLESHEET
- The file that holds the simplified-XML stylesheet
- See Also:
- Constant Field Values
requestHeaders
private static final java.lang.String requestHeaders
- The pre-built "findAll" request headers
requestContent
private static final java.lang.String requestContent
- The pre-built "findAll" request message
csvStylesheet
private static final java.lang.String csvStylesheet
- The csv stylesheet
xmlStylesheet
private static final java.lang.String xmlStylesheet
- The simplified-XML stylesheet
Constructor Detail MembershipServlet
public MembershipServlet()
Method Detail loadStringFromFile
private static java.lang.String loadStringFromFile(java.lang.String strFile)
loadStringFromInputStream
private static java.lang.String loadStringFromInputStream(java.io.InputStream is) throws java.io.IOException
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
- Initializes the servlet
destroy
public void destroy()
- Destroys the servlet
getFindAllResponseSocket
private static java.net.Socket getFindAllResponseSocket(java.lang.String username, java.lang.String password) throws java.io.IOException, java.net.MalformedURLException, java.net.SocketException, java.net.UnknownHostException, javax.ejb.NoSuchEntityException
foundCRNL_CRNL
private static boolean foundCRNL_CRNL(char[] buf)
readUntilEndOfHttpHeaders
private static void readUntilEndOfHttpHeaders(java.io.InputStream is) throws java.io.IOException, MembershipServlet.MembershipSoapException
processRequest
protected void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
- Processes requests for both HTTP
GETandPOSTmethods. The current implementation uses a pre-built SOAP message stored in the text file specified byFINDALL-REQUESTto retrieve a SOAP message, and then uses XSL stylesheets to to simplify the SOAP XML.
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
- Delegates to the
processRequestmethod
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
- Delegates to the
processRequestmethod
getServletInfo
public java.lang.String getServletInfo()
- Returns a short description of the servlet.
writeFindAllSoapXmlResponse
public static void writeFindAllSoapXmlResponse(java.lang.String username, java.lang.String password, java.io.PrintWriter out) throws java.lang.Exception
- Writes the entire SOAP response for
Member.findAllMembersto the specified PrintWriter. Used for JUnit testing.
writeFindAllCsvResponse
public static void writeFindAllCsvResponse(java.lang.String username, java.lang.String password, java.io.PrintWriter out) throws java.lang.Exception
- Writes the CSV-formatted response for
Member.findAllMembersto the specified PrintWriter. Used for JUnit testing.
writeFindAllSimplifiedXmlResponse
public static void writeFindAllSimplifiedXmlResponse(java.lang.String name, java.lang.String pass, java.io.PrintWriter out) throws java.lang.Exception
- Returns a simplified XML-formatted response for
Member.findAllMembers. Used for JUnit testing.
writeResponse
private static void writeResponse(java.lang.String username, java.lang.String password, java.lang.String xsl, java.io.PrintWriter out) throws javax.xml.transform.TransformerConfigurationException, javax.xml.transform.TransformerException, java.io.IOException, MembershipServlet.MembershipSoapException
writeFromInputStreamToWriter
private static void writeFromInputStreamToWriter(java.io.InputStream is, java.io.Writer out) throws java.io.IOException
Overview Package Class Use Deprecated Index Home >> All >> com >> clra >> [ web overview ] PREV CLASS NEXT CLASS SUMMARY:
JAVADOC |
SOURCE |
DOWNLOAD | NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
