Package com.adaptris.interlok.jdbc
Class JDBCDataQueryStatementBuilderService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.jdbc.JdbcService
-
- com.adaptris.interlok.jdbc.JDBCStatementBuilderService
-
- com.adaptris.interlok.jdbc.JDBCDataQueryStatementBuilderService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="JDBC data query statement builder service", tag="jdbc,query,build,statement", since="4.1.0") public class JDBCDataQueryStatementBuilderService extends JDBCStatementBuilderService
JDBC data query statement builder service. Build a JDBC data query service using the given statement to create the necessary parameter list. Turn:INSERT INTO hits (reference, message_id, id, entity_id, blocking) VALUES (%sql_metadata{string:reference, %sql_metadata{string:%uniqueId}, %sql_metadata{string:id}, %sql_metadata{string:entity_id}, %sql_metadata{string:blocking});
into:<jdbc-string-statement-parameter> <query-string>reference</query-string> <query-type>metadata</query-type> </jdbc-string-statement-parameter> <jdbc-string-statement-parameter> <query-string>message_id</query-string> <query-type>id</query-type> </jdbc-string-statement-parameter> <jdbc-string-statement-parameter> <query-string>id>/query-string> <query-type>metadata</query-type> </jdbc-string-statement-parameter> <jdbc-string-statement-parameter> <query-string>entity_id</query-string> <query-type>metadata</query-type> </jdbc-string-statement-parameter> <jdbc-string-statement-parameter> <query-string>blocking</query-string> <query-type>metadata</query-type> </jdbc-string-statement-parameter> <statement>INSERT INTO hits (reference, message_id, id, entity_id, blocking) VALUES (?, ?, ? ,? ,?);</statement>
.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description JDBCDataQueryStatementBuilderService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeJdbcService()
Close the service.protected JdbcServiceWithParameters
createService(java.lang.String statement)
void
doService(AdaptrisMessage message)
Apply the service to the message.ResultSetTranslator
getResultSetTranslator()
protected void
initJdbcService()
void
setResultSetTranslator(ResultSetTranslator resultSetTranslator)
protected void
startService()
Start the service.protected void
stopService()
Stop the service.-
Methods inherited from class com.adaptris.interlok.jdbc.JDBCStatementBuilderService
buildService, getStatement, prepareService, setStatement
-
Methods inherited from class com.adaptris.core.jdbc.JdbcService
applyTimeout, closeService, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setConnection, setStatementTimeout, start, stop
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
createService
protected JdbcServiceWithParameters createService(java.lang.String statement)
- Specified by:
createService
in classJDBCStatementBuilderService
-
initJdbcService
protected void initJdbcService() throws CoreException
- Specified by:
initJdbcService
in classJdbcService
- Throws:
CoreException
-
closeJdbcService
protected void closeJdbcService()
Close the service.This is called before the connection is closed
- Specified by:
closeJdbcService
in classJdbcService
-
startService
protected void startService() throws CoreException
Start the service.This is called after the connection is started
- Specified by:
startService
in classJdbcService
- Throws:
CoreException
-
stopService
protected void stopService()
Stop the service.This is called after before the connection is stopped
- Specified by:
stopService
in classJdbcService
-
doService
public void doService(AdaptrisMessage message) throws ServiceException
Apply the service to the message.- Parameters:
message
- theAdaptrisMessage
to process.- Throws:
ServiceException
- wrapping any underlyingException
.
-
getResultSetTranslator
public ResultSetTranslator getResultSetTranslator()
-
setResultSetTranslator
public void setResultSetTranslator(ResultSetTranslator resultSetTranslator)
-
-