m.c.m.proxyma.core
Class ProxyInternalResponsesFactory

java.lang.Object
  extended by m.c.m.proxyma.core.ProxyInternalResponsesFactory

public class ProxyInternalResponsesFactory
extends java.lang.Object

This Class its a factory of standard responses.
It's used by the ProxyEngine to build internal responses as error pages, redirects and the page that shows the registered proxy folders.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxyInternalResponsesFactory.java 179 2010-07-03 11:49:04Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com];

Constructor Summary
ProxyInternalResponsesFactory()
           
 
Method Summary
static ProxymaResponseDataBean createErrorResponse(int errorCode, ProxymaContext context)
          Generates an error page response.
protected static ProxymaResponseDataBean createFoldersListResponse(ProxymaContext context)
          Generates a new response page with the list of the configured folders.
static ProxymaResponseDataBean createRedirectResponse(java.lang.String destination, ProxymaContext context)
          Generates a listPage response to the specified destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyInternalResponsesFactory

public ProxyInternalResponsesFactory()
Method Detail

createRedirectResponse

public static ProxymaResponseDataBean createRedirectResponse(java.lang.String destination,
                                                             ProxymaContext context)
                                                      throws java.net.MalformedURLException
Generates a listPage response to the specified destination.

Parameters:
destination - the complete URL of the destination
Returns:
a new response data bean ready to be sent to the client
Throws:
java.net.MalformedURLException

createErrorResponse

public static ProxymaResponseDataBean createErrorResponse(int errorCode,
                                                          ProxymaContext context)
Generates an error page response.

Parameters:
the - error status to report
Returns:
a new response data bean ready to be sent to the client

createFoldersListResponse

protected static ProxymaResponseDataBean createFoldersListResponse(ProxymaContext context)
Generates a new response page with the list of the configured folders.
The fields of the list are: folderName, Destination, folderStatus.
Note: this methos is made to be invoked only by the proxy engine.

Parameters:
contezt - the context that contains the registered folders to show.
Returns:
a new response data bean ready to be sent to the client


Copyright © 2010. All Rights Reserved.