magoffin.matt.ma2
Interface MediaHandlerDelegate

All Known Implementing Classes:
JpegMediaHandler, JpegMediaHandler, MimeTypeMediaHandlerDelegate, PngMediaHandler, PngMediaHandler

public interface MediaHandlerDelegate

API for delegate media requests.

This API is for chaining one media request to another, eg. for processing embedded media within one media type. For example an MP3 handler might want to delegate to a JPEG handler for an embedded album cover image.

This allows a normal MediaHandler implementation to also serve as a delegate for another implementation. Thus a single JPEG implementation of MediaHandler might also implement this API so it can be used as a delegate, and the JPEG processing code can be implemented once and shared by both request processing functions.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Method Summary
 java.lang.String getDelegateFileExtension(org.springframework.core.io.Resource mediaResource, java.lang.String mimeType, MediaItem item, MediaRequest request)
          Get the preferred file extension for this handler.
 void handleDelegateMediaRequest(org.springframework.core.io.Resource mediaResource, java.lang.String mimeType, MediaItem item, MediaRequest request, MediaResponse response)
          Handle a delegate media request.
 

Method Detail

handleDelegateMediaRequest

void handleDelegateMediaRequest(org.springframework.core.io.Resource mediaResource,
                                java.lang.String mimeType,
                                MediaItem item,
                                MediaRequest request,
                                MediaResponse response)
Handle a delegate media request.

The mediaResource is not the original MediaItem resource, rather it is the media resource extracted from the MediaItem, e.g. the metadata resource.

Parameters:
mediaResource - the media data to process
mimeType - the MIME type of the media data in mediaResource
item - the MediaItem being processed
request - the request
response - the response

getDelegateFileExtension

java.lang.String getDelegateFileExtension(org.springframework.core.io.Resource mediaResource,
                                          java.lang.String mimeType,
                                          MediaItem item,
                                          MediaRequest request)
Get the preferred file extension for this handler.

The mediaResource is not the original MediaItem resource, rather it is the media resource extracted from the MediaItem, e.g. the metadata resource.

Some handlers might return a different file extension for a given request then the default file extension for their type (for example a PNG image handler that returns JPEG images when resizing the images.

Parameters:
mediaResource - the media data to process
mimeType - the MIME type of the media data in mediaResource
item - the MediaItem being processed
request - the request
Returns:
a file extension, without the period