KEYCLOAK-759 Added adapter clustering to admin console
This commit is contained in:
1 parent
9565a785b2
commit
01c705b4d3
18 files changed
+576
-83
No files matched your search
@@ -10,8 +10,7 @@ public interface AdapterConstants {
|
||||
public static final String K_LOGOUT = "k_logout";
|
||||
public static final String K_VERSION = "k_version";
|
||||
public static final String K_PUSH_NOT_BEFORE = "k_push_not_before";
|
||||
public static final String K_GET_USER_STATS = "k_get_user_stats";
|
||||
public static final String K_GET_SESSION_STATS = "k_get_session_stats";
|
||||
public static final String K_TEST_AVAILABLE = "k_test_available";
|
||||
public static final String K_QUERY_BEARER_TOKEN = "k_query_bearer_token";
|
||||
|
||||
// This param name is defined again in Keycloak Subsystem class
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package org.keycloak.representations.adapters.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Result of the "global" request (like push notBefore or logoutAll), which is send to all cluster nodes
|
||||
*
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class GlobalRequestResult {
|
||||
|
||||
private List<String> successRequests;
|
||||
private List<String> failedRequests;
|
||||
|
||||
public void addSuccessRequest(String reqUri) {
|
||||
if (successRequests == null) {
|
||||
successRequests = new ArrayList<String>();
|
||||
}
|
||||
successRequests.add(reqUri);
|
||||
}
|
||||
|
||||
public void addFailedRequest(String reqUri) {
|
||||
if (failedRequests == null) {
|
||||
failedRequests = new ArrayList<String>();
|
||||
}
|
||||
failedRequests.add(reqUri);
|
||||
}
|
||||
|
||||
public void addAllSuccessRequests(List<String> reqUris) {
|
||||
if (successRequests == null) {
|
||||
successRequests = new ArrayList<String>();
|
||||
}
|
||||
successRequests.addAll(reqUris);
|
||||
}
|
||||
|
||||
public void addAllFailedRequests(List<String> reqUris) {
|
||||
if (failedRequests == null) {
|
||||
failedRequests = new ArrayList<String>();
|
||||
}
|
||||
failedRequests.addAll(reqUris);
|
||||
}
|
||||
|
||||
public void addAll(GlobalRequestResult merged) {
|
||||
if (merged.getSuccessRequests() != null && merged.getSuccessRequests().size() > 0) {
|
||||
addAllSuccessRequests(merged.getSuccessRequests());
|
||||
}
|
||||
if (merged.getFailedRequests() != null && merged.getFailedRequests().size() > 0) {
|
||||
addAllFailedRequests(merged.getFailedRequests());
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getSuccessRequests() {
|
||||
return successRequests;
|
||||
}
|
||||
|
||||
public List<String> getFailedRequests() {
|
||||
return failedRequests;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.keycloak.representations.adapters.action;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class TestAvailabilityAction extends AdminAction {
|
||||
|
||||
public static final String TEST_AVAILABILITY = "TEST_AVAILABILITY";
|
||||
|
||||
public TestAvailabilityAction() {
|
||||
}
|
||||
|
||||
public TestAvailabilityAction(String id, int expiration, String resource) {
|
||||
super(id, expiration, resource, TEST_AVAILABILITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validate() {
|
||||
return TEST_AVAILABILITY.equals(action);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package org.keycloak.representations.adapters.action;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class UserStats {
|
||||
protected boolean loggedIn;
|
||||
protected long whenLoggedIn;
|
||||
|
||||
public boolean isLoggedIn() {
|
||||
return loggedIn;
|
||||
}
|
||||
|
||||
public void setLoggedIn(boolean loggedIn) {
|
||||
this.loggedIn = loggedIn;
|
||||
}
|
||||
|
||||
public long getWhenLoggedIn() {
|
||||
return whenLoggedIn;
|
||||
}
|
||||
|
||||
public void setWhenLoggedIn(long whenLoggedIn) {
|
||||
this.whenLoggedIn = whenLoggedIn;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user