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


Java GroupMember.Builder方法代码示例

本文整理汇总了Java中org.kuali.rice.kim.api.group.GroupMember.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java GroupMember.Builder方法的具体用法?Java GroupMember.Builder怎么用?Java GroupMember.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kim.api.group.GroupMember的用法示例。


在下文中一共展示了GroupMember.Builder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inactivatePrincipalGroupMemberships

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
protected void inactivatePrincipalGroupMemberships(List<String> groupIds, Timestamp yesterday) {
    if (groupIds == null || groupIds.isEmpty() ) {
        return;
    }
    Collection<GroupMember> groupMemberships = getGroupService().getMembers(groupIds);
    if ( groupMemberships.isEmpty() ) {
        return;
    }
    List<GroupMember> groupMembers = new ArrayList<GroupMember>();
    for (GroupMember groupMembershipInfo : groupMemberships) {
        if (MemberType.GROUP.equals(groupMembershipInfo.getType())
                && groupMembershipInfo.isActive(new DateTime())) {
            groupMembers.add(groupMembershipInfo);
        }
    }
    // FIXME: Is there a reason we are doing this directly and *not* calling the group service???
    for (GroupMember groupMember : groupMembers) {
        GroupMember.Builder builder = GroupMember.Builder.create(groupMember);
        builder.setActiveToDate(new DateTime(yesterday.getTime()));
        getDataObjectService().save(GroupMemberBo.from(builder.build()));
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:RoleInternalServiceImpl.java

示例2: findGroupMembers

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
@Override
public GroupMemberQueryResults findGroupMembers(final QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
    incomingParamCheck(queryByCriteria, "queryByCriteria");

    QueryResults<GroupMemberBo> results = dataObjectService.findMatching(GroupMemberBo.class, queryByCriteria);

    GroupMemberQueryResults.Builder builder = GroupMemberQueryResults.Builder.create();
    builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
    builder.setTotalRowCount(results.getTotalRowCount());

    final List<GroupMember.Builder> ims = new ArrayList<GroupMember.Builder>();
    for (GroupMemberBo bo : results.getResults()) {
        ims.add(GroupMember.Builder.create(bo));
    }

    builder.setResults(ims);
    return builder.build();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:GroupServiceImpl.java

示例3: findGroupMembers

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
@Override
public GroupMemberQueryResults findGroupMembers(final QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
    incomingParamCheck(queryByCriteria, "queryByCriteria");

    GenericQueryResults<GroupMemberBo> results = criteriaLookupService.lookup(GroupMemberBo.class, queryByCriteria);

    GroupMemberQueryResults.Builder builder = GroupMemberQueryResults.Builder.create();
    builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
    builder.setTotalRowCount(results.getTotalRowCount());

    final List<GroupMember.Builder> ims = new ArrayList<GroupMember.Builder>();
    for (GroupMemberBo bo : results.getResults()) {
        ims.add(GroupMember.Builder.create(bo));
    }

    builder.setResults(ims);
    return builder.build();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:19,代码来源:GroupServiceImpl.java

示例4: populateGroupMembers

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
protected List <GroupMemberBo> populateGroupMembers(IdentityManagementPersonDocument identityManagementPersonDocument) {
		List <GroupMemberBo>  groupPrincipals = new ArrayList<GroupMemberBo>();
//		List<? extends Group> origGroups = getGroupService().getGroupsByPrincipalId(identityManagementPersonDocument.getPrincipalId());
		if(CollectionUtils.isNotEmpty(identityManagementPersonDocument.getGroups())){
			for (PersonDocumentGroup group : identityManagementPersonDocument.getGroups()) {
				GroupMember.Builder groupPrincipalImpl = GroupMember.Builder.create(group.getGroupId(), identityManagementPersonDocument.getPrincipalId(), KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE);
				if (group.getActiveFromDate() != null) {
					groupPrincipalImpl.setActiveFromDate(new DateTime(group.getActiveFromDate().getTime()));
				}
				if (group.getActiveToDate() != null) {
					groupPrincipalImpl.setActiveToDate(new DateTime(group.getActiveToDate().getTime()));
				}
				groupPrincipalImpl.setId(group.getGroupMemberId());


                //groupPrincipalImpl.setVersionNumber(group.getVersionNumber());
				// get the ORM-layer optimisic locking value
				// TODO: this should be replaced with the retrieval and storage of that value
				// in the document tables and not re-retrieved here
				Collection<GroupMember> currGroupMembers = getGroupService().getMembers(Collections.singletonList(group.getGroupId()));
				if(ObjectUtils.isNotNull(currGroupMembers)){
					for (GroupMember origGroupMember: currGroupMembers) {
                        if (origGroupMember.isActive(new DateTime(System.currentTimeMillis()))
                            && KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.equals(origGroupMember.getType())) {
                            if(origGroupMember.getId()!=null && StringUtils.equals(origGroupMember.getId(), group.getGroupMemberId())){
                                groupPrincipalImpl.setObjectId(origGroupMember.getObjectId());
                                groupPrincipalImpl.setVersionNumber(origGroupMember.getVersionNumber());
                            }
                        }
					}
				}

				groupPrincipals.add(GroupMemberBo.from(groupPrincipalImpl.build()));

			}
		}
		return groupPrincipals;
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:UiDocumentServiceImpl.java

示例5: inactivatePrincipalGroupMemberships

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
protected void inactivatePrincipalGroupMemberships(String principalId, Timestamp yesterday) {
    List<GroupMember> groupMembers = getRoleDao().getGroupPrincipalsForPrincipalIdAndGroupIds(null, principalId);
    List<GroupMemberBo> groupMemberBoList = new ArrayList<GroupMemberBo>(groupMembers.size());
    for (GroupMember gm : groupMembers) {
        GroupMember.Builder builder = GroupMember.Builder.create(gm);
        builder.setActiveToDate(new DateTime(yesterday.getTime()));
        groupMemberBoList.add(GroupMemberBo.from(builder.build()));
    }
    getBusinessObjectService().save(groupMemberBoList);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:11,代码来源:RoleInternalServiceImpl.java


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