de.knipp.rritoolkit
Interface ResponseFactory

All Known Implementing Classes:
DefaultResponseFactory

public interface ResponseFactory

interface to a class that is capabable of creating a suitable subclass of DenicResponse for the given response. The returned objects are initialized (i.e. the fromXml or fromList methods called). This is the responsibility of the caller. Implementations of this interface must be thread-safe.

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Method Summary
 Response createResponse(org.w3c.dom.Document doc, Request request)
          create an instance based on the given XML document.
 Response createResponse(KVMultiList list, Request request)
          create an instance based on the given key-value pair list.
 

Method Detail

createResponse

Response createResponse(org.w3c.dom.Document doc,
                        Request request)
                        throws org.w3c.dom.DOMException,
                               ResponseParseException
create an instance based on the given XML document. Since the content of the list is not necessarily self-describing in respect to the type of response, the request can be supplied to ease the selection of the correct subclass.

Parameters:
doc - the document
request - the request, may be null
Returns:
the new instance
Throws:
org.w3c.dom.DOMException - on DOM exceptions
ResponseParseException - if the type could not be determined

createResponse

Response createResponse(KVMultiList list,
                        Request request)
                        throws ResponseParseException
create an instance based on the given key-value pair list. Since the content of the list is not necessarily self-describing in respect to the type of response, the request can be supplied to ease the selection of the correct subclass.

Parameters:
list - the list
request - the request, may be null
Returns:
the created response
Throws:
ResponseParseException - if the type could not be determined


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH