edu.wisc.my.webproxy.beans.filtering
Class BaseUrlFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by edu.wisc.my.webproxy.beans.filtering.ChainingSaxFilter
          extended by edu.wisc.my.webproxy.beans.filtering.BaseUrlFilter
All Implemented Interfaces:
ProxyComponent, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader
Direct Known Subclasses:
AbsoluteUrlFilter, InclExclUrlFilter

public abstract class BaseUrlFilter
extends ChainingSaxFilter

The base URL filter is an abstract filter that locates URLs in the proxied content and call an abstract method to re-write the URL.

Version:
$Id: BaseUrlFilter.java 21818 2010-09-29 19:43:17Z edalquist $
Author:
dgrimwood

Constructor Summary
BaseUrlFilter()
          The default constructor
BaseUrlFilter(XMLReader parent)
          Constructor that takes XMLReader object as argument
 
Method Summary
 void characters(char[] ch, int start, int len)
           
 void clearData()
          Called at the end of a request that the component was used in.
 void endElement(String uri, String localName, String qName)
           
protected  Map<String,Set<String>> makeCaseInsensitive(Map<String,Set<String>> elements)
           
abstract  String rewriteUrl(String sTempAtt, boolean passThrough)
          Abstract method for re-writng a given url
 void setElements(Map<String,Set<String>> elements)
           
 void setPassThroughElements(Map<String,Set<String>> passThroughElements)
           
 void startElement(String uri, String localName, String qName, Attributes atts)
          Filter the Namespace URI for start-element events.
 
Methods inherited from class edu.wisc.my.webproxy.beans.filtering.ChainingSaxFilter
comment, endCDATA, endDTD, endEntity, getLexicalHandler, parse, parse, setActionData, setLexicalHandler, setParent, setRenderData, startCDATA, startDTD, startEntity
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.wisc.my.webproxy.beans.config.ProxyComponent
getName
 

Constructor Detail

BaseUrlFilter

public BaseUrlFilter(XMLReader parent)
Constructor that takes XMLReader object as argument

Parameters:
parent - the (@link XMLReader) object

BaseUrlFilter

public BaseUrlFilter()
The default constructor

Method Detail

setElements

public void setElements(Map<String,Set<String>> elements)

setPassThroughElements

public void setPassThroughElements(Map<String,Set<String>> passThroughElements)

makeCaseInsensitive

protected Map<String,Set<String>> makeCaseInsensitive(Map<String,Set<String>> elements)

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Filter the Namespace URI for start-element events.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class XMLFilterImpl
Parameters:
uri - the uri as a String
localName - the local name as a String
qName - the query name as a String
Throws:
SAXException

rewriteUrl

public abstract String rewriteUrl(String sTempAtt,
                                  boolean passThrough)
Abstract method for re-writng a given url

Parameters:
sTempAtt - the url as a String before it is re-written to some other url
Returns:
sTempAtt the url as a String after it is re-written to some other url

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class XMLFilterImpl
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class ChainingSaxFilter
Throws:
SAXException
See Also:
XMLFilterImpl.characters(char[], int, int)

clearData

public void clearData()
Description copied from interface: ProxyComponent
Called at the end of a request that the component was used in. It clears the references to the request and response objects. It should be called from a finally block to ensure its execution.

Specified by:
clearData in interface ProxyComponent
Overrides:
clearData in class ChainingSaxFilter


Copyright © 2010 Jasig. All Rights Reserved.