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


Java SubjectTypeEnum.PERSON属性代码示例

本文整理汇总了Java中edu.internet2.middleware.subject.provider.SubjectTypeEnum.PERSON属性的典型用法代码示例。如果您正苦于以下问题:Java SubjectTypeEnum.PERSON属性的具体用法?Java SubjectTypeEnum.PERSON怎么用?Java SubjectTypeEnum.PERSON使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在edu.internet2.middleware.subject.provider.SubjectTypeEnum的用法示例。


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

示例1: processMembershipDelete

/**
 * Delete a membership entry.
 *
 * @param consumer the change log consumer
 * @param changeLogEntry the change log entry
 */
protected void processMembershipDelete(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) {

    LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing membership delete.", consumerName,
            toString(changeLogEntry));

    final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_DELETE.groupName);
    final edu.internet2.middleware.grouper.Group grouperGroup = connector.fetchGrouperGroup(groupName);

    if (!connector.shouldSyncGroup(grouperGroup)) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping membership delete, nothing to do cause the group is not flagged or is gone.", consumerName,
                toString(changeLogEntry));
        return;
    }

    final String subjectId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_DELETE.subjectId);
    final String sourceId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_DELETE.sourceId);
    final Subject lookupSubject = connector.fetchGrouperSubject(sourceId, subjectId);
    final SubjectType subjectType = lookupSubject.getType();

    //For nested groups, ChangeLogEvents fire when the group is removed, and also for each indirect user added,
    //so we only need to handle PERSON events.
    if (subjectType == SubjectTypeEnum.PERSON) {
        try {
            connector.removeGooMembership(groupName, lookupSubject);
        } catch (IOException e) {
            LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Error processing membership delete: {}", new Object[]{consumerName,
                    toString(changeLogEntry), e});
        }
    }
}
 
开发者ID:Unicon,项目名称:googleapps-grouper-provisioner,代码行数:36,代码来源:GoogleAppsChangeLogConsumer.java

示例2: processPrivilegeAdd

protected void processPrivilegeAdd(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) {
    final String ROLE = "MEMBER"; //Other types are ADMIN and OWNER. Neither makes sense for managed groups.

    LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing privilege add.", consumerName,
            toString(changeLogEntry));

    final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_ADD.ownerName);
    final String privilegeName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_ADD.privilegeName);
    final String memberId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_ADD.memberId);

    final edu.internet2.middleware.grouper.Group grouperGroup = connector.fetchGrouperGroup(groupName);
    final Member member = MemberFinder.findByUuid(GrouperSession.staticGrouperSession(), memberId, false);

    if (!connector.shouldSyncGroup(grouperGroup)) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping privilege add, nothing to do cause the group is not flagged or is gone.", consumerName,
                toString(changeLogEntry));

        return;
    }

    if (member.getSubjectType() == SubjectTypeEnum.PERSON) {
        try {
            connector.createGooMember(grouperGroup, member.getSubject(), connector.determineRole(member, grouperGroup));
        } catch (IOException e) {
            LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Error processing privilege add: {}", new Object[]{consumerName,
                    toString(changeLogEntry), e});
        }
    }

}
 
开发者ID:Unicon,项目名称:googleapps-grouper-provisioner,代码行数:30,代码来源:GoogleAppsChangeLogConsumer.java

示例3: processPrivilegeUpdate

/**
 * Update a privilege entry.
 *
 * @param consumer the change log consumer
 * @param changeLogEntry the change log entry
 */
protected void processPrivilegeUpdate(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) {

    LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing privilege update.", consumerName,
            toString(changeLogEntry));

    final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_UPDATE.ownerName);
    final String privilegeName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_UPDATE.privilegeName);
    final String memberId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_UPDATE.id);

    final edu.internet2.middleware.grouper.Group grouperGroup = connector.fetchGrouperGroup(groupName);
    final Member member = MemberFinder.findByUuid(GrouperSession.staticGrouperSession(), memberId, false);

    if (!connector.shouldSyncGroup(grouperGroup)) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping privilege update, nothing to do cause the group is not flagged or is gone.", consumerName,
                toString(changeLogEntry));

        return;
    }

    if (member.getSubjectType() == SubjectTypeEnum.PERSON) {
        try {
            connector.updateGooMember(grouperGroup, member.getSubject(), connector.determineRole(member, grouperGroup));
        } catch (IOException e) {
            LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Error processing privilege update: {}", new Object[]{consumerName,
                    toString(changeLogEntry), e});
        }
    }

}
 
开发者ID:Unicon,项目名称:googleapps-grouper-provisioner,代码行数:35,代码来源:GoogleAppsChangeLogConsumer.java

示例4: processPrivilegeDelete

/**
 * Delete a privilege entry.
 *
 * @param consumer the change log consumer
 * @param changeLogEntry the change log entry
 */
protected void processPrivilegeDelete(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) {

    LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing privilege delete.", consumerName,
            toString(changeLogEntry));

    final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_DELETE.ownerName);
    final String privilegeName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_DELETE.privilegeName);
    final String memberId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.PRIVILEGE_DELETE.memberId);

    final edu.internet2.middleware.grouper.Group grouperGroup = connector.fetchGrouperGroup(groupName);
    final Member member = MemberFinder.findByUuid(GrouperSession.staticGrouperSession(), memberId, false);

    if (!connector.shouldSyncGroup(grouperGroup)) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping privilege delete, nothing to do cause the group is not flagged or is gone", consumerName,
                toString(changeLogEntry));

        return;
    }

    if (member.getSubjectType() == SubjectTypeEnum.PERSON) {
        try {
            if (grouperGroup.hasMember(member.getSubject())) {
                connector.updateGooMember(grouperGroup, member.getSubject(), connector.determineRole(member, grouperGroup));
            } else {
                connector.removeGooMembership(grouperGroup.getName(), member.getSubject());
            }

        } catch (IOException e) {
            LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Error processing privilege delete: {}",
                    new Object[]{consumerName, toString(changeLogEntry), e});
        }
    }

}
 
开发者ID:Unicon,项目名称:googleapps-grouper-provisioner,代码行数:40,代码来源:GoogleAppsChangeLogConsumer.java

示例5: processMembershipAdd

/**
 * Add a membership.
 *
 * @param consumer the change log consumer
 * @param changeLogEntry the change log entry
 */
protected void processMembershipAdd(GoogleAppsChangeLogConsumer consumer, ChangeLogEntry changeLogEntry) {

    LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Processing membership add.", consumerName,
            toString(changeLogEntry));

    final String groupName = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_ADD.groupName);
    final String memberId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_ADD.memberId);
    final edu.internet2.middleware.grouper.Group grouperGroup = connector.fetchGrouperGroup(groupName);
    final Member member = MemberFinder.findByUuid(GrouperSession.staticGrouperSession(), memberId, false);

    if (!connector.shouldSyncGroup(grouperGroup)) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Skipping membership add, nothing to do cause the group is not flagged or is gone.", consumerName,
                toString(changeLogEntry));
        return;
    }

    final String subjectId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_ADD.subjectId);
    final String sourceId = changeLogEntry.retrieveValueForLabel(ChangeLogLabels.MEMBERSHIP_ADD.sourceId);
    final Subject lookupSubject = connector.fetchGrouperSubject(sourceId, subjectId);
    final SubjectType subjectType = lookupSubject.getType();

    try {
        Group group = connector.fetchGooGroup(connector.getAddressFormatter().qualifyGroupAddress(groupName));
        if (group == null) {
            connector.createGooGroupIfNecessary(grouperGroup);
            group = connector.fetchGooGroup(connector.getAddressFormatter().qualifyGroupAddress(groupName));
        }

        //For nested groups, ChangeLogEvents fire when the group is added, and also for each indirect user added,
        //so we only need to handle PERSON events.
        if (subjectType == SubjectTypeEnum.PERSON) {
            User user = connector.fetchGooUser(connector.getAddressFormatter().qualifySubjectAddress(subjectId));
            if (user == null) {
                user = connector.createGooUser(lookupSubject);
            }

            if (user != null) {
                connector.createGooMember(group, user, connector.determineRole(member, grouperGroup));
            }
        }

    } catch (IOException e) {
        LOG.debug("Google Apps Consumer '{}' - Change log entry '{}' Error processing membership add failed: {}", new Object[] {consumerName,
                toString(changeLogEntry), e});
    }
}
 
开发者ID:Unicon,项目名称:googleapps-grouper-provisioner,代码行数:52,代码来源:GoogleAppsChangeLogConsumer.java

示例6: NonGridSubject

protected NonGridSubject(String id, Source source) {
	this.id = id;
	this.type = SubjectTypeEnum.PERSON;
	this.source = source;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:5,代码来源:NonGridSubject.java

示例7: GridUserSubject

public GridUserSubject(String id, Source source) {
	super(id, SubjectTypeEnum.PERSON, source);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:3,代码来源:GridUserSubject.java

示例8: AnonymousGridUserSubject

public AnonymousGridUserSubject(Source source) {
	super(ANONYMOUS_GRID_USER_ID, SubjectTypeEnum.PERSON, source);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:3,代码来源:AnonymousGridUserSubject.java


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