Package org.frankframework.jdbc
Class JdbcTableListener<M>
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.JdbcListener<M>
org.frankframework.jdbc.JdbcTableListener<M>
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,IHasProcessState<M>
,IListener<M>
,INamedObject
,IPeekableListener<M>
,IProvidesMessageBrowsers<M>
,IPullingListener<M>
,IScopeProvider
,IXAEnabled
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
MessageStoreListener
Database Listener that operates on a table having at least a key and a status field.
- Since:
- 4.7
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.jdbc.JdbcListener
JdbcListener.MessageFieldType
-
Field Summary
Fields inherited from class org.frankframework.jdbc.JdbcListener
connection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected RawMessageWrapper<M>
changeProcessState
(Connection connection, RawMessageWrapper<M> rawMessage, ProcessState toState, String reason) void
configure()
is called once at startup of the framework in theconfigure()
method of the owner of this listener.protected String
createUpdateStatusQuery
(String fieldValue, String additionalSetClause) int
getMessageBrowser
(ProcessState state) returns abrowser
of messages that are in ProcessState 'state', and are stored in a storage managed by the listener itself (as opposed to a storage configured as a messageLog or errorStorage in the configuration).Returns the name and location of the database that this objects operates on.getStatusValue
(ProcessState state) getStorageType
(ProcessState state) void
setCommentField
(String commentField) (optional) Field used to store the reason of the last change of thestatusField
void
setMaxCommentLength
(int maxCommentLength) (optional) Maximum length of strings to be stored in commentField, or -1 for unlimitedvoid
setOrderField
(String string) (optional) Comma separated list of fields determining the order in which messages are processedvoid
setSelectCondition
(String string) Additional condition for a row to belong to this TableListener.void
setStatusField
(String fieldname) Field containing the status of the message.void
setStatusValueAvailable
(String string) (optional) Value ofstatusField
indicating row is available to be processed.void
setStatusValueError
(String string) Value ofstatusField
indicating the processing of the row resulted in an errorvoid
setStatusValueHold
(String string) Value ofstatusField
indicating message is on Hold, temporarilyvoid
setStatusValueInProcess
(String string) Value ofstatusField
indicating is being processed.void
setStatusValueProcessed
(String string) Value of status field indicating row is processed OKvoid
setTableAlias
(String string) Alias of the table, that can be used in selectConditionvoid
setTableName
(String string) Name of the table to be usedvoid
setTimestampField
(String fieldname) (optional) Field used to store the date and time of the last change of thestatusField
protected void
verifyFieldNotInQuery
(String fieldName, String query) Methods inherited from class org.frankframework.jdbc.JdbcListener
afterMessageProcessed, changeProcessState, closeThread, convertQuery, execute, extractMessage, extractRawMessage, getBlobCharset, getCorrelationIdField, getKeyField, getKeyFromRawMessage, getMessageField, getMessageFieldType, getMessageIdField, getPeekQuery, getRawMessage, getRawMessage, getSelectQuery, getSqlDialect, getUpdateStatusQuery, hasRawMessageAvailable, hasRawMessageAvailable, isBlobsCompressed, isBlobSmartGet, isPeekUntransacted, isTrace, knownProcessStates, openThread, setBlobCharset, setBlobsCompressed, setBlobSmartGet, setCorrelationIdField, setKeyField, setMessageField, setMessageFieldType, setMessageIdField, setPeekQuery, setPeekUntransacted, setSelectQuery, setSqlDialect, setTrace, setUpdateStatusQuery, start, stop, targetProcessStates
Methods inherited from class org.frankframework.jdbc.JdbcFacade
getAuthAlias, getConnection, getConnectionWithTimeout, getDatasource, getDataSourceFactory, getDatasourceInfo, getDatasourceName, getDbmsSupport, getDomain, getLogPrefix, getPassword, getUsername, isConnectionsArePooled, isTransacted, setAuthAlias, setConnectionsArePooled, setDataSourceFactory, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
Methods inherited from class org.frankframework.jndi.JndiBase
getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.IHasProcessState
changeProcessState, knownProcessStates, targetProcessStates
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
-
Constructor Details
-
JdbcTableListener
public JdbcTableListener()
-
-
Method Details
-
configure
Description copied from interface:IListener
configure()
is called once at startup of the framework in theconfigure()
method of the owner of this listener. Purpose of this method is to reduce creating connections to databases etc. in theIPullingListener.getRawMessage(Map)
method. As much as possible class-instantiating should take place in theconfigure()
orIListener.start()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceIListener<M>
- Overrides:
configure
in classJdbcListener<M>
- Throws:
ConfigurationException
-
verifyFieldNotInQuery
-
createUpdateStatusQuery
-
changeProcessState
protected RawMessageWrapper<M> changeProcessState(Connection connection, RawMessageWrapper<M> rawMessage, ProcessState toState, String reason) throws ListenerException - Overrides:
changeProcessState
in classJdbcListener<M>
- Throws:
ListenerException
-
getMessageBrowser
Description copied from interface:IProvidesMessageBrowsers
returns abrowser
of messages that are in ProcessState 'state', and are stored in a storage managed by the listener itself (as opposed to a storage configured as a messageLog or errorStorage in the configuration).- Specified by:
getMessageBrowser
in interfaceIProvidesMessageBrowsers<M>
-
getStatusValue
-
getStorageType
-
getPhysicalDestinationName
Description copied from class:JdbcFacade
Returns the name and location of the database that this objects operates on. If no previous connection was made or it cannot determine the destination it returns 'unknown'- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
- Overrides:
getPhysicalDestinationName
in classJdbcFacade
- See Also:
-
setTableName
Name of the table to be used -
setTableAlias
Alias of the table, that can be used in selectCondition- Default value
- t
-
setStatusField
Field containing the status of the message. NB: For optimal performance, an index should exist that starts with this field, followed by all fields that are used with a fixed value in the select condition, and end with theorderField
. -
setOrderField
(optional) Comma separated list of fields determining the order in which messages are processed -
setTimestampField
(optional) Field used to store the date and time of the last change of thestatusField
-
setCommentField
(optional) Field used to store the reason of the last change of thestatusField
-
setMaxCommentLength
public void setMaxCommentLength(int maxCommentLength) (optional) Maximum length of strings to be stored in commentField, or -1 for unlimited- Default value
- 1000
-
setStatusValueAvailable
(optional) Value ofstatusField
indicating row is available to be processed. If not specified, any row not having any of the other status values is considered available. -
setStatusValueError
Value ofstatusField
indicating the processing of the row resulted in an error -
setStatusValueProcessed
Value of status field indicating row is processed OK -
setStatusValueInProcess
Value ofstatusField
indicating is being processed. Can be left emtpy if database hasSKIP LOCKED
functionality and thetransactionAttribute
of theReceiver
can be (and is) set toRequired
orRequiresNew
. -
setStatusValueHold
Value ofstatusField
indicating message is on Hold, temporarily -
setSelectCondition
Additional condition for a row to belong to this TableListener. Impacts all process states -
getTableName
-
getTableAlias
-
getStatusField
-
getOrderField
-
getTimestampField
-
getCommentField
-
getSelectCondition
-
getMaxCommentLength
public int getMaxCommentLength()
-