public abstract class AbstractConfigurableMongoDbMessageStore extends java.lang.Object implements BasicMessageGroupStore, InitializingBean, ApplicationContextAware
BasicMessageGroupStore implementation to provide configuration for common options
for implementations of this class.| Modifier and Type | Field and Description |
|---|---|
protected ApplicationContext |
applicationContext |
protected java.lang.String |
collectionName |
static java.lang.String |
CREATED_DATE_KEY
The name of the message header that stores a timestamp for the time the message was inserted.
|
protected org.apache.commons.logging.Log |
logger |
protected MappingMongoConverter |
mappingMongoConverter |
protected MessageBuilderFactory |
messageBuilderFactory |
protected MongoDbFactory |
mongoDbFactory |
protected MongoTemplate |
mongoTemplate |
static java.lang.String |
SAVED_KEY
The name of the message header that stores a flag to indicate that the message has been saved.
|
static java.lang.String |
SEQUENCE_NAME |
| Constructor and Description |
|---|
AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory,
MappingMongoConverter mappingMongoConverter,
java.lang.String collectionName) |
AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory,
java.lang.String collectionName) |
AbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate,
java.lang.String collectionName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMessageDocument(MessageDocument document) |
void |
afterPropertiesSet() |
Message<?> |
getMessage(java.util.UUID id) |
protected int |
getNextId()
Perform MongoDB
INC operation for the document, which contains the MessageDocument
sequence, and return the new incremented value for the new MessageDocument. |
protected static Query |
groupIdQuery(java.lang.Object groupId) |
int |
messageGroupSize(java.lang.Object groupId)
Returns the size of this MessageGroup.
|
void |
removeMessageGroup(java.lang.Object groupId)
Remove the message group with this id.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMessageToGroup, getMessageGroup, pollMessageFromGrouppublic static final java.lang.String SEQUENCE_NAME
public static final java.lang.String SAVED_KEY
public static final java.lang.String CREATED_DATE_KEY
protected final org.apache.commons.logging.Log logger
protected final java.lang.String collectionName
protected final MongoDbFactory mongoDbFactory
protected MongoTemplate mongoTemplate
protected MappingMongoConverter mappingMongoConverter
protected ApplicationContext applicationContext
protected MessageBuilderFactory messageBuilderFactory
public AbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate, java.lang.String collectionName)
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, java.lang.String collectionName)
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter, java.lang.String collectionName)
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface InitializingBeanjava.lang.Exceptionpublic Message<?> getMessage(java.util.UUID id)
public void removeMessageGroup(java.lang.Object groupId)
BasicMessageGroupStoreremoveMessageGroup in interface BasicMessageGroupStoregroupId - The id of the group to remove.public int messageGroupSize(java.lang.Object groupId)
BasicMessageGroupStoremessageGroupSize in interface BasicMessageGroupStoregroupId - The group identifier.protected int getNextId()
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.protected void addMessageDocument(MessageDocument document)
protected static Query groupIdQuery(java.lang.Object groupId)