org.camunda.bpm.extension.keycloak.KeycloakUserQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of camunda-platform-7-keycloak Show documentation
Show all versions of camunda-platform-7-keycloak Show documentation
A Camunda 7 Identity Provider Plugin for Keycloak
package org.camunda.bpm.extension.keycloak;
import java.util.List;
import org.camunda.bpm.engine.identity.User;
import org.camunda.bpm.engine.identity.UserQuery;
import org.camunda.bpm.engine.impl.Page;
import org.camunda.bpm.engine.impl.UserQueryImpl;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.interceptor.CommandExecutor;
/**
* Keycloak specific user query implementation.
*/
public class KeycloakUserQuery extends UserQueryImpl {
private static final long serialVersionUID = 1L;
public KeycloakUserQuery() {
super();
}
public KeycloakUserQuery(CommandExecutor commandExecutor) {
super(commandExecutor);
}
// execute queries /////////////////////////////////////////
@Override
public long executeCount(CommandContext commandContext) {
final KeycloakIdentityProviderSession provider = getKeycloakIdentityProvider(commandContext);
return provider.findUserCountByQueryCriteria(this);
}
@Override
public List executeList(CommandContext commandContext, Page page) {
final KeycloakIdentityProviderSession provider = getKeycloakIdentityProvider(commandContext);
return provider.findUserByQueryCriteria(this);
}
protected KeycloakIdentityProviderSession getKeycloakIdentityProvider(CommandContext commandContext) {
return (KeycloakIdentityProviderSession) commandContext.getReadOnlyIdentityProvider();
}
// unimplemented features //////////////////////////////////
@Override
public UserQuery memberOfTenant(String tenantId) {
throw new UnsupportedOperationException("The Keycloak identity provider does currently not support tenant queries.");
}
@Override
public UserQuery potentialStarter(String procDefId) {
throw new UnsupportedOperationException("The Keycloak identity provider does currently not support potential starter queries.");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy