Various utils related to clustering and concurrent tasks on cluster nodes
- 著者
- Marek Posolda
◆ org::keycloak::cluster::ClusterProvider::DCNotify
enum org::keycloak::cluster::ClusterProvider::DCNotify |
列挙値 |
ALL_BUT_LOCAL_DC |
Send message to all cluster nodes in all datacenters, but NOT to this datacenter. Option "ignoreSender" of method notify will be ignored as sender is ignored anyway due it is in this datacenter
|
ALL_DCS |
Send message to all cluster nodes in all DCs
|
LOCAL_DC_ONLY |
Send message to all cluster nodes on THIS datacenter only
|
◆ executeIfNotExecuted()
<T> ExecutionResult<T> org.keycloak.cluster.ClusterProvider.executeIfNotExecuted |
( |
String |
taskKey, |
|
|
int |
taskTimeoutInSeconds, |
|
|
Callable< T > |
task |
|
) |
| |
Execute given task just if it's not already in progress (either on this or any other cluster node).
- 引数
-
taskKey | |
taskTimeoutInSeconds | timeout for given task. If there is existing task in progress for longer time, it's considered outdated so we will start our task. |
task | |
<T> | |
- 戻り値
- result with "executed" flag specifying if execution was executed or ignored.
◆ executeIfNotExecutedAsync()
Future<Boolean> org.keycloak.cluster.ClusterProvider.executeIfNotExecutedAsync |
( |
String |
taskKey, |
|
|
int |
taskTimeoutInSeconds, |
|
|
Callable |
task |
|
) |
| |
Execute given task just if it's not already in progress (either on this or any other cluster node). It will return corresponding future to every caller and this future is fulfilled if:
- The task is successfully finished. In that case Future will be true
- The task wasn't successfully finished. For example because cluster node failover. In that case Future will be false
- 引数
-
taskKey | |
taskTimeoutInSeconds | timeout for given task. If there is existing task in progress for longer time, it's considered outdated so we will start our task. |
task | |
- 戻り値
- Future, which will be completed once the running task is finished. Returns true if task was successfully finished. Otherwise (for example if cluster node when task was running leaved cluster) returns false
◆ getClusterStartupTime()
int org.keycloak.cluster.ClusterProvider.getClusterStartupTime |
( |
| ) |
|
Same value for all cluster nodes. It will use startup time of this server in non-cluster environment.
◆ notify()
void org.keycloak.cluster.ClusterProvider.notify |
( |
String |
taskKey, |
|
|
ClusterEvent |
event, |
|
|
boolean |
ignoreSender, |
|
|
DCNotify |
dcNotify |
|
) |
| |
Notify registered listeners on all cluster nodes in all datacenters. It will notify listeners registered under given taskKey
- 引数
-
taskKey | |
event | |
ignoreSender | if true, then sender node itself won't receive the notification |
dcNotify | Specify which DCs to notify. See DCNotify enum values for more info |
◆ registerListener()
void org.keycloak.cluster.ClusterProvider.registerListener |
( |
String |
taskKey, |
|
|
ClusterListener |
task |
|
) |
| |
Register task (listener) under given key. When this key will be put to the cache on any cluster node, the task will be executed.
- 引数
-
このインタフェース詳解は次のファイルから抽出されました:
- D:/AppData/doxygen/keycloak/spi-private/src/server-spi-private/src/main/java/org/keycloak/cluster/ClusterProvider.java