本文整理汇总了Java中org.picketlink.idm.query.IdentityQuery.where方法的典型用法代码示例。如果您正苦于以下问题:Java IdentityQuery.where方法的具体用法?Java IdentityQuery.where怎么用?Java IdentityQuery.where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.picketlink.idm.query.IdentityQuery
的用法示例。
在下文中一共展示了IdentityQuery.where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listUsersByFilter
import org.picketlink.idm.query.IdentityQuery; //导入方法依赖的package包/类
/**
*
* @param filter
* @param isBlocked
* @return
*/
public List<User> listUsersByFilter(String filter, Boolean isBlocked) {
final IdentityQueryBuilder queryBuilder = this.identityManager.getQueryBuilder();
final IdentityQuery<User> query = queryBuilder.createIdentityQuery(User.class);
List<Condition> conditions = new ArrayList<>();
// considera que a busca ira ou nao bucar os bloqueados
if (isBlocked != null) {
conditions.add(queryBuilder.equal(User.ENABLED, !isBlocked));
}
// considere que os filtros devem ser setados
if (filter != null && !filter.isEmpty()) {
conditions = Arrays.asList(
queryBuilder.like(User.USER_NAME, "%" + filter + "%"),
queryBuilder.like(User.NAME, "%" + filter + "%"));
}
query.where(conditions.toArray(new Condition[]{}));
return query.getResultList();
}
示例2: listGroupsByFilter
import org.picketlink.idm.query.IdentityQuery; //导入方法依赖的package包/类
/**
*
* @param filter
* @param isBlocked
* @return
*/
public List<Group> listGroupsByFilter(String filter, Boolean isBlocked) {
final IdentityQueryBuilder queryBuilder = this.identityManager.getQueryBuilder();
final IdentityQuery<Group> query = queryBuilder.createIdentityQuery(Group.class);
List<Condition> conditions = new ArrayList<>();
// considera que a busca ira ou nao bucar os bloqueados
if (isBlocked != null) {
conditions.add(queryBuilder.equal(User.ENABLED, !isBlocked));
}
// considere que os filtros devem ser setados
if (filter != null && !filter.isEmpty()) {
conditions = Arrays.asList(
queryBuilder.like(User.USER_NAME, "%" + filter + "%"),
queryBuilder.like(User.NAME, "%" + filter + "%"));
}
query.where(conditions.toArray(new Condition[]{}));
return query.getResultList();
}
示例3: authenticate
import org.picketlink.idm.query.IdentityQuery; //导入方法依赖的package包/类
@Override
@Transactional(qualifier = PicketLink.class)
public void authenticate()
{
if(!identity.isLoggedIn())
{
FacesContext context = FacesContext.getCurrentInstance();
if (realm.isEmpty())
{
context.addMessage("Realm",new FacesMessage(messages.DomainRequired()));
}
if (credentials.getUserId().isEmpty())
{
context.addMessage("username",new FacesMessage(messages.UsernameRequired()));
}
if (credentials.getPassword().isEmpty())
{
context.addMessage("password",new FacesMessage(messages.PasswordRequired()));
}
Realm storedRealm = partitionManager.getPartition(Realm.class, realm);
if(storedRealm == null)
{
context.addMessage(null,new FacesMessage(FacesMessage.SEVERITY_ERROR,"Error!", messages.LoginStatusFailure()));
return;
}
IdentityManager identityManager = partitionManager.createIdentityManager(storedRealm);
Password password = new Password(credentials.getPassword());
UsernamePasswordCredentials m_credentials = new UsernamePasswordCredentials(credentials.getUserId(), password);
identityManager.validateCredentials(m_credentials);
org.picketlink.idm.credential.Credentials.Status status = m_credentials.getStatus();
if (status == org.picketlink.idm.credential.Credentials.Status.INVALID)
{
context.addMessage(null,new FacesMessage(FacesMessage.SEVERITY_ERROR,"Error!", messages.LoginStatusFailure()));
return;
}
IdentityQueryBuilder queryBuilder = identityManager.getQueryBuilder();
IdentityQuery<User> query = queryBuilder.createIdentityQuery(User.class);
// let's check if the user is stored by querying by name
query.where(queryBuilder.equal(User.USER_NAME, credentials.getUserId()));
List<User> users = query.getResultList();
setStatus(AuthenticationStatus.SUCCESS);
setAccount(users.get(0));
// UserIdentity user = new UserIdentity();
// user.setUsername(Username);
// user.setPassword(Password);
// model.SaveUser(user);
// System.out.print("this is test");
}
// this.viewNavigationHandler.navigateTo(Windows.contourdynamics.class);
}
示例4: listUsers
import org.picketlink.idm.query.IdentityQuery; //导入方法依赖的package包/类
/**
*
* @param isBlocked
* @return
*/
public List<User> listUsers(Boolean isBlocked) {
final IdentityQueryBuilder queryBuilder = this.identityManager.getQueryBuilder();
final IdentityQuery<User> query = queryBuilder.createIdentityQuery(User.class);
if (isBlocked != null) {
query.where(queryBuilder.equal(User.ENABLED, !isBlocked));
}
return query.getResultList();
}
示例5: listGroups
import org.picketlink.idm.query.IdentityQuery; //导入方法依赖的package包/类
/**
*
* @param isBlocked
* @return
*/
public List<Group> listGroups(Boolean isBlocked) {
final IdentityQueryBuilder queryBuilder = this.identityManager.getQueryBuilder();
final IdentityQuery<Group> query = queryBuilder.createIdentityQuery(Group.class);
if (isBlocked != null) {
query.where(queryBuilder.equal(User.ENABLED, !isBlocked));
}
return query.getResultList();
}