public class MultiServerUserRegistry extends ObjectSE implements SimpUserRegistry, SmartApplicationListener
SimpUserRegistry
。ローカルレジストリはコンストラクターの引数として提供されますが、リモートレジストリは UserRegistryMessageHandler
によって処理されるブロードキャストを介して更新されます。UserRegistryMessageHandler
は、更新を受信したときにこのレジストリに通知します。HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターと説明 |
---|
MultiServerUserRegistry(SimpUserRegistry localRegistry) ローカルユーザーレジストリをラップするインスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
SetSE<SimpSubscription> | findSubscriptions(SimpSubscriptionMatcher matcher) 指定されたマッチャーでサブスクリプションを検索します。 |
int | getOrder() 同じイベントの一連のリスナーで、このリスナーの順序を決定します。 |
SimpUser | getUser(StringSE userName) 指定された名前のユーザーを取得します。 |
int | getUserCount() 接続されているすべてのユーザーの数を返します。 |
SetSE<SimpUser> | getUsers() 接続されているすべてのユーザーのスナップショットを返します。 |
void | onApplicationEvent(ApplicationEvent event) アプリケーションイベントを処理します。 |
boolean | supportsEventType(ClassSE<? extends ApplicationEvent> eventType) このリスナーが特定のイベント型を実際にサポートしているかどうかを判断します。 |
boolean | supportsSourceType(ClassSE<?> sourceType) このリスナーが特定のソース型を実際にサポートしているかどうかを判断します。 |
StringSE | toString() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
getListenerId
forPayload
public MultiServerUserRegistry(SimpUserRegistry localRegistry)
public int getOrder()
SmartApplicationListener
デフォルトの実装は Ordered.LOWEST_PRECEDENCE
を返します。
SmartApplicationListener
の getOrder
Ordered
の getOrder
Ordered.HIGHEST_PRECEDENCE
, Ordered.LOWEST_PRECEDENCE
public boolean supportsEventType(ClassSE<? extends ApplicationEvent> eventType)
SmartApplicationListener
SmartApplicationListener
の supportsEventType
eventType
- イベント型 (非 null
)public boolean supportsSourceType(@Nullable ClassSE<?> sourceType)
SmartApplicationListener
デフォルトの実装は、常に true
を返します。
SmartApplicationListener
の supportsSourceType
sourceType
- ソース型、またはソースがない場合は null
public void onApplicationEvent(ApplicationEvent event)
ApplicationListener
ApplicationListener<ApplicationEvent>
の onApplicationEvent
event
- 応答するイベント @Nullable public SimpUser getUser(StringSE userName)
SimpUserRegistry
SimpUserRegistry
の getUser
userName
- 検索するユーザーの名前 null
public SetSE<SimpUser> getUsers()
SimpUserRegistry
返されるセットはコピーであり、それ以上の変更は反映されません。
SimpUserRegistry
の getUsers
public int getUserCount()
SimpUserRegistry
SimpUserRegistry
の getUserCount
public SetSE<SimpSubscription> findSubscriptions(SimpSubscriptionMatcher matcher)
SimpUserRegistry
SimpUserRegistry
の findSubscriptions
matcher
- 使用するマッチャー public StringSE toString()
ObjectSE
の toStringSE