org.exist.http
Class Descriptor

java.lang.Object
  extended byorg.exist.http.Descriptor
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class Descriptor
extends java.lang.Object
implements org.xml.sax.ErrorHandler

Webapplication Descriptor Class representation of an XQuery Web Application Descriptor file with some helper functions for performing Descriptor related actions Uses the Singleton design pattern.

Version:
1.71
Author:
Adam Retter

Method Summary
 boolean allowRequestLogging()
          Determines whether it is permissible to Log Requests Enabled by descriptor.xml
 boolean allowSourceXQuery(java.lang.String path)
          Determines whether it is permissible to show the source of an XQuery.
 java.lang.Object clone()
          Thows a CloneNotSupportedException as this class uses a Singleton design pattern
 void doLogRequestInReplayLog(javax.servlet.http.HttpServletRequest request)
          Logs HTTP Request's in a log file suitable for replaying to eXist later Takes a HttpServletRequest or a HttpServletRequestWrapper as an argument for logging.
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
static Descriptor getDescriptorSingleton()
          Returns a refernce to this (Descriptor) Singleton class
 java.lang.String mapPath(java.lang.String path)
          Map's one XQuery or Collection path to another Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching map path then it returns the map view else it returns the passed in path
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDescriptorSingleton

public static Descriptor getDescriptorSingleton()
Returns a refernce to this (Descriptor) Singleton class

Returns:
The Descriptor object reference

allowSourceXQuery

public boolean allowSourceXQuery(java.lang.String path)
Determines whether it is permissible to show the source of an XQuery. Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching allowsourcexquery path in the descriptor then it returns true else it returns false

Parameters:
path - The path of the XQuery (e.g. /db/MyCollection/query.xql)
Returns:
The boolean value true or false indicating whether it is permissible to show the source

mapPath

public java.lang.String mapPath(java.lang.String path)
Map's one XQuery or Collection path to another Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching map path then it returns the map view else it returns the passed in path

Parameters:
path - The path of the XQuery or Collection (e.g. /db/MyCollection/query.xql or /db/MyCollection) to map from
Returns:
The path of the XQuery or Collection (e.g. /db/MyCollection/query.xql or /db/MyCollection) to map to

allowRequestLogging

public boolean allowRequestLogging()
Determines whether it is permissible to Log Requests Enabled by descriptor.xml

Returns:
The boolean value true or false indicating whether it is permissible to Log Requests

doLogRequestInReplayLog

public void doLogRequestInReplayLog(javax.servlet.http.HttpServletRequest request)
Logs HTTP Request's in a log file suitable for replaying to eXist later Takes a HttpServletRequest or a HttpServletRequestWrapper as an argument for logging. Enabled by descriptor.xml

Parameters:
request - The HttpServletRequest to log. For Simple HTTP POST Requests - EXistServlet/XQueryServlet - POST parameters (e.g. form data) will only be logged if a HttpServletRequestWrapper is used instead of HttpServletRequest! POST Uploaded files are not yet supported! For XML-RPC Requests - RpcServlet - HttpServletRequestWrapper must be used, otherwise the content of the Request will be lost! For Cocoon Requests -

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Thows a CloneNotSupportedException as this class uses a Singleton design pattern

Returns:
Will never return anything!
Throws:
java.lang.CloneNotSupportedException

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)


Copyright (C) Wolfgang Meier. All rights reserved.