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

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.source.impl.SitemapSource
All Implemented Interfaces:
Source, XMLizable

public final class SitemapSource
extends org.apache.cocoon.util.AbstractLogEnabled
implements Source, XMLizable

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

Version:
$Id: SitemapSource.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
static class SitemapSource.SitemapSourceValidity
          A simple SourceValidity protecting callers from resets.
 
Constructor Summary
SitemapSource(ServiceManager manager, String uri, Map parameters)
          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 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.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitemapSource

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

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
Return an InputStream object to read from the source.

Specified by:
getInputStream in interface Source
Throws:
IOException

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



Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.