Search in sources :

Example 1 with APIAuthenticationAdminClient

use of org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient in project carbon-apimgt by wso2.

the class KeyManagerUserOperationListener method clearGatewayUsernameCache.

/**
 * Removes a given username that is cached on the API Gateway.
 *
 * @param username The username to be cleared from the cache
 */
private void clearGatewayUsernameCache(String username) {
    APIAuthenticationAdminClient client = getApiAuthenticationAdminClient();
    client.invalidateCachedUsername(getEndUserName(username));
}
Also used : APIAuthenticationAdminClient(org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient)

Example 2 with APIAuthenticationAdminClient

use of org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient in project carbon-apimgt by wso2.

the class KeyManagerUserOperationListener method clearGatewayUsernameCache.

/**
 * Removes a given list of username that is cached on the API Gateway.
 *
 * @param usernameList The list of username to be cleared from the cache
 */
private void clearGatewayUsernameCache(String[] usernameList) {
    APIAuthenticationAdminClient client = getApiAuthenticationAdminClient();
    for (int i = 0; i < usernameList.length; i++) {
        usernameList[i] = getEndUserName(usernameList[i]);
    }
    client.invalidateCachedUsernames(usernameList);
    log.debug("Removed cached usernames of the Gateway.");
}
Also used : APIAuthenticationAdminClient(org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient)

Example 3 with APIAuthenticationAdminClient

use of org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient in project carbon-apimgt by wso2.

the class APIProviderImpl method invalidateResourceCache.

protected void invalidateResourceCache(String apiContext, String apiVersion, Set<URITemplate> uriTemplates) {
    APIAuthenticationAdminClient client = new APIAuthenticationAdminClient();
    client.invalidateResourceCache(apiContext, apiVersion, uriTemplates);
}
Also used : APIAuthenticationAdminClient(org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient)

Aggregations

APIAuthenticationAdminClient (org.wso2.carbon.apimgt.impl.utils.APIAuthenticationAdminClient)3