Package org.keycloak.representations.adapters.action

Examples of org.keycloak.representations.adapters.action.GlobalRequestResult


        try {
            realm.setNotBefore(Time.currentTime());
            List<ApplicationModel> resources = realm.getApplications();
            logger.debugv("logging out {0} resources ", resources.size());

            GlobalRequestResult finalResult = new GlobalRequestResult();
            for (ApplicationModel resource : resources) {
                GlobalRequestResult currentResult = logoutApplication(requestUri, realm, resource, executor, realm.getNotBefore());
                finalResult.addAll(currentResult);
            }
            return finalResult;
        } finally {
            executor.getHttpClient().getConnectionManager().shutdown();
View Full Code Here


    protected GlobalRequestResult logoutApplication(URI requestUri, RealmModel realm, ApplicationModel resource, ApacheHttpClient4Executor executor, int notBefore) {
        List<String> mgmtUrls = getAllManagementUrls(requestUri, resource);
        if (mgmtUrls.isEmpty()) {
            logger.debug("No management URL or no registered cluster nodes for the application " + resource.getName());
            return new GlobalRequestResult();
        }

        if (logger.isDebugEnabled()) logger.debug("Send logoutApplication for URLs: " + mgmtUrls);

        // Propagate this to all hosts
        GlobalRequestResult result = new GlobalRequestResult();
        for (String mgmtUrl : mgmtUrls) {
            if (sendLogoutRequest(realm, resource, null, executor, notBefore, mgmtUrl)) {
                result.addSuccessRequest(mgmtUrl);
            } else {
                result.addFailedRequest(mgmtUrl);
            }
        }
        return result;
    }
View Full Code Here

    public GlobalRequestResult pushRealmRevocationPolicy(URI requestUri, RealmModel realm) {
        ApacheHttpClient4Executor executor = createExecutor();

        try {
            GlobalRequestResult finalResult = new GlobalRequestResult();
            for (ApplicationModel application : realm.getApplications()) {
                GlobalRequestResult currentResult = pushRevocationPolicy(requestUri, realm, application, realm.getNotBefore(), executor);
                finalResult.addAll(currentResult);
            }
            return finalResult;
        } finally {
            executor.getHttpClient().getConnectionManager().shutdown();
View Full Code Here

    protected GlobalRequestResult pushRevocationPolicy(URI requestUri, RealmModel realm, ApplicationModel resource, int notBefore, ApacheHttpClient4Executor executor) {
        List<String> mgmtUrls = getAllManagementUrls(requestUri, resource);
        if (mgmtUrls.isEmpty()) {
            logger.debugf("No management URL or no registered cluster nodes for the application %s", resource.getName());
            return new GlobalRequestResult();
        }

        if (logger.isDebugEnabled()) logger.info("Sending push revocation to URLS: " + mgmtUrls);

        // Propagate this to all hosts
        GlobalRequestResult result = new GlobalRequestResult();
        for (String mgmtUrl : mgmtUrls) {
            if (sendPushRevocationPolicyRequest(realm, resource, notBefore, executor, mgmtUrl)) {
                result.addSuccessRequest(mgmtUrl);
            } else {
                result.addFailedRequest(mgmtUrl);
            }
        }
        return result;
    }
View Full Code Here

    public GlobalRequestResult testNodesAvailability(URI requestUri, RealmModel realm, ApplicationModel application) {
        List<String> mgmtUrls = getAllManagementUrls(requestUri, application);
        if (mgmtUrls.isEmpty()) {
            logger.debug("No management URL or no registered cluster nodes for the application " + application.getName());
            return new GlobalRequestResult();
        }

        ApacheHttpClient4Executor executor = createExecutor();

        try {
            if (logger.isDebugEnabled()) logger.debug("Sending test nodes availability: " + mgmtUrls);

            // Propagate this to all hosts
            GlobalRequestResult result = new GlobalRequestResult();
            for (String mgmtUrl : mgmtUrls) {
                if (sendTestNodeAvailabilityRequest(realm, application, executor, mgmtUrl)) {
                    result.addSuccessRequest(mgmtUrl);
                } else {
                    result.addFailedRequest(mgmtUrl);
                }
            }
            return result;
        } finally {
            executor.getHttpClient().getConnectionManager().shutdown();
View Full Code Here

TOP

Related Classes of org.keycloak.representations.adapters.action.GlobalRequestResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.