当前位置: 首页>>代码示例>>Java>>正文


Java IdentityQuery.where方法代码示例

本文整理汇总了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();
}
 
开发者ID:arthurgregorio,项目名称:web-budget,代码行数:31,代码来源:AccountService.java

示例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();
}
 
开发者ID:arthurgregorio,项目名称:web-budget,代码行数:31,代码来源:AccountService.java

示例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);
}
 
开发者ID:Contourdynamics,项目名称:smartcommunication,代码行数:56,代码来源:CDidentityManager.java

示例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();
}
 
开发者ID:arthurgregorio,项目名称:web-budget,代码行数:18,代码来源:AccountService.java

示例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();
}
 
开发者ID:arthurgregorio,项目名称:web-budget,代码行数:18,代码来源:AccountService.java


注:本文中的org.picketlink.idm.query.IdentityQuery.where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。