Package org.pentaho.di.www
Class ExecuteTransServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.pentaho.di.www.BaseHttpServlet
-
- org.pentaho.di.www.ExecuteTransServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,CartePluginInterface
,CarteServletInterface
public class ExecuteTransServlet extends BaseHttpServlet implements CartePluginInterface
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTEXT_PATH
-
Fields inherited from class org.pentaho.di.www.BaseHttpServlet
detections, jobMap, log, socketRepository, transformationMap
-
-
Constructor Summary
Constructors Constructor Description ExecuteTransServlet()
ExecuteTransServlet(TransformationMap transformationMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
executeTrans(Trans trans)
String
getContextPath()
String
getService()
String
toString()
-
Methods inherited from class org.pentaho.di.www.BaseHttpServlet
convertContextPath, doDelete, doPost, doPut, getDetections, getJobMap, getSocketRepository, getTransformationMap, isJettyMode, logBasic, logBasic, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logRowlevel, setJettyMode, setup
-
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, service, service
-
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pentaho.di.www.CartePluginInterface
isJettyMode, setJettyMode, setup
-
-
-
-
Field Detail
-
CONTEXT_PATH
public static final String CONTEXT_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExecuteTransServlet
public ExecuteTransServlet()
-
ExecuteTransServlet
public ExecuteTransServlet(TransformationMap transformationMap)
-
-
Method Detail
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
/kettle/executeTrans
GET
Executes transformation from the specified repository. Connects to the repository provided as a parameter, loads the transformation from it and executes it. Empty response is returned or response contains output of an error happened during the transformation execution. Response contains
ERROR
result if error happened during transformation execution.Example Request:
GET /kettle/executeTrans/?rep=my_repository&user=my_user&pass=my_password&trans=my_trans&level=INFO
Parameters
name description type rep Repository id to connect to. query user User name to be used to connect to repository. query pass User password to be used to connect to repository. query trans Transfromation name to be loaded and executed. query level Logging level to be used for transformation execution (i.e. Debug). query *any name* All the other parameters will be sent to the transformation for using as variables. When necessary you can add custom parameters to the request. They will be used to set the transformation variables values.. query Response Body
element: (custom) media types: application/xml Response contains error output of the transformation executed or nothing if the execution was successful.
Example Error Response:
ERROR Unexpected error executing the transformation: org.pentaho.di.core.exception.KettleException: Unable to find transformation 'dummy-trans.ktr' in directory :/home/admin at org.pentaho.di.www.ExecuteTransServlet.loadTransformation(ExecuteTransServlet.java:214) at org.pentaho.di.www.ExecuteTransServlet.doGet(ExecuteTransServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:915) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Status Codes
code description 200 Request was processed. 400 When missing mandatory param trans 401 When authentication to repository fails 404 When transformation is not found 500 Internal server error occurs during request processing. - Specified by:
doGet
in interfaceCartePluginInterface
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
getService
public String getService()
- Specified by:
getService
in interfaceCarteServletInterface
-
executeTrans
protected void executeTrans(Trans trans) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
getContextPath
public String getContextPath()
- Specified by:
getContextPath
in interfaceCartePluginInterface
-
-