org.apache.cocoon.components.source.impl
Class SitemapSource

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.impl.SitemapSource
All Implemented Interfaces:
LogEnabled, Source, XMLizable

public final class SitemapSource
extends AbstractLogEnabled
implements Source, XMLizable

Implementation of a Source that gets its content by invoking a pipeline.

Version:
$Id: SitemapSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Nested Class Summary
static class SitemapSource.SitemapSourceValidity
          A simple SourceValidity protecting callers from resets.
 
Constructor Summary
SitemapSource(ComponentManager manager, String uri, Map parameters, Logger logger)
          Construct a new object
 
Method Summary
 boolean exists()
          Returns true always.
 long getContentLength()
          Get the content length of the source or -1 if it is not possible to determine the length.
 InputStream getInputStream()
          Return an InputStream object to read from the source.
 long getLastModified()
          Get the last modification date.
 String getMimeType()
          The mime-type of the content described by this object.
 String getParameter(String name)
          Get the value of a parameter.
 long getParameterAsLong(String name)
          Get the value of a parameter.
 Iterator getParameterNames()
          Get parameter names Using this it is possible to get custom information provided by the source implementation, like an expires date, HTTP headers etc.
 String getScheme()
          Return the protocol identifier.
 String getURI()
          Returns the unique identifer for this source
 SourceValidity getValidity()
          Get the validity object.
protected  void init()
          Initialize
 void recycle()
          Recyclable
 void refresh()
          Refresh this object and update the last modified date and content length.
 void toSAX(ContentHandler contentHandler)
          Stream content to the content handler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitemapSource

public SitemapSource(ComponentManager manager,
                     String uri,
                     Map parameters,
                     Logger logger)
              throws MalformedURLException
Construct a new object

Throws:
MalformedURLException
Method Detail

getScheme

public String getScheme()
Return the protocol identifier.

Specified by:
getScheme in interface Source

getContentLength

public long getContentLength()
Get the content length of the source or -1 if it is not possible to determine the length.

Specified by:
getContentLength in interface Source

getLastModified

public long getLastModified()
Get the last modification date.

Specified by:
getLastModified in interface Source
Returns:
The last modification in milliseconds since January 1, 1970 GMT or 0 if it is unknown

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  SourceException
Return an InputStream object to read from the source.

Specified by:
getInputStream in interface Source
Throws:
IOException
SourceException

getURI

public String getURI()
Returns the unique identifer for this source

Specified by:
getURI in interface Source

exists

public boolean exists()
Returns true always.

Specified by:
exists in interface Source
See Also:
Source.exists()

getValidity

public SourceValidity getValidity()
Get the validity object. This wraps validity of the enclosed event pipeline. If pipeline is not cacheable, null is returned.

Specified by:
getValidity in interface Source

getMimeType

public String getMimeType()
The mime-type of the content described by this object. If the source is not able to determine the mime-type by itself this can be null.

Specified by:
getMimeType in interface Source

refresh

public void refresh()
Refresh this object and update the last modified date and content length.

Specified by:
refresh in interface Source

init

protected void init()
Initialize


toSAX

public void toSAX(ContentHandler contentHandler)
           throws SAXException
Stream content to the content handler

Specified by:
toSAX in interface XMLizable
Throws:
SAXException

recycle

public void recycle()
Recyclable


getParameter

public String getParameter(String name)
Get the value of a parameter. Using this it is possible to get custom information provided by the source implementation, like an expires date, HTTP headers etc.


getParameterAsLong

public long getParameterAsLong(String name)
Get the value of a parameter. Using this it is possible to get custom information provided by the source implementation, like an expires date, HTTP headers etc.


getParameterNames

public Iterator getParameterNames()
Get parameter names Using this it is possible to get custom information provided by the source implementation, like an expires date, HTTP headers etc.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.