org.w3c.tidy.servlet.data
Class DefaultRepositoryFactory

java.lang.Object
  extended byorg.w3c.tidy.servlet.data.DefaultRepositoryFactory
All Implemented Interfaces:
RepositoryFactory
Direct Known Subclasses:
SessionRepositoryFactory

public class DefaultRepositoryFactory
extends java.lang.Object
implements RepositoryFactory

Default Factory implementation, Singleton.

Version:
$Revision: 1.4 $ ($Author: fgiust $)
Author:
Vlad Skarzhevskyy skarzhevskyy@gmail.com

Constructor Summary
DefaultRepositoryFactory()
           
 
Method Summary
 boolean allowURI(java.lang.String uri)
          Disable some pages validation or, save numbers for not important pages.
 ResponseRecord createRecord(java.lang.Object key, javax.servlet.http.HttpSession httpSession, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Create new validation results Response Record.
 long generateNewRequestID(javax.servlet.http.HttpSession httpSession)
          Implementation of sequence generator.
 ResponseRecordRepository getRepositoryInstance(javax.servlet.http.HttpSession httpSession)
          Get the Repository where to store validation results.
 java.lang.Object getResponseID(javax.servlet.http.HttpSession httpSession, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean newResponse)
          Get the ResponseID for given request. This bunction is called
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepositoryFactory

public DefaultRepositoryFactory()
Method Detail

getRepositoryInstance

public ResponseRecordRepository getRepositoryInstance(javax.servlet.http.HttpSession httpSession)
Get the Repository where to store validation results.

Specified by:
getRepositoryInstance in interface RepositoryFactory
Parameters:
httpSession - Session to bound to.
Returns:
Returns the repository instance for given Session, or null if nothing should be stored.

generateNewRequestID

public long generateNewRequestID(javax.servlet.http.HttpSession httpSession)
Implementation of sequence generator. Could be overdriven in descendant calss

Returns:
Returns the requst new ID when asked.

allowURI

public boolean allowURI(java.lang.String uri)
Disable some pages validation or, save numbers for not important pages. Could be overdriven in descendant calss

Returns:
Returns boolean

getResponseID

public java.lang.Object getResponseID(javax.servlet.http.HttpSession httpSession,
                                      javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      boolean newResponse)
Get the ResponseID for given request. This bunction is called

Specified by:
getResponseID in interface RepositoryFactory
Parameters:
httpSession - HttpSession that could store ID as attribute
request - HttpServletRequest that could store ID as attribute, could be null
response - HttpServletResponse that could store ID as attribute, could be null
newResponse - Create new ResponseID anyway
Returns:
Returns the Request/Response ID or null if it should be ignored by JTidy. Object should have proper toString() function.

createRecord

public ResponseRecord createRecord(java.lang.Object key,
                                   javax.servlet.http.HttpSession httpSession,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
Create new validation results Response Record.

Specified by:
createRecord in interface RepositoryFactory
Parameters:
request - HttpServletRequest
response - HttpServletResponse
Returns:
Returns new ResponseRecord or null if record for request should be ignored.


Copyright © 2004-2005 sourceforge. All Rights Reserved.