Package org.frankframework.jdbc
Class AbstractJdbcMessageBrowser<M>
java.lang.Object
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.AbstractJdbcMessageBrowser<M>
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IMessageBrowser<M>,IScopeProvider,IXAEnabled,NameAware,ConfigurableLifecycle,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- 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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected static final Stringprotected Stringprotected Stringprotected static final Stringprotected static final Stringprotected Stringprotected StringFields 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 intapplyStandardParameters(PreparedStatement stmt, boolean moreParametersFollow, boolean primaryKeyIsPartOfClause) protected intapplyStandardParameters(PreparedStatement stmt, String paramValue, boolean primaryKeyIsPartOfClause) browseMessage(String storageKey) Retrieves the message, but does not delete.voidConfigure this component.booleancontainsCorrelationId(String correlationId) booleancontainsMessageId(String originalMessageId) Check if the storage contains message with the given original messageId (as passed to storeMessage).voidcopyFacadeSettings(JdbcFacade facade) protected StringvoiddeleteMessage(String storageKey) Deletes the message.getContext(String storageKey) Retrieves the message context as an iteratorItem.protected DataSourceGets an enumeration of messages.getIterator(Date startTime, Date endTime, IMessageBrowser.SortOrder order) protected Stringintprotected abstract StringgetSelectListQuery(IDbmsSupport dbmsSupport, Date startTime, Date endTime, IMessageBrowser.SortOrder order) protected StringgetWhereClause(String clause, boolean primaryKeyIsPartOfClause) protected abstract RawMessageWrapper<M> retrieveObject(String storageKey, ResultSet rs, int columnIndex) voidsetCommentField(String string) The name of the column comments are stored invoidsetCorrelationIdField(String string) The name of the column correlation-ids are stored invoidsetDateField(String string) The name of the column the timestamp is stored invoidsetExpiryDateField(String string) The name of the column the timestamp for expiry is stored inprotected voidsetHostField(String hostField) voidsetIdField(String idField) The name of the column messageIds are stored invoidsetKeyField(String string) The name of the column that contains the primary key of the tablevoidsetLabelField(String string) The name of the column labels are stored invoidsetMessageField(String messageField) The name of the column message themselves are stored inprotected voidvoidvoidPrefix to be prefixed on all database objects (tables, indices, sequences), e.g. to access a different Oracle schemaprotected voidprotected voidsetSlotIdField(String string) protected voidprotected voidsetTypeField(String typeField) Methods inherited from class org.frankframework.jdbc.JdbcFacade
getConnection, getConnectionWithTimeout, getDatasourceName, getDbmsSupport, getPassword, getPhysicalDestinationName, isConnectionsArePooled, isRunning, isTransacted, setAuthAlias, setConnectionsArePooled, setDatasourceName, setDbmsSupportFactory, setName, setPassword, setTransacted, setUsername, start, stopMethods 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.IMessageBrowser
getHideMethod, getHideRegex, getStorageFields, setHideMethod, setHideRegexMethods inherited from interface org.frankframework.core.IXAEnabled
isTransactedMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
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:
getLogPrefixin classJdbcFacade
-
setOperationControls
protected void setOperationControls() -
copyFacadeSettings
- Throws:
JdbcException
-
getDatasource
- Overrides:
getDatasourcein classJdbcFacade- Throws:
JdbcException
-
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 classJdbcFacade- Throws:
ConfigurationException- in case it was not able to configure the component.
-
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:IMessageBrowserGets an enumeration of messages. This includes setting up connections, sessions etc.- Specified by:
getIteratorin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
getIterator
public IMessageBrowsingIterator getIterator(Date startTime, Date endTime, IMessageBrowser.SortOrder order) throws ListenerException - Specified by:
getIteratorin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
deleteMessage
Description copied from interface:IMessageBrowserDeletes the message.- Specified by:
deleteMessagein interfaceIMessageBrowser<M>- Throws:
ListenerException
-
retrieveObject
protected abstract RawMessageWrapper<M> retrieveObject(String storageKey, ResultSet rs, int columnIndex) throws SQLException, JdbcException - Throws:
SQLExceptionJdbcException
-
getMessageCount
- Specified by:
getMessageCountin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
containsMessageId
Description copied from interface:IMessageBrowserCheck if the storage contains message with the given original messageId (as passed to storeMessage).- Specified by:
containsMessageIdin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
containsCorrelationId
- Specified by:
containsCorrelationIdin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
getContext
Description copied from interface:IMessageBrowserRetrieves 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:
getContextin interfaceIMessageBrowser<M>- Throws:
ListenerException
-
browseMessage
Description copied from interface:IMessageBrowserRetrieves the message, but does not delete.- Specified by:
browseMessagein 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
-