com.caplin.keymaster.servlet
Interface AdvancedResponseFormatter

All Superinterfaces:
ResponseFormatter
All Known Implementing Classes:
HTMLFormatter, JavaScriptFormatter, StreamLinkFormatter

public interface AdvancedResponseFormatter
extends ResponseFormatter

This interface allows a user to specify a UserCredentialsProvider class that can be used to supply user credentials.

Author:
David Shorten

Method Summary
 String formatResponse(javax.servlet.http.HttpServletRequest request, String token, UserCredentialsProvider provider)
           This is the main method for the interface.
 
Methods inherited from interface com.caplin.keymaster.servlet.ResponseFormatter
formatErrorResponse, formatResponse
 

Method Detail

formatResponse

String formatResponse(javax.servlet.http.HttpServletRequest request,
                      String token,
                      UserCredentialsProvider provider)

This is the main method for the interface. It is used to encode the token and return the processed response in the appropriate format. This method should try to return a token but if an error occurs then the formatErrorResponse method should be called to correctly encode the error before returning to the calling servlet.

Parameters:
request - This parameter should be used to retrieve any required information from the query string that was used to call the servlet. Any missing query strings should result in an error being returned (using the formatErrorResponse method).
token - The token that has been created for the request. Each token will be unique. The token should only be returned if there were no errors during processing the response.
provider - this class should be used to get the username taht will be used to log into Liberator. See UserCredentialsProvider.getUserName(HttpServletRequest) for more details.
Returns:
returns the response in the appropriate format or else may return a formatted error if there was a problem while trying to format the response.


Please send bug reports and comments to Caplin support