Package org.frankframework.jdbc
Class JdbcTableListener<M>
java.lang.Object
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.JdbcListener<M>
org.frankframework.jdbc.JdbcTableListener<M>
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IHasProcessState<M>,IListener<M>,IPeekableListener<M>,IProvidesMessageBrowsers<M>,IPullingListener<M>,IScopeProvider,IXAEnabled,NameAware,ConfigurableLifecycle,ReceiverAware<M>,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- 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
ADDITIONAL_QUERY_FIELDS_KEY, connectionFields inherited from class org.frankframework.jdbc.JdbcFacade
logFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RawMessageWrapper<M> changeProcessState(Connection connection, RawMessageWrapper<M> rawMessage, ProcessState toState, String reason) voidConfigure this component.protected StringcreateUpdateStatusQuery(String fieldValue, String additionalSetClause) getMessageBrowser(ProcessState state) returns abrowserof 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) voidsetCommentField(String commentField) (optional) Field used to store the reason of the last change of thestatusFieldvoidsetMaxCommentLength(int maxCommentLength) (optional) Maximum length of strings to be stored in commentField, or -1 for unlimitedvoidsetOrderField(String string) (optional) Comma separated list of fields determining the order in which messages are processedvoidsetSelectCondition(String string) Additional condition for a row to belong to this TableListener.voidsetStatusField(String fieldname) Field containing the status of the message.voidsetStatusValueAvailable(String string) (optional) Value ofstatusFieldindicating row is available to be processed.voidsetStatusValueError(String string) Value ofstatusFieldindicating the processing of the row resulted in an errorvoidsetStatusValueHold(String string) Value ofstatusFieldindicating message is on Hold, temporarilyvoidsetStatusValueInProcess(String string) Value ofstatusFieldindicating is being processed.voidsetStatusValueProcessed(String string) Value of status field indicating row is processed OKvoidsetTableAlias(String string) Alias of the table, that can be used in selectConditionvoidsetTableName(String string) Name of the table to be usedvoidsetTimestampField(String fieldname) (optional) Field used to store the date and time of the last change of thestatusFieldprotected voidverifyFieldNotInQuery(String fieldName, String query) Methods inherited from class org.frankframework.jdbc.JdbcListener
addAdditionalQueryFieldsToSession, addAdditionalValuesToMessageWrapper, afterMessageProcessed, changeProcessState, closeThread, convertQuery, execute, extractMessage, extractRawMessage, getKeyFromRawMessage, getRawMessage, getRawMessage, getUpdateStatusQuery, hasRawMessageAvailable, hasRawMessageAvailable, knownProcessStates, openThread, setAdditionalFields, setBlobCharset, setBlobsCompressed, setBlobSmartGet, setCorrelationIdField, setKeyField, setMessageField, setMessageFieldType, setMessageIdField, setPeekQuery, setPeekUntransacted, setSelectQuery, setSqlDialect, setUpdateStatusQuery, start, stop, targetProcessStatesMethods inherited from class org.frankframework.jdbc.JdbcFacade
getConnection, getConnectionWithTimeout, getDatasource, getDatasourceName, getDbmsSupport, getLogPrefix, getPassword, isConnectionsArePooled, isRunning, isTransacted, setAuthAlias, setConnectionsArePooled, setDatasourceName, setDbmsSupportFactory, setName, setPassword, setTransacted, setUsernameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
getPhase, isAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.IHasProcessState
changeProcessState, knownProcessStates, targetProcessStatesMethods inherited from interface org.frankframework.core.IPeekableListener
isPeekUntransactedMethods inherited from interface org.frankframework.receivers.ReceiverAware
getReceiver, setReceiverMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
JdbcTableListener
public JdbcTableListener()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classJdbcListener<M>- Throws:
ConfigurationException- in case it was not able to configure the component.
-
verifyFieldNotInQuery
-
createUpdateStatusQuery
-
changeProcessState
protected RawMessageWrapper<M> changeProcessState(Connection connection, RawMessageWrapper<M> rawMessage, ProcessState toState, String reason) throws ListenerException - Overrides:
changeProcessStatein classJdbcListener<M>- Throws:
ListenerException
-
getMessageBrowser
Description copied from interface:IProvidesMessageBrowsersreturns abrowserof 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:
getMessageBrowserin interfaceIProvidesMessageBrowsers<M>
-
getStatusValue
-
getStorageType
-
getPhysicalDestinationName
Description copied from class:JdbcFacadeReturns 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:
getPhysicalDestinationNamein interfaceHasPhysicalDestination- Overrides:
getPhysicalDestinationNamein 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 ofstatusFieldindicating row is available to be processed. If not specified, any row not having any of the other status values is considered available. -
setStatusValueError
Value ofstatusFieldindicating the processing of the row resulted in an error -
setStatusValueProcessed
Value of status field indicating row is processed OK -
setStatusValueInProcess
Value ofstatusFieldindicating is being processed. Can be left emtpy if database hasSKIP LOCKEDfunctionality and thetransactionAttributeof theReceivercan be (and is) set toRequiredorRequiresNew. -
setStatusValueHold
Value ofstatusFieldindicating message is on Hold, temporarily -
setSelectCondition
Additional condition for a row to belong to this TableListener. Impacts all process states
-