Package org.frankframework.jdbc
Class AbstractJdbcMessageBrowser<M>
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.AbstractJdbcMessageBrowser<M>
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,IMessageBrowser<M>
,INamedObject
,IScopeProvider
,IXAEnabled
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
JdbcTableMessageBrowser
public abstract class AbstractJdbcMessageBrowser<M>
extends JdbcFacade
implements IMessageBrowser<M>
JDBC implementation of
IMessageBrowser
.- Author:
- Gerrit van Brakel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.frankframework.core.IMessageBrowser
IMessageBrowser.HideMethod, IMessageBrowser.SortOrder, IMessageBrowser.StorageType
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
applyStandardParameters
(PreparedStatement stmt, boolean moreParametersFollow, boolean primaryKeyIsPartOfClause) protected int
applyStandardParameters
(PreparedStatement stmt, String paramValue, boolean primaryKeyIsPartOfClause) browseMessage
(String storageKey) Retrieves the message, but does not delete.void
boolean
containsCorrelationId
(String correlationId) boolean
containsMessageId
(String originalMessageId) Check if the storage contains message with the given original messageId (as passed to storeMessage).void
copyFacadeSettings
(JdbcFacade facade) protected String
void
deleteMessage
(String storageKey) Deletes the message.getContext
(String storageKey) Retrieves the message context as an iteratorItem.protected DataSource
Gets an enumeration of messages.getIterator
(Date startTime, Date endTime, IMessageBrowser.SortOrder order) protected String
int
getOrder()
protected abstract String
getSelectListQuery
(IDbmsSupport dbmsSupport, Date startTime, Date endTime, IMessageBrowser.SortOrder order) getType()
protected String
getWhereClause
(String clause, boolean primaryKeyIsPartOfClause) protected abstract RawMessageWrapper<M>
retrieveObject
(String storageKey, ResultSet rs, int columnIndex) void
setCommentField
(String string) The name of the column comments are stored invoid
setCorrelationIdField
(String string) The name of the column correlation-ids are stored invoid
setDateField
(String string) The name of the column the timestamp is stored invoid
setExpiryDateField
(String string) The name of the column the timestamp for expiry is stored invoid
setHideMethod
(IMessageBrowser.HideMethod hideMethod) (Only used when hideRegex is not empty) Specifies the way to hidevoid
setHideRegex
(String hideRegex) Regular expression to mask strings in the errorStore/logStore.protected void
setHostField
(String hostField) void
setIdField
(String idField) The name of the column messageIds are stored invoid
setKeyField
(String string) The name of the column that contains the primary key of the tablevoid
setLabelField
(String string) The name of the column labels are stored invoid
setMessageField
(String messageField) The name of the column message themselves are stored inprotected void
void
void
Prefix to be prefixed on all database objects (tables, indices, sequences), e.g. to access a different Oracle schemaprotected void
protected void
setSlotIdField
(String string) protected void
protected void
setTypeField
(String typeField) Methods inherited from class org.frankframework.jdbc.JdbcFacade
getAuthAlias, getConnection, getConnectionWithTimeout, getDataSourceFactory, getDatasourceInfo, getDatasourceName, getDbmsSupport, getDomain, getPassword, getPhysicalDestinationName, 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, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.frankframework.core.IXAEnabled
isTransacted
-
Field Details
-
deleteQuery
-
selectContextQuery
-
selectDataQuery
-
checkMessageIdQuery
-
checkCorrelationIdQuery
-
getMessageCountQuery
-
CONTROL_PROPERTY_PREFIX
- See Also:
-
PROPERTY_USE_PARAMETERS
- See Also:
-
PROPERTY_ASSUME_PRIMARY_KEY_UNIQUE
- See Also:
-
-
Constructor Details
-
AbstractJdbcMessageBrowser
public AbstractJdbcMessageBrowser()
-
-
Method Details
-
getLogPrefix
- Overrides:
getLogPrefix
in classJdbcFacade
-
setOperationControls
protected void setOperationControls() -
copyFacadeSettings
- Throws:
JdbcException
-
getDatasource
- Overrides:
getDatasource
in classJdbcFacade
- Throws:
JdbcException
-
configure
- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classJdbcFacade
- Throws:
ConfigurationException
-
getSelectListQuery
protected abstract String getSelectListQuery(IDbmsSupport dbmsSupport, Date startTime, Date endTime, IMessageBrowser.SortOrder order) -
getWhereClause
-
createSelector
-
applyStandardParameters
protected int applyStandardParameters(PreparedStatement stmt, boolean moreParametersFollow, boolean primaryKeyIsPartOfClause) throws SQLException - Throws:
SQLException
-
applyStandardParameters
protected int applyStandardParameters(PreparedStatement stmt, String paramValue, boolean primaryKeyIsPartOfClause) throws SQLException - Throws:
SQLException
-
getIterator
Description copied from interface:IMessageBrowser
Gets an enumeration of messages. This includes setting up connections, sessions etc.- Specified by:
getIterator
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
getIterator
public IMessageBrowsingIterator getIterator(Date startTime, Date endTime, IMessageBrowser.SortOrder order) throws ListenerException - Specified by:
getIterator
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
deleteMessage
Description copied from interface:IMessageBrowser
Deletes the message.- Specified by:
deleteMessage
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
retrieveObject
protected abstract RawMessageWrapper<M> retrieveObject(String storageKey, ResultSet rs, int columnIndex) throws SQLException, JdbcException - Throws:
SQLException
JdbcException
-
getMessageCount
- Specified by:
getMessageCount
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
containsMessageId
Description copied from interface:IMessageBrowser
Check if the storage contains message with the given original messageId (as passed to storeMessage).- Specified by:
containsMessageId
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
containsCorrelationId
- Specified by:
containsCorrelationId
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
getContext
Description copied from interface:IMessageBrowser
Retrieves the message context as an iteratorItem. The result can be used in the methods above that use an iteratorItem. Use this method as try-with-resources to close the connections.- Specified by:
getContext
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
browseMessage
Description copied from interface:IMessageBrowser
Retrieves the message, but does not delete.- Specified by:
browseMessage
in interfaceIMessageBrowser<M>
- Throws:
ListenerException
-
setKeyField
The name of the column that contains the primary key of the table- Default value
- MESSAGEKEY
-
setIdField
The name of the column messageIds are stored in- Default value
- MESSAGEID
-
setCorrelationIdField
The name of the column correlation-ids are stored in- Default value
- CORRELATIONID
-
setMessageField
The name of the column message themselves are stored in- Default value
- MESSAGE
-
setDateField
The name of the column the timestamp is stored in- Default value
- MESSAGEDATE
-
setCommentField
The name of the column comments are stored in- Default value
- COMMENTS
-
setExpiryDateField
The name of the column the timestamp for expiry is stored in- Default value
- EXPIRYDATE
-
setLabelField
The name of the column labels are stored in- Default value
- LABEL
-
setSlotIdField
-
setTypeField
-
setHostField
-
setPrefix
Prefix to be prefixed on all database objects (tables, indices, sequences), e.g. to access a different Oracle schema -
setSlotId
-
setType
-
setOrder
-
getKeyField
-
getIdField
-
getCorrelationIdField
-
getDateField
-
getCommentField
-
getMessageField
-
getSlotIdField
-
getExpiryDateField
-
getLabelField
-
getPrefix
-
getSlotId
-
getType
-
getTypeField
-
getHostField
-
getHideRegex
- Specified by:
getHideRegex
in interfaceIMessageBrowser<M>
-
setHideRegex
Description copied from interface:IMessageBrowser
Regular expression to mask strings in the errorStore/logStore. Every character between to the strings in this expression will be replaced by a '*'.
For example, the regular expression (?<=<party>).*?(?=</party>) will replace every character between keys <party> and </party>
When no hideRegex is configured on the errorStore / logStore but is configured on theReceiver.setHideRegex(String)
, then the Receiver's hideRegex is used for the errorStore / logStore.- Specified by:
setHideRegex
in interfaceIMessageBrowser<M>
-
getHideMethod
- Specified by:
getHideMethod
in interfaceIMessageBrowser<M>
-
setHideMethod
Description copied from interface:IMessageBrowser
(Only used when hideRegex is not empty) Specifies the way to hide- Specified by:
setHideMethod
in interfaceIMessageBrowser<M>
-
getOrder
-