public interface ResourceHandler
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRIORITY
Maximum priority.
|
static int |
MIN_PRIORITY
Minimum priority.
|
Modifier and Type | Method and Description |
---|---|
void |
generateResource(Source source,
OutputStream out,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Generate the resource configured during setup, and output it
|
Serializable |
getKey(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the unique key for this resource, for cache purpose.
|
long |
getLastModified(Source source,
Parameters parameters)
Get the resource last modified time
|
String |
getMimeType(Source source,
Parameters parameters)
Return the mime type of the configured resource.
|
int |
getPriority()
Get the priority of this handler
|
long |
getSize(Source source,
Parameters parameters)
Get the resource size, if available.
|
SourceValidity |
getValidity(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the resource validity, for cache purpose.
|
boolean |
isSupported(String src)
Determines if the resource is supported by this handler
|
Source |
setup(String source,
Map objectModel,
Parameters par,
Map<String,Object> additionalParameters)
Initialize the resource handler with a resource.
|
static final int MIN_PRIORITY
static final int MAX_PRIORITY
Source setup(String source, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws IOException, ProcessingException
source
- The source uriobjectModel
- The object modelpar
- The parametersadditionalParameters
- Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResourceIOException
- If an error occursProcessingException
- If an error occursvoid generateResource(Source source, OutputStream out, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters) throws IOException, ProcessingException
source
- The sourceout
- The output stream to write toobjectModel
- The object modelparameters
- The sitemap parametersadditionalParameters
- Additional parametersIOException
- If an error occursProcessingException
- If an error occursboolean isSupported(String src)
src
- The uri of resourcetrue
if the resource is supportedint getPriority()
String getMimeType(Source source, Parameters parameters)
source
- The sourceparameters
- The parametersSerializable getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parametersSourceValidity getValidity(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parameterslong getSize(Source source, Parameters parameters)
source
- The sourceparameters
- The parameterslong getLastModified(Source source, Parameters parameters)
source
- The sourceparameters
- The parameters