| java.lang.Object es.udc.mypersonalizer.portal.controller.services.DefaultServiceController
DefaultServiceController | abstract public class DefaultServiceController implements ServiceController(Code) | | Default implementation of a Service Controller. It
gets from a
ServiceReplyCatcherConfig object the following
configuration parameters:
- defaultServiceTimeOut: The default time out for a service.
- containerURL The URL that identifies the container, to
avoid problems in certain NAT configurations.
The main objective of this class is to provide the reply of a service
by following these steps:
- Asks the abstract method getPersonalizedReplyRequest for an
object of class
PersonalizedReplyRequest suitable for calling
this service. The composition of this PersonalizedReplyRequest
object will be specific for the service being called, and will be
constructed by a subclass of this one.
- Calls the method getRealURL, which builds the URL which
will be used to call the service by examining the
PersonalizedReplyRequest object.
- Calls the
ServiceReplyCatcher .getReply method, passing as
parameters the URL to call and the timeout for the request, which
will be the one configured for this service (if it has been
specified) or the default time out (if it has not).
author: Daniel Fernandez author: Fernando Bellas since: 1.0 |
Constructor Summary | |
public | DefaultServiceController() Creates a new instance of DefaultServiceController and
loads the configuration data. |
Method Summary | |
public String | getPersonalizedReply(HttpServletRequest request, HttpServletResponse response, ServicePropertyKey servicePropertyKey, ServiceProperty serviceProperty, ServiceButtonsState buttons) Returns the service reply by asking for a
PersonalizedReplyRequest, building the URL by calling
getRealURL and then asking the ServiceReplyCatcher.
Parameters: request - the request object. Parameters: response - the response object. Parameters: servicePropertyKey - the service property key. Parameters: serviceProperty - the service property. Parameters: buttons - the service buttons state. throws: InternalErrorException - if any fatal errors happen. throws: ServiceNotAvailableException - if the service is not available. throws: ServiceTimeOutException - if the service exceeds the established timeout. | abstract protected PersonalizedReplyRequest | getPersonalizedReplyRequest(HttpServletRequest request, HttpServletResponse response, ServicePropertyKey servicePropertyKey, ServiceProperty serviceProperty, ServiceButtonsState buttons) This method builds a
PersonalizedReplyRequest object in a
way which is specific to the service being dealt with.
Parameters: request - the request object. Parameters: response - the response object. Parameters: servicePropertyKey - the service property key. Parameters: serviceProperty - the service property. Parameters: buttons - the service buttons state. throws: InternalErrorException - if any fatal errors happen. | protected URL | getRealURL(HttpServletRequest request, PersonalizedReplyRequest personalizedReplyRequest) Returns the real URL that will be used to call the service, based on
the information in the request and the PersonalizedReplyRequest
object received.
Parameters with an empty array of values (length 0) are discarded, since
it is not possible to pass them appropriately when making an URL
invocation.
Parameters: request - the request object. Parameters: personalizedReplyRequest - the PersonalizedReplyRequest object. throws: InternalErrorException - if any fatal errors happen. |
DefaultServiceController | public DefaultServiceController()(Code) | | Creates a new instance of DefaultServiceController and
loads the configuration data.
|
getRealURL | protected URL getRealURL(HttpServletRequest request, PersonalizedReplyRequest personalizedReplyRequest) throws InternalErrorException(Code) | | Returns the real URL that will be used to call the service, based on
the information in the request and the PersonalizedReplyRequest
object received.
Parameters with an empty array of values (length 0) are discarded, since
it is not possible to pass them appropriately when making an URL
invocation.
Parameters: request - the request object. Parameters: personalizedReplyRequest - the PersonalizedReplyRequest object. throws: InternalErrorException - if any fatal errors happen. the URL to call the service. |
|
|