クラス MongoDbMessageStore

実装されたすべてのインターフェース:
IterableSE<MessageGroup>AwareBeanClassLoaderAwareInitializingBeanApplicationContextAwareBasicMessageGroupStoreMessageGroupStoreMessageStore

永続性を MongoDB に依存する MessageStore 戦略と MessageGroupStore 戦略の両方の実装。
導入:
2.1
作成者:
Mark Fisher, Oleg Zhurakousky, Sean Brandt, Jodie StJohn, Gary Russell, Artem Bilan
  • フィールドの詳細

  • コンストラクターの詳細

    • MongoDbMessageStore

      public MongoDbMessageStore(MongoDatabaseFactory mongoDbFactory)
      提供された MongoDatabaseFactory とデフォルトのコレクション名を使用して MongoDbMessageStore を作成します。
      パラメーター:
      mongoDbFactory - mongodb ファクトリ。
    • MongoDbMessageStore

      public MongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, @Nullable StringSE collectionName)
      提供された MongoDatabaseFactory とコレクション名を使用して MongoDbMessageStore を作成します。
      パラメーター:
      mongoDbFactory - mongodb ファクトリ。
      collectionName - コレクション名。
  • メソッドの詳細

    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoaderSE classLoader)
      次で指定:
      インターフェース BeanClassLoaderAwaresetBeanClassLoader 
    • setApplicationContext

      public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
      次で指定:
      インターフェース ApplicationContextAwaresetApplicationContext 
      例外:
      BeansException
    • addAllowedPatterns

      public void addAllowedPatterns(StringSE... patterns)
      逆直列化できるパッケージ / クラスのパターンを追加します。クラスは完全修飾することも、クラス名の最初または最後にワイルドカード "*" を使用することもできます。例: com.foo.**.MyClass
      パラメーター:
      patterns - パターン。
      導入:
      5.4
    • setCustomConverters

      public void setCustomConverters(ObjectSE... customConverters)
      MappingMongoConverter で使用するコンバーターのセットを構成します。org.springframework.core.convert.converter.Converterorg.springframework.core.convert.converter.ConverterFactoryorg.springframework.core.convert.converter.GenericConverter または org.springframework.data.convert.ConverterBuilder.ConverterAware のインスタンスである必要があります。
      パラメーター:
      customConverters - 使用するコンバーター。
      導入:
      5.1.6
    • afterPropertiesSet

      public void afterPropertiesSet()
      次で指定:
      インターフェース InitializingBeanafterPropertiesSet 
    • addMessage

      public <T> Message<T> addMessage(Message<T> message)
      インターフェースからコピーされた説明: MessageStore
      提供されたメッセージを MessageStore に入れます。ストアはメッセージを内部で変更する必要がある場合があり、その場合、戻り値は入力と異なる場合があります。戻り値の ID は、MessageStore.getMessage(UUID) および MessageStore.removeMessage(UUID) が正しく動作するようにインデックスとして使用されます。メッセージは不変であるため、同じメッセージを複数回入力しても何も起こりません。
      次で指定:
      インターフェース MessageStoreaddMessage 
      型パラメーター:
      T - ペイロード型。
      パラメーター:
      message - メッセージ。
      戻り値:
      保存されたメッセージ。
    • getMessage

      public Message<?> getMessage(UUIDSE id)
      次で指定:
      インターフェース MessageStoregetMessage 
      パラメーター:
      id - メッセージ識別子。
      戻り値:
      指定された ID のメッセージ。MessageStore にその ID のメッセージが存在しない場合は null
    • getMessageMetadata

      public MessageMetadata getMessageMetadata(UUIDSE id)
      インターフェースからコピーされた説明: MessageStore
      提供された id によって MessageMessageMetadata を返します。
      次で指定:
      インターフェース MessageStoregetMessageMetadata 
      パラメーター:
      id - メッセージ識別子。
      戻り値:
      指定された ID の MessageMetadata、またはその ID のメッセージが MessageStore に存在しないか、メッセージにメタデータがない場合(以前のバージョンのレガシーメッセージ)は null
    • getMessageCount

      @ManagedAttribute public long getMessageCount()
      インターフェースからコピーされた説明: MessageStore
      ストア内のメッセージ数を示すオプションの属性。実装は例外をスローすることで応答を拒否する場合があります。
      次で指定:
      インターフェース MessageStoregetMessageCount 
      戻り値:
      メッセージの数。
    • removeMessage

      public Message<?> removeMessage(UUIDSE id)
      インターフェースからコピーされた説明: MessageStore
      指定された ID を持つメッセージが MessageStore から削除されます (存在する場合)。その ID を持つメッセージがストアに存在しない場合は、null が返されます。このメソッドが MessageGroupStore に実装されている場合、このメッセージを保持するグループがない場合にのみ、メッセージはストアから削除されます。
      次で指定:
      インターフェース MessageStoreremoveMessage 
      パラメーター:
      id - メッセージ識別子。
      戻り値:
      メッセージ (ある場合)。
    • getMessageGroup

      public MessageGroup getMessageGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: BasicMessageGroupStore
      このグループ ID で BasicMessageGroupStore.addMessageToGroup(Object, Message) を使用して保存された、現在 MessageStore にあるすべてのメッセージを返します。
      次で指定:
      インターフェース BasicMessageGroupStoregetMessageGroup 
      パラメーター:
      groupId - グループ識別子。
      戻り値:
      メッセージのグループ。このキーにメッセージが存在しない場合は空です。
    • addMessagesToGroup

      public void addMessagesToGroup(ObjectSE groupId, Message<?>... messages)
      インターフェースからコピーされた説明: MessageGroupStore
      グループ ID に関連付けてメッセージを保存します。これは、メッセージをグループ化するために使用できます。
      次で指定:
      インターフェース MessageGroupStoreaddMessagesToGroup 
      パラメーター:
      groupId - メッセージを保存するグループ ID。
      messages - 追加するメッセージ。
    • removeMessagesFromGroup

      public void removeMessagesFromGroup(ObjectSE groupId, CollectionSE<Message<?>> messages)
      インターフェースからコピーされた説明: MessageGroupStore
      グループからのメッセージの削除を永続化します。
      次で指定:
      インターフェース MessageGroupStoreremoveMessagesFromGroup 
      パラメーター:
      groupId - メッセージを含むグループの groupId。
      messages - 削除するメッセージ。
    • getMessageFromGroup

      @Nullable public Message<?> getMessageFromGroup(ObjectSE groupId, UUIDSE messageId)
      インターフェースからコピーされた説明: MessageGroupStore
      ID を使用してグループから Message を取得します。メッセージがリクエストされたグループに属していない場合は、null を返します。
      次で指定:
      インターフェース MessageGroupStoregetMessageFromGroup 
      パラメーター:
      groupId - メッセージを含むグループの groupId。
      messageId - メッセージ ID。
      戻り値:
      リクエストされたグループに属している場合は、ID によるメッセージ。
    • removeMessageFromGroupById

      public boolean removeMessageFromGroupById(ObjectSE groupId, UUIDSE messageId)
      インターフェースからコピーされた説明: MessageGroupStore
      グループからメッセージを削除します。
      次で指定:
      インターフェース MessageGroupStoreremoveMessageFromGroupById 
      パラメーター:
      groupId - メッセージを含むグループの groupId。
      messageId - 削除するメッセージ ID。
      戻り値:
      メッセージが削除された場合は true。
    • removeMessageGroup

      public void removeMessageGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: BasicMessageGroupStore
      この ID のメッセージグループを削除します。
      次で指定:
      インターフェース BasicMessageGroupStoreremoveMessageGroup 
      パラメーター:
      groupId - 削除するグループの ID。
    • iterator

      public IteratorSE<MessageGroup> iterator()
      次で指定:
      インターフェース IterableSE<MessageGroup>iterator 
      次で指定:
      インターフェース MessageGroupStoreiterator 
      戻り値:
      現在累積されている MessageGroup の反復子。
    • pollMessageFromGroup

      public Message<?> pollMessageFromGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: BasicMessageGroupStore
      この MessageGroup からのメッセージのポーリング(実装でサポートされている場合は FIFO スタイル)と同時に、ポーリングされた Message も削除します。
      次で指定:
      インターフェース BasicMessageGroupStorepollMessageFromGroup 
      パラメーター:
      groupId - グループ識別子。
      戻り値:
      メッセージ。
    • messageGroupSize

      public int messageGroupSize(ObjectSE groupId)
      インターフェースからコピーされた説明: BasicMessageGroupStore
      この MessageGroup のサイズを返します。
      次で指定:
      インターフェース BasicMessageGroupStoremessageGroupSize 
      パラメーター:
      groupId - グループ識別子。
      戻り値:
      サイズ。
    • setGroupCondition

      public void setGroupCondition(ObjectSE groupId, StringSE condition)
      インターフェースからコピーされた説明: MessageGroupStore
      グループに条件文を追加します。後でグループの意思決定に使用できます。相関ハンドラーのリリース戦略では、グループ内のすべてのメッセージを繰り返す代わりに、この条件を調べることができます。
      次で指定:
      インターフェース MessageGroupStoresetGroupCondition 
      パラメーター:
      groupId - グループ識別子。
      condition - グループに保存する条件。
    • setLastReleasedSequenceNumberForGroup

      public void setLastReleasedSequenceNumberForGroup(ObjectSE groupId, int sequenceNumber)
      インターフェースからコピーされた説明: MessageGroupStore
      最後にリリースされたメッセージのシーケンス番号を設定できます。ユースケースの並べ替えに使用
      次で指定:
      インターフェース MessageGroupStoresetLastReleasedSequenceNumberForGroup 
      パラメーター:
      groupId - グループ識別子。
      sequenceNumber - シーケンス番号。
    • completeGroup

      public void completeGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: MessageGroupStore
      これで MessageGroup が完成します。MessageGroup の補完は一般に、このグループに対してそれ以上の変異操作の実行を許可すべきではないことを意味します。たとえば、グループから新しいメッセージを追加 / 削除する試みは許可されるべきではありません。
      次で指定:
      インターフェース MessageGroupStorecompleteGroup 
      パラメーター:
      groupId - グループ識別子。
    • getOneMessageFromGroup

      public Message<?> getOneMessageFromGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: MessageGroupStore
      MessageGroup から 1 つの Message を返します。
      次で指定:
      インターフェース MessageGroupStoregetOneMessageFromGroup 
      パラメーター:
      groupId - グループ識別子。
      戻り値:
      Message
    • getMessagesForGroup

      public CollectionSE<Message<?>> getMessagesForGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: MessageGroupStore
      指定されたグループ ID のメッセージを取得します。
      次で指定:
      インターフェース MessageGroupStoregetMessagesForGroup 
      パラメーター:
      groupId - メッセージを取得するグループ ID。
      戻り値:
      グループのメッセージ。
    • streamMessagesForGroup

      public StreamSE<Message<?>> streamMessagesForGroup(ObjectSE groupId)
      インターフェースからコピーされた説明: MessageGroupStore
      指定されたグループに保存されているメッセージのストリームを返します。永続的な実装は、完全に処理されたら閉じる必要があるストリームを返します(たとえば、try-with-resources 句を使用)。デフォルトでは、MessageGroupStore.getMessagesForGroup(Object) の結果をストリーミングします。
      次で指定:
      インターフェース MessageGroupStorestreamMessagesForGroup 
      パラメーター:
      groupId - メッセージを取得するためのグループ ID。
      戻り値:
      このグループのメッセージの StreamSE
    • getMessageCountForAllMessageGroups

      @ManagedAttribute public int getMessageCountForAllMessageGroups()
      インターフェースからコピーされた説明: MessageGroupStore
      すべてのグループにわたるストア内のメッセージの数を示すオプションの属性。実装は、例外をスローすることによって応答を拒否する場合があります。
      次で指定:
      インターフェース MessageGroupStoregetMessageCountForAllMessageGroups 
      オーバーライド:
      クラス AbstractMessageGroupStoregetMessageCountForAllMessageGroups 
      戻り値:
      メッセージの数
    • getMessageGroupCount

      @ManagedAttribute public int getMessageGroupCount()
      インターフェースからコピーされた説明: MessageGroupStore
      メッセージグループの数を示すオプションの属性。実装は、例外をスローすることによって応答を拒否する場合があります。
      次で指定:
      インターフェース MessageGroupStoregetMessageGroupCount 
      オーバーライド:
      クラス AbstractMessageGroupStoregetMessageGroupCount 
      戻り値:
      メッセージグループの数