public class MappingForwardingService extends AbstractService
setIdParam(String)
and setMapping(Map)
methods respectively. Usually this service is
configured using Spring with a bean definition like this:
<bean id="/serviceName" class="vodserver.service.ForwardingService">
<property name="idParam" value="someReqParamName" />
<property name="mapping">
<map>
<entry key="mapping1" value="/otherService1?prm1=abc" />
<entry key="mapping2" value="/otherService2?prmA=xyz" />
</map>
</property>
</bean>
This defines a service that can be called as http://vodserver:port/serviceName?someReqParamName=mapping1,
which will forward to /otherService1?prm1=abc.LOG
Constructor and Description |
---|
MappingForwardingService() |
Modifier and Type | Method and Description |
---|---|
String |
getIdParam()
Get the request parameter name
|
Map<String,String> |
getMapping()
Get the current mapping
|
void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the service request.
|
void |
setIdParam(String idParam)
Set the request parameter name
|
void |
setMapping(Map<String,String> mapping)
Set the mapping
|
String |
toString()
Provide a string representation of the configuration of this service.
|
afterPropertiesSet, extraAfterPropertiesSet
getBeanName, setBeanName
public void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
idParam
, map this value to a forward URL using the configured mapping
,
and then forward to this URL.IOException
javax.servlet.ServletException
public String getIdParam()
public void setIdParam(String idParam)
idParam
- Copyright © 2013. All rights reserved.