public class CommandRunnerService extends AbstractParamBuilderService
ParamBuilder
s, then execute the command
as specified by the command
property. The command output will be piped to the HTTP
response, with the content type as specified by the contentTypeParam
parameter.
The command can contain expressions; see ExpressionUtil
for more details. Usually this
service is configured using Spring with a bean definition like this:
<bean id="/someService" class="vodserver.service.StandardService">
<property name="paramBuilders">
<list>
<bean class="vodserver.parambuilder.StaticParamBuilder>
<property name="staticParams>
<map>
<entry key="someCommandParam" value="someParamValue"/>
</map>
</property>
</bean>
</list>
</property>
<property name="command" value="someCommand -a !!someCommandParam!! -b abc" />
</bean>
This example definition will execute 'someCommand -a someParamValue -b abc' whenever
http://vodeserver:port/someService is called.paramBuilders
LOG
Constructor and Description |
---|
CommandRunnerService() |
Modifier and Type | Method and Description |
---|---|
String |
getCommand()
Get the configured command (expressions will not yet have been evaluated).
|
String |
getContentTypeParam()
Get the configured content type parameter.
|
void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the service request.
|
void |
setCommand(String command)
Set the command to execute.
|
void |
setContentTypeParam(String contentTypeParam)
Set the content type parameter name, used to look up the parameter
containing the content type to use for the HTTP response.
|
String |
toString()
Provide a string representation of the configuration of this service.
|
appendParamBuilderInfo, buildParams, extraAfterPropertiesSet, extraExtraAfterPropertiesSet, getParamBuilders, setParamBuilders
afterPropertiesSet
getBeanName, setBeanName
public void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
ParamBuilder
s, evaluate
any expressions specified in the command
property, and then execute the command.IOException
javax.servlet.ServletException
public String getCommand()
public void setCommand(String command)
ExpressionUtil
,
which will be evaluated before the command is executed.command
- public String getContentTypeParam()
public void setContentTypeParam(String contentTypeParam)
contentTypeParam
- Copyright © 2013. All rights reserved.