Class AbstractConfigurableMongoDbMessageStore

java.lang.Object
org.springframework.integration.store.AbstractBatchingMessageGroupStore
org.springframework.integration.store.AbstractMessageGroupStore
org.springframework.integration.mongodb.store.AbstractConfigurableMongoDbMessageStore
All Implemented Interfaces:
java.lang.Iterable<org.springframework.integration.store.MessageGroup>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.integration.store.BasicMessageGroupStore, org.springframework.integration.store.MessageGroupStore
Direct Known Subclasses:
ConfigurableMongoDbMessageStore, MongoDbChannelMessageStore

public abstract class AbstractConfigurableMongoDbMessageStore
extends org.springframework.integration.store.AbstractMessageGroupStore
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
The abstract MongoDB AbstractMessageGroupStore implementation to provide configuration for common options for implementations of this class.
Since:
4.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.integration.store.MessageGroupStore

    org.springframework.integration.store.MessageGroupStore.MessageGroupCallback
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.String collectionName  
    protected org.apache.commons.logging.Log logger  
    protected org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory  
    static java.lang.String SEQUENCE_NAME  
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.String collectionName)  
    AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, java.lang.String collectionName)  
    AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, java.lang.String collectionName)  
  • Method Summary

    Modifier and Type Method Description
    protected void addMessageDocument​(MessageDocument document)  
    void addMessagesToGroup​(java.lang.Object groupId, org.springframework.messaging.Message<?>... messages)  
    void afterPropertiesSet()  
    void completeGroup​(java.lang.Object groupId)  
    protected org.springframework.context.ApplicationContext getApplicationContext()  
    protected org.springframework.data.mongodb.core.convert.MappingMongoConverter getMappingMongoConverter()  
    org.springframework.messaging.Message<?> getMessage​(java.util.UUID id)  
    protected org.springframework.integration.support.MessageBuilderFactory getMessageBuilderFactory()  
    org.springframework.integration.store.MessageMetadata getMessageMetadata​(java.util.UUID id)  
    java.util.Collection<org.springframework.messaging.Message<?>> getMessagesForGroup​(java.lang.Object groupId)  
    protected org.springframework.data.mongodb.core.MongoTemplate getMongoTemplate()  
    protected long getNextId()
    Perform MongoDB INC operation for the document, which contains the MessageDocument sequence, and return the new incremented value for the new MessageDocument.
    org.springframework.messaging.Message<?> getOneMessageFromGroup​(java.lang.Object groupId)  
    protected static org.springframework.data.mongodb.core.query.Query groupIdQuery​(java.lang.Object groupId)  
    java.util.Iterator<org.springframework.integration.store.MessageGroup> iterator()  
    int messageGroupSize​(java.lang.Object groupId)  
    void removeMessageGroup​(java.lang.Object groupId)  
    void removeMessagesFromGroup​(java.lang.Object key, java.util.Collection<org.springframework.messaging.Message<?>> messages)  
    void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
    void setLastReleasedSequenceNumberForGroup​(java.lang.Object groupId, int sequenceNumber)  

    Methods inherited from class org.springframework.integration.store.AbstractMessageGroupStore

    addMessageToGroup, copy, expireMessageGroups, getGroupMetadata, getMessageCountForAllMessageGroups, getMessageGroupCount, getMessageGroupFactory, isTimeoutOnIdle, registerMessageGroupExpiryCallback, removeMessagesFromGroup, setExpiryCallbacks, setLazyLoadMessageGroups, setTimeoutOnIdle

    Methods inherited from class org.springframework.integration.store.AbstractBatchingMessageGroupStore

    getRemoveBatchSize, setMessageGroupFactory, setRemoveBatchSize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.store.BasicMessageGroupStore

    getMessageGroup, pollMessageFromGroup

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.springframework.integration.store.MessageGroupStore

    streamMessagesForGroup
  • Field Details

  • Constructor Details

    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, java.lang.String collectionName)
    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, java.lang.String collectionName)
    • AbstractConfigurableMongoDbMessageStore

      public AbstractConfigurableMongoDbMessageStore​(org.springframework.data.mongodb.MongoDatabaseFactory mongoDbFactory, org.springframework.data.mongodb.core.convert.MappingMongoConverter mappingMongoConverter, java.lang.String collectionName)
  • Method Details

    • setApplicationContext

      public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getMongoTemplate

      protected org.springframework.data.mongodb.core.MongoTemplate getMongoTemplate()
    • getMappingMongoConverter

      protected org.springframework.data.mongodb.core.convert.MappingMongoConverter getMappingMongoConverter()
    • getApplicationContext

      protected org.springframework.context.ApplicationContext getApplicationContext()
    • getMessageBuilderFactory

      protected org.springframework.integration.support.MessageBuilderFactory getMessageBuilderFactory()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getMessage

      public org.springframework.messaging.Message<?> getMessage​(java.util.UUID id)
    • getMessageMetadata

      public org.springframework.integration.store.MessageMetadata getMessageMetadata​(java.util.UUID id)
    • removeMessageGroup

      public void removeMessageGroup​(java.lang.Object groupId)
      Specified by:
      removeMessageGroup in interface org.springframework.integration.store.BasicMessageGroupStore
    • messageGroupSize

      public int messageGroupSize​(java.lang.Object groupId)
      Specified by:
      messageGroupSize in interface org.springframework.integration.store.BasicMessageGroupStore
    • getNextId

      protected long getNextId()
      Perform MongoDB INC operation for the document, which contains the MessageDocument sequence, and return the new incremented value for the new MessageDocument. The SEQUENCE_NAME document is created on demand.
      Returns:
      the next sequence value.
    • addMessageDocument

      protected void addMessageDocument​(MessageDocument document)
    • groupIdQuery

      protected static org.springframework.data.mongodb.core.query.Query groupIdQuery​(java.lang.Object groupId)
    • removeMessagesFromGroup

      public void removeMessagesFromGroup​(java.lang.Object key, java.util.Collection<org.springframework.messaging.Message<?>> messages)
      Specified by:
      removeMessagesFromGroup in interface org.springframework.integration.store.MessageGroupStore
    • setLastReleasedSequenceNumberForGroup

      public void setLastReleasedSequenceNumberForGroup​(java.lang.Object groupId, int sequenceNumber)
      Specified by:
      setLastReleasedSequenceNumberForGroup in interface org.springframework.integration.store.MessageGroupStore
    • iterator

      public java.util.Iterator<org.springframework.integration.store.MessageGroup> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<org.springframework.integration.store.MessageGroup>
      Specified by:
      iterator in interface org.springframework.integration.store.MessageGroupStore
    • completeGroup

      public void completeGroup​(java.lang.Object groupId)
      Specified by:
      completeGroup in interface org.springframework.integration.store.MessageGroupStore
    • getOneMessageFromGroup

      public org.springframework.messaging.Message<?> getOneMessageFromGroup​(java.lang.Object groupId)
      Specified by:
      getOneMessageFromGroup in interface org.springframework.integration.store.MessageGroupStore
    • addMessagesToGroup

      public void addMessagesToGroup​(java.lang.Object groupId, org.springframework.messaging.Message<?>... messages)
      Specified by:
      addMessagesToGroup in interface org.springframework.integration.store.MessageGroupStore
    • getMessagesForGroup

      public java.util.Collection<org.springframework.messaging.Message<?>> getMessagesForGroup​(java.lang.Object groupId)
      Specified by:
      getMessagesForGroup in interface org.springframework.integration.store.MessageGroupStore