本文整理汇总了Java中org.kuali.rice.kim.api.group.GroupMember.isActive方法的典型用法代码示例。如果您正苦于以下问题:Java GroupMember.isActive方法的具体用法?Java GroupMember.isActive怎么用?Java GroupMember.isActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.api.group.GroupMember
的用法示例。
在下文中一共展示了GroupMember.isActive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()));
}
}
示例2: getGroupPrincipalsForPrincipalIdAndGroupIds
import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
public List<GroupMember> getGroupPrincipalsForPrincipalIdAndGroupIds(Collection<String> groupIds, String principalId) {
List<String> groupIdValues = new ArrayList<String>();
List<GroupMember> groupPrincipals = new ArrayList<GroupMember>();
if (groupIds != null
&& principalId == null) {
groupIdValues = new ArrayList<String>(groupIds);
} else if (principalId != null) {
groupIdValues = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId);
}
if (groupIdValues != null
&& groupIdValues.size() > 0) {
Collection<GroupMember> groupMembers = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
for (GroupMember groupMembershipInfo : groupMembers) {
if (principalId != null) {
if (MemberType.PRINCIPAL.equals(groupMembershipInfo.getType())
&& StringUtils.equals(principalId, groupMembershipInfo.getMemberId())
&& groupMembershipInfo.isActive(new DateTime())) {
groupPrincipals.add(groupMembershipInfo);
}
} else {
groupPrincipals.add(groupMembershipInfo);
}
}
}
return groupPrincipals;
}
示例3: getGroupMembers
import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
public List<GroupMember> getGroupMembers(Collection<String> groupIds) {
List<GroupMember> groupMembers = new ArrayList<GroupMember>();
if (groupIds != null) {
List<String> groupIdValues = new ArrayList<String>(groupIds);
if (groupIdValues.size() > 0) {
Collection<GroupMember> groupMemberships = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
if (!CollectionUtils.isEmpty(groupMemberships)) {
for (GroupMember groupMembershipInfo : groupMemberships) {
if (MemberType.GROUP.equals(groupMembershipInfo.getType())
&& groupMembershipInfo.isActive(new DateTime())) {
groupMembers.add(groupMembershipInfo);
}
}
}
}
}
return groupMembers;
}
示例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;
}