All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
io.phasetwo.service.model.OrganizationProvider Maven / Gradle / Ivy
package io.phasetwo.service.model;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.provider.Provider;
public interface OrganizationProvider extends Provider {
OrganizationModel createOrganization(
RealmModel realm, String name, UserModel createdBy, boolean admin);
OrganizationModel getOrganizationById(RealmModel realm, String id);
Stream getOrganizationsStreamForDomain(
RealmModel realm, String domain, boolean verified);
Stream getUserOrganizationsStream(RealmModel realm, UserModel user);
Stream searchForOrganizationStream(
RealmModel realm,
Map attributes,
Integer firstResult,
Integer maxResults,
Optional member);
Long getOrganizationsCount(RealmModel realm, String search);
boolean removeOrganization(RealmModel realm, String id);
void removeOrganizations(RealmModel realm);
Stream getUserInvitationsStream(RealmModel realm, UserModel user);
// deprecated methods
/**
* @deprecated use {@link #searchForOrganizationStream searchForOrganizationStream} method instead
*/
@Deprecated(forRemoval = true)
default Stream searchForOrganizationByNameStream(
RealmModel realm, String search, Integer firstResult, Integer maxResults) {
Map attributes = Maps.newHashMap();
if (!Strings.isNullOrEmpty(search)) {
attributes.put("name", search);
}
return searchForOrganizationStream(
realm, attributes, firstResult, maxResults, Optional.empty());
}
/**
* @deprecated use {@link #searchForOrganizationStream searchForOrganizationStream} method instead
*/
@Deprecated(forRemoval = true)
default Stream searchForOrganizationByAttributesStream(
RealmModel realm, Map attributes, Integer firstResult, Integer maxResults) {
return searchForOrganizationStream(
realm, attributes, firstResult, maxResults, Optional.empty());
}
/**
* @deprecated use {@link #searchForOrganizationStream searchForOrganizationStream} method instead
*/
@Deprecated(forRemoval = true)
default Stream getOrganizationsStream(
RealmModel realm, Integer firstResult, Integer maxResults) {
return searchForOrganizationStream(realm, null, firstResult, maxResults, Optional.empty());
}
/**
* @deprecated use {@link #searchForOrganizationStream searchForOrganizationStream} method instead
*/
@Deprecated(forRemoval = true)
default Stream getOrganizationsStream(
RealmModel realm, Map attributes, Integer firstResult, Integer maxResults) {
return searchForOrganizationStream(
realm, attributes, firstResult, maxResults, Optional.empty());
}
/**
* @deprecated use {@link #searchForOrganizationStream searchForOrganizationStream} method instead
*/
@Deprecated(forRemoval = true)
default Stream getOrganizationsStream(RealmModel realm) {
return searchForOrganizationStream(realm, null, null, null, Optional.empty());
}
}